netmd++  1.0.4
C++ API to access NetMD devices
netmd::CNetMdApi Class Reference

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...
 

Detailed Description

This class describes a C++ NetMD access library.

Member Function Documentation

◆ addTrackToGroup()

int netmd::CNetMdApi::addTrackToGroup ( int  track,
int  group 
)

Adds a track to group.

Parameters
[in]trackThe track
[in]groupThe group
Returns
NetMdErr

◆ createGroup()

int netmd::CNetMdApi::createGroup ( const std::string &  title,
int  first,
int  last 
)

Creates a group.

Parameters
[in]titleThe title
[in]firstThe first track
[in]lastThe last track
Returns
NetMdErr

◆ deleteGroup()

int netmd::CNetMdApi::deleteGroup ( int  group)

delete a group

Parameters
[in]groupThe group
Returns
NetMdErr

◆ deleteTrack()

int netmd::CNetMdApi::deleteTrack ( uint16_t  track)

delete track

Parameters
[in]trackThe track number
Returns
NetMdErr

◆ delTrackFromGroup()

int netmd::CNetMdApi::delTrackFromGroup ( int  track,
int  group 
)

remove track from group

Parameters
[in]trackThe track
[in]groupThe group
Returns
NetMdErr

◆ discCapacity()

int netmd::CNetMdApi::discCapacity ( DiscCapacity dcap)

get disc capacity

Parameters
[out]dcapThe buffer for disc capacity
Returns
NetMdErr

◆ discFlags()

int netmd::CNetMdApi::discFlags ( )

request disc flags

Returns
< 0 -> NetMdErr; else -> flags

◆ discTitle()

int netmd::CNetMdApi::discTitle ( std::string &  title)

get disc title

Parameters
[out]titleThe title
Returns
NetMdErr

◆ endHBSession()

void netmd::CNetMdApi::endHBSession ( uint32_t  features)

stop homebrew session

Parameters
featuresOR'd HomebrewFeatures
Returns
NetMdErr
See also
NetMdErr

◆ eraseDisc()

int netmd::CNetMdApi::eraseDisc ( )

erase MD

Returns
NetMdErr

◆ finalizeTOC()

int netmd::CNetMdApi::finalizeTOC ( bool  reset = false,
uint8_t  resetWait = 15 
)

finalize TOC through exploit

Parameters
[in]resetdo reset if true (default: false)
[in]resetWaitThe optional reset wait time (15 seconds) Only needed if reset is true
Returns
NetMdErr
See also
NetMdErr

◆ getDeviceName()

std::string netmd::CNetMdApi::getDeviceName ( ) const

Gets the device name.

Returns
The device name.

◆ groups()

Groups netmd::CNetMdApi::groups ( )

get MD track groups

Returns
vector of group structures

◆ initDevice()

int netmd::CNetMdApi::initDevice ( )

Initializes the device.

Returns
NetMdErr

◆ initHotPlug()

int netmd::CNetMdApi::initHotPlug ( )

init libusb hotplug (native or emulation)

Returns
NetMdErr

◆ moveTrack()

int netmd::CNetMdApi::moveTrack ( uint16_t  from,
uint16_t  to 
)

move a track (number)

Parameters
[in]fromfrom position
[in]toto position
Returns
NetMdErr

◆ nativeMonoUploadSupported()

bool netmd::CNetMdApi::nativeMonoUploadSupported ( )

is native mono upload supported?

Returns
true if supported, false if not

◆ otfEncodeSupported()

bool netmd::CNetMdApi::otfEncodeSupported ( )

is on the fly encoding supported by device

Returns
true if so

◆ pcm2MonoSupported()

bool netmd::CNetMdApi::pcm2MonoSupported ( )

is PCM to mono supported?

Returns
true if supported, false if not

◆ pcmSpeedupSupported()

bool netmd::CNetMdApi::pcmSpeedupSupported ( )

