![]() |
netmd++
1.0.4
C++ API to access NetMD devices
|
This class describes a C++ NetMD access library. More...
#include <netmd++.h>
Public Member Functions | |
| CNetMdApi () | |
| Constructs a new instance. | |
| ~CNetMdApi () | |
| Destroys the object. | |
| int | initHotPlug () |
| init libusb hotplug (native or emulation) More... | |
| int | initDevice () |
| Initializes the device. More... | |
| std::string | getDeviceName () const |
| Gets the device name. More... | |
| int | trackCount () |
| request track count More... | |
| int | discFlags () |
| request disc flags More... | |
| int | eraseDisc () |
| erase MD More... | |
| int | trackTime (int trackNo, TrackTime &trackTime) |
| get track time More... | |
| int | discTitle (std::string &title) |
| get disc title More... | |
| int | setDiscTitle (const std::string &title) |
| Sets the disc title. More... | |
| int | moveTrack (uint16_t from, uint16_t to) |
| move a track (number) More... | |
| int | setGroupTitle (uint16_t group, const std::string &title) |
| Sets the group title. More... | |
| int | createGroup (const std::string &title, int first, int last) |
| Creates a group. More... | |
| int | addTrackToGroup (int track, int group) |
| Adds a track to group. More... | |
| int | delTrackFromGroup (int track, int group) |
| remove track from group More... | |
| int | deleteGroup (int group) |
| delete a group More... | |
| int | deleteTrack (uint16_t track) |
| delete track More... | |
| int | trackBitRate (uint16_t track, AudioEncoding &encoding, uint8_t &channel) |
| get track bitrate data More... | |
| int | trackFlags (uint16_t track, TrackProtection &flags) |
| get track flags More... | |
| int | trackTitle (uint16_t track, std::string &title) |
| get track title More... | |
| bool | spUploadSupported () |
| is SP upload supported? More... | |
| bool | otfEncodeSupported () |
| is on the fly encoding supported by device More... | |
| bool | tocManipSupported () |
| is TOC manipulation supported? More... | |
| bool | pcm2MonoSupported () |
| is PCM to mono supported? More... | |
| bool | nativeMonoUploadSupported () |
| is native mono upload supported? More... | |
| bool | pcmSpeedupSupported () |
| is PCM speedup supportd More... | |
| int | sendAudioFile (const std::string &filename, const std::string &title, DiskFormat otf) |
| Sends an audio track. More... | |
| int | setTrackTitle (uint16_t trackNo, const std::string &title) |
| Sets the track title. More... | |
| int | discCapacity (DiscCapacity &dcap) |
| get disc capacity More... | |
| Groups | groups () |
| get MD track groups More... | |
| int | prepareTOCManip () |
| prepare TOC manipulation More... | |
| NetMDByteVector | readUTOCSector (UTOCSector s) |
| Reads an utoc sector. More... | |
| int | writeUTOCSector (UTOCSector s, const NetMDByteVector &data) |
| Writes an utoc sector. More... | |
| int | finalizeTOC (bool reset=false, uint8_t resetWait=15) |
| finalize TOC through exploit More... | |
| int | startHBSession (uint32_t features) |
| start homebrew More... | |
| void | endHBSession (uint32_t features) |
| stop homebrew session More... | |
| void | registerForHotplugEvents (EvtCallback cb) |
| register hotplug callback function More... | |
Static Public Member Functions | |
| static void | setLogLevel (int severity) |
| Sets the log level. More... | |
| static void | setLogStream (std::ostream &os) |
| Sets the log stream. More... | |
This class describes a C++ NetMD access library.
| int netmd::CNetMdApi::addTrackToGroup | ( | int | track, |
| int | group | ||
| ) |
Adds a track to group.
| [in] | track | The track |
| [in] | group | The group |
| int netmd::CNetMdApi::createGroup | ( | const std::string & | title, |
| int | first, | ||
| int | last | ||
| ) |
Creates a group.
| [in] | title | The title |
| [in] | first | The first track |
| [in] | last | The last track |
| int netmd::CNetMdApi::deleteGroup | ( | int | group | ) |
delete a group
| [in] | group | The group |
| int netmd::CNetMdApi::deleteTrack | ( | uint16_t | track | ) |
delete track
| [in] | track | The track number |
| int netmd::CNetMdApi::delTrackFromGroup | ( | int | track, |
| int | group | ||
| ) |
remove track from group
| [in] | track | The track |
| [in] | group | The group |
| int netmd::CNetMdApi::discCapacity | ( | DiscCapacity & | dcap | ) |
get disc capacity
| [out] | dcap | The buffer for disc capacity |
| int netmd::CNetMdApi::discFlags | ( | ) |
request disc flags
| int netmd::CNetMdApi::discTitle | ( | std::string & | title | ) |
get disc title
| [out] | title | The title |
| void netmd::CNetMdApi::endHBSession | ( | uint32_t | features | ) |
stop homebrew session
| features | OR'd HomebrewFeatures |
| int netmd::CNetMdApi::eraseDisc | ( | ) |
erase MD
| int netmd::CNetMdApi::finalizeTOC | ( | bool | reset = false, |
| uint8_t | resetWait = 15 |
||
| ) |
finalize TOC through exploit
| [in] | reset | do reset if true (default: false) |
| [in] | resetWait | The optional reset wait time (15 seconds) Only needed if reset is true |
| std::string netmd::CNetMdApi::getDeviceName | ( | ) | const |
Gets the device name.
| Groups netmd::CNetMdApi::groups | ( | ) |
get MD track groups
| int netmd::CNetMdApi::initDevice | ( | ) |
Initializes the device.
| int netmd::CNetMdApi::initHotPlug | ( | ) |
init libusb hotplug (native or emulation)
| int netmd::CNetMdApi::moveTrack | ( | uint16_t | from, |
| uint16_t | to | ||
| ) |
move a track (number)
| [in] | from | from position |
| [in] | to | to position |
| bool netmd::CNetMdApi::nativeMonoUploadSupported | ( | ) |
is native mono upload supported?
| bool netmd::CNetMdApi::otfEncodeSupported | ( | ) |
is on the fly encoding supported by device
| bool netmd::CNetMdApi::pcm2MonoSupported | ( | ) |
is PCM to mono supported?
| bool netmd::CNetMdApi::pcmSpeedupSupported | ( | ) |
is PCM speedup supportd
| int netmd::CNetMdApi::prepareTOCManip | ( | ) |
prepare TOC manipulation
| NetMDByteVector netmd::CNetMdApi::readUTOCSector | ( | UTOCSector | s | ) |
Reads an utoc sector.
| [in] | s | sector number |
| void netmd::CNetMdApi::registerForHotplugEvents | ( | EvtCallback | cb | ) |
register hotplug callback function
| [in] | cb | callback function to e called on device add / removal if is nullptr, the callback will be removed |
| int netmd::CNetMdApi::sendAudioFile | ( | const std::string & | filename, |
| const std::string & | title, | ||
| DiskFormat | otf | ||
| ) |
Sends an audio track.
The audio file must be either an WAVE file (44.1kHz / 16 bit), or an pre-encoded atrac3 file with a WAVE header. If your device supports on-the-fly encoding (not common), you can set the DiskFormat to NETMD_DISKFORMAT_LP4 or NETMD_DISKFORMAT_LP2. If you want best audio quality, use NO_ONTHEFLY_CONVERSION.
In case your device supports the SP download through Sony Firmware exploit, the input file might be a plain atrac 1 file.
| [in] | filename | The filename |
| [in] | title | The title |
| [in] | otf | The disk format |
| int netmd::CNetMdApi::setDiscTitle | ( | const std::string & | title | ) |
Sets the disc title.
| [in] | title | The title |
| int netmd::CNetMdApi::setGroupTitle | ( | uint16_t | group, |
| const std::string & | title | ||
| ) |
Sets the group title.
| [in] | group | The group |
| [in] | title | The title |
|
static |
Sets the log level.
| [in] | severity | The severity |
|
static |
Sets the log stream.
| [in] | os | The stream instance to log to |
| int netmd::CNetMdApi::setTrackTitle | ( | uint16_t | trackNo, |
| const std::string & | title | ||
| ) |
Sets the track title.
| [in] | trackNo | The track no |
| [in] | title | The title |
| bool netmd::CNetMdApi::spUploadSupported | ( | ) |
is SP upload supported?
| int netmd::CNetMdApi::startHBSession | ( | uint32_t | features | ) |
start homebrew
| features | OR'd HomebrewFeatures |
| bool netmd::CNetMdApi::tocManipSupported | ( | ) |
is TOC manipulation supported?
| int netmd::CNetMdApi::trackBitRate | ( | uint16_t | track, |
| AudioEncoding & | encoding, | ||
| uint8_t & | channel | ||
| ) |
get track bitrate data
| [in] | track | The track number |
| [out] | encoding | The encoding flag |
| [out] | channel | The channel flag |
| int netmd::CNetMdApi::trackCount | ( | ) |
request track count
| int netmd::CNetMdApi::trackFlags | ( | uint16_t | track, |
| TrackProtection & | flags | ||
| ) |
get track flags
| [in] | track | The track number |
| [out] | flags | The track flags |
| int netmd::CNetMdApi::trackTime | ( | int | trackNo, |
| TrackTime & | trackTime | ||
| ) |
get track time
| [in] | trackNo | The track no |
| [out] | trackTime | The track time |
| int netmd::CNetMdApi::trackTitle | ( | uint16_t | track, |
| std::string & | title | ||
| ) |
get track title
| [in] | track | The track number |
| [out] | title | The track title |
| int netmd::CNetMdApi::writeUTOCSector | ( | UTOCSector | s, |
| const NetMDByteVector & | data | ||
| ) |
Writes an utoc sector.
| [in] | s | sector names |
| [in] | data | The data to be written |