libsidplayfp  1.0.1
Public Member Functions | Static Public Attributes
SidTune Class Reference

#include <SidTune.h>

List of all members.

Public Member Functions

 SidTune (const char *fileName, const char **fileNameExt=0, bool separatorIsSlash=false)
 SidTune (const uint_least8_t *oneFileFormatSidtune, uint_least32_t sidtuneLength)
void setFileNameExtensions (const char **fileNameExt)
void load (const char *fileName, bool separatorIsSlash=false)
void read (const uint_least8_t *sourceBuffer, uint_least32_t bufferLen)
unsigned int selectSong (unsigned int songNum)
const SidTuneInfogetInfo () const
const SidTuneInfogetInfo (unsigned int songNum)
bool getStatus () const
const char * statusString () const
bool placeSidTuneInC64mem (sidmemory *mem)
const char * createMD5 (char *md5=0)

Static Public Attributes

static const int MD5_LENGTH = 32

Detailed Description

SidTune


Constructor & Destructor Documentation

SidTune::SidTune ( const char *  fileName,
const char **  fileNameExt = 0,
bool  separatorIsSlash = false 
)

Load a sidtune from a file.

To retrieve data from standard input pass in filename "-". If you want to override the default filename extensions use this contructor. Please note, that if the specified "fileName" does exist and the loader is able to determine its file format, this function does not try to append any file name extension. See "SidTune.cpp" for the default list of file name extensions. You can specify "fileName = 0", if you do not want to load a sidtune. You can later load one with open().

Parameters:
fileName
fileNameExt
separatorIsSlash
SidTune::SidTune ( const uint_least8_t *  oneFileFormatSidtune,
uint_least32_t  sidtuneLength 
)

Load a single-file sidtune from a memory buffer. Currently supported: PSID format.

Parameters:
oneFileFormatSidtunethe buffer that contains song data
sidtuneLengthlength of the buffer

Member Function Documentation

const char * SidTune::createMD5 ( char *  md5 = 0)

Calculates the MD5 hash of the tune. Not providing an md5 buffer will cause the internal one to be used. If provided, buffer must be MD5_LENGTH + 1

Returns:
a pointer to the buffer containing the md5 string, 0 if no tune is loaded.
const SidTuneInfo * SidTune::getInfo ( ) const

Retrieve current active sub-song specific information.

Returns:
a pointer to SidTuneInfo, 0 if no tune is loaded. The pointer must not be deleted.
const SidTuneInfo * SidTune::getInfo ( unsigned int  songNum)

Select sub-song and retrieve information.

Parameters:
songNumthe selected song (0 = default starting song)
Returns:
a pointer to SidTuneInfo, 0 if no tune is loaded. The pointer must not be deleted.
bool SidTune::getStatus ( ) const

Determine current state of object. Upon error condition use statusString to get a descriptive text string.

Returns:
current state (true = okay, false = error)
void SidTune::load ( const char *  fileName,
bool  separatorIsSlash = false 
)

Load a sidtune into an existing object from a file.

Parameters:
fileName
separatorIsSlash
bool SidTune::placeSidTuneInC64mem ( sidmemory mem)

Copy sidtune into C64 memory (64 KB).

void SidTune::read ( const uint_least8_t *  sourceBuffer,
uint_least32_t  bufferLen 
)

Load a sidtune into an existing object from a buffer.

Parameters:
sourceBufferthe buffer that contains song data
bufferLenlength of the buffer
unsigned int SidTune::selectSong ( unsigned int  songNum)

Select sub-song.

Parameters:
songNumthe selected song (0 = default starting song)
Returns:
active song number, 0 if no tune is loaded.
void SidTune::setFileNameExtensions ( const char **  fileNameExt)

The SidTune class does not copy the list of file name extensions, so make sure you keep it. If the provided pointer is 0, the default list will be activated. This is a static list which is used by all SidTune objects.

Parameters:
fileNameExt
const char * SidTune::statusString ( ) const

Error/status message of last operation


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