is PCM speedup supportd

Returns
true if supported, false if not

◆ prepareTOCManip()

int netmd::CNetMdApi::prepareTOCManip ( )

prepare TOC manipulation

Returns
NetMdErr

◆ readUTOCSector()

NetMDByteVector netmd::CNetMdApi::readUTOCSector ( UTOCSector  s)

Reads an utoc sector.

Parameters
[in]ssector number
Returns
TOC sector data. (error if empty)

◆ registerForHotplugEvents()

void netmd::CNetMdApi::registerForHotplugEvents ( EvtCallback  cb)

register hotplug callback function

Parameters
[in]cbcallback function to e called on device add / removal if is nullptr, the callback will be removed

◆ sendAudioFile()

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.

Parameters
[in]filenameThe filename
[in]titleThe title
[in]otfThe disk format
Returns
NetMdErr

◆ setDiscTitle()

int netmd::CNetMdApi::setDiscTitle ( const std::string &  title)

Sets the disc title.

Parameters
[in]titleThe title
Returns
NetMdErr

◆ setGroupTitle()

int netmd::CNetMdApi::setGroupTitle ( uint16_t  group,
const std::string &  title 
)

Sets the group title.

Parameters
[in]groupThe group
[in]titleThe title
Returns
NetMdErr

◆ setLogLevel()

static void netmd::CNetMdApi::setLogLevel ( int  severity)
static

Sets the log level.

Parameters
[in]severityThe severity

◆ setLogStream()

static void netmd::CNetMdApi::setLogStream ( std::ostream &  os)
static

Sets the log stream.

Parameters
[in]osThe stream instance to log to

◆ setTrackTitle()

int netmd::CNetMdApi::setTrackTitle ( uint16_t  trackNo,
const std::string &  title 
)

Sets the track title.

Parameters
[in]trackNoThe track no
[in]titleThe title
Returns
NetMdErr

◆ spUploadSupported()

bool netmd::CNetMdApi::spUploadSupported ( )

is SP upload supported?

Returns
true if yes

◆ startHBSession()

int netmd::CNetMdApi::startHBSession ( uint32_t  features)

start homebrew

Parameters
featuresOR'd HomebrewFeatures
Returns
NetMdErr
See also
NetMdErr

◆ tocManipSupported()

bool netmd::CNetMdApi::tocManipSupported ( )

is TOC manipulation supported?

Returns
true if supported, false if not

◆ trackBitRate()

int netmd::CNetMdApi::trackBitRate ( uint16_t  track,
AudioEncoding encoding,
uint8_t &  channel 
)

get track bitrate data

Parameters
[in]trackThe track number
[out]encodingThe encoding flag
[out]channelThe channel flag
Returns
NetMdErr

◆ trackCount()

int netmd::CNetMdApi::trackCount ( )

request track count

Returns
< 0 -> NetMdErr; else -> track count

◆ trackFlags()

int netmd::CNetMdApi::trackFlags ( uint16_t  track,
TrackProtection flags 
)

get track flags

Parameters
[in]trackThe track number
[out]flagsThe track flags
Returns
NetMdErr

◆ trackTime()

int netmd::CNetMdApi::trackTime ( int  trackNo,
TrackTime trackTime 
)

get track time

Parameters
[in]trackNoThe track no
[out]trackTimeThe track time
Returns
NetMdErr

◆ trackTitle()

int netmd::CNetMdApi::trackTitle ( uint16_t  track,
std::string &  title 
)

get track title

Parameters
[in]trackThe track number
[out]titleThe track title
Returns
NetMdErr

◆ writeUTOCSector()

int netmd::CNetMdApi::writeUTOCSector ( UTOCSector  s,
const NetMDByteVector data 
)

Writes an utoc sector.

Parameters
[in]ssector names
[in]dataThe data to be written
Returns
NetMdErr

The documentation for this class was generated from the following file: