Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

sidTune Class Reference

#include <sidtune.h>

Collaboration diagram for sidTune:

Collaboration graph
[legend]
List of all members.

Public Member Functions

IMPORT_C sidTune (const char *sidTuneFileName)
 sidTune (const char *sidTuneFileName, const char **fileNameExt)
 sidTune (ubyte *oneFileFormatSidtune, udword sidtuneLength)
virtual ~sidTune ()
bool open (const char *sidTuneFileName)
bool load (ubyte *oneFileFormatSidtune, udword sidtuneLength)
IMPORT_C void getInfo (struct sidTuneInfo &)
 return the information about the sidtune in the outInfo struct

virtual bool setInfo (struct sidTuneInfo &)
ubyte getSongSpeed ()
ubyte returnSongSpeed ()
uword getPlayAddr ()
uword returnPlayAddr ()
 operator bool ()
bool getStatus ()
bool returnStatus ()
bool saveC64dataFile (const char *destFileName, bool overWriteFlag=false)
bool saveSIDfile (const char *destFileName, bool overWriteFlag=false)
bool savePSIDfile (const char *destFileName, bool overWriteFlag=false)
bool saveSID2file (const char *destFileName, bool overWriteFlag=false)

Public Attributes

bool status
sidTuneInfo info

Protected Member Functions

void convertOldStyleSpeedToTables (udword oldStyleSpeed)
bool placeSidTuneInC64mem (ubyte *c64buf)
udword loadFile (const char *fileName, ubyte **bufferRef)
bool cacheRawData (void *sourceBuffer, udword sourceBufLen)
bool getCachedRawData (void *destBuffer, udword destBufLen)
virtual bool PSID_fileSupport (void *buffer, udword bufLen)
virtual bool MUS_fileSupport (void *buffer, udword bufLen)
virtual void MUS_installPlayer (ubyte *c64buf)
virtual bool INFO_fileSupport (void *dataBuffer, udword dataBufLen, void *infoBuffer, udword infoBufLen)
virtual bool SID_fileSupport (void *dataBuffer, udword dataBufLen, void *sidBuffer, udword sidBufLen)

Protected Attributes

ubyte songSpeed [classMaxSongs]
uword songLength [classMaxSongs]
char infoString [infoStringNum][infoStringLen]
ubyte fillUpWidth
bool isCached
ubytecachePtr
udword cacheLen
ubytefileBuf
ubytefileBuf2
udword fileOffset
const char *const * fileNameExtensions

Private Member Functions

void safeConstructor ()
void safeDestructor ()
void stdinConstructor ()
void filesConstructor (const char *)
uword selectSong (uword selectedSong)
 First check, whether a song is valid.

void setIRQaddress (uword address)
void deleteFileBuffers ()
bool getSidtuneFromFileBuffer (ubyte *buffer, udword bufferLen)
void acceptSidTune (const char *dataFileName, const char *infoFileName, ubyte *dataFileBuf, udword dataLen)
bool createNewFileName (char **destStringPtr, const char *sourceName, const char *sourceExt)

Friends

bool sidEmuInitializeSongOld (emuEngine &, sidTune &, uword songNum)

Constructor & Destructor Documentation

EXPORT_C sidTune::sidTune const char *  sidTuneFileName  ) 
 

Definition at line 70 of file sidtune.cpp.

References deleteFileBuffers(), filesConstructor(), safeConstructor(), and stdinConstructor().

sidTune::sidTune const char *  sidTuneFileName,
const char **  fileNameExt
 

Definition at line 113 of file sidtune.cpp.

References deleteFileBuffers(), fileNameExtensions, filesConstructor(), safeConstructor(), and stdinConstructor().

sidTune::sidTune ubyte oneFileFormatSidtune,
udword  sidtuneLength
 

Definition at line 93 of file sidtune.cpp.

References sidTuneInfo::dataFileLen, getSidtuneFromFileBuffer(), info, safeConstructor(), status, sidTuneInfo::statusString, and text_fileTooLong.

sidTune::~sidTune  )  [virtual]
 

Definition at line 138 of file sidtune.cpp.

References safeDestructor().


Member Function Documentation

void sidTune::acceptSidTune const char *  dataFileName,
const char *  infoFileName,
ubyte dataFileBuf,
udword  dataLen
[private]
 

Definition at line 626 of file sidtune.cpp.

References sidTuneInfo::c64dataLen, cacheRawData(), sidTuneInfo::dataFileLen, sidTuneInfo::dataFileName, fileOffset, info, sidTuneInfo::infoFileName, myStrDup(), sidTuneInfo::songs, sidTuneInfo::startSong, status, sidTuneInfo::statusString, and text_notEnoughMemory.

Referenced by filesConstructor().

bool sidTune::cacheRawData void *  sourceBuffer,
udword  sourceBufLen
[protected]
 

Definition at line 451 of file sidtune.cpp.

References cacheLen, cachePtr, info, isCached, status, sidTuneInfo::statusString, text_noErrors, text_notEnoughMemory, and ubyte.

Referenced by acceptSidTune(), and getSidtuneFromFileBuffer().

void sidTune::convertOldStyleSpeedToTables udword  oldStyleSpeed  )  [protected]
 

Definition at line 870 of file sidtune.cpp.

References info, sidTuneInfo::songs, and songSpeed.

Referenced by INFO_fileSupport(), PSID_fileSupport(), and SID_fileSupport().

bool sidTune::createNewFileName char **  destStringPtr,
const char *  sourceName,
const char *  sourceExt
[private]
 

Definition at line 668 of file sidtune.cpp.

References fileExtOfFilename(), fileNameWithoutPath(), info, status, sidTuneInfo::statusString, and text_notEnoughMemory.

Referenced by filesConstructor().

void sidTune::deleteFileBuffers  )  [private]
 

Definition at line 434 of file sidtune.cpp.

References fileBuf, and fileBuf2.

Referenced by open(), safeDestructor(), sidTune(), and stdinConstructor().

void sidTune::filesConstructor const char *   )  [private]
 

Definition at line 693 of file sidtune.cpp.

References acceptSidTune(), createNewFileName(), sidTuneInfo::dataFileLen, fileBuf, fileBuf2, fileNameExtensions, sidTuneInfo::formatString, info, INFO_fileSupport(), loadFile(), MUS_fileSupport(), PSID_fileSupport(), SID_fileSupport(), status, sidTuneInfo::statusString, text_na, text_noDataFile, text_unrecognizedFormat, and udword.

Referenced by open(), and sidTune().

bool sidTune::getCachedRawData void *  destBuffer,
udword  destBufLen
[protected]
 

Definition at line 474 of file sidtune.cpp.

References cacheLen, cachePtr, sidTuneInfo::dataFileLen, info, status, sidTuneInfo::statusString, text_fatalInternal, text_noErrors, and ubyte.

EXPORT_C void sidTune::getInfo struct sidTuneInfo outInfo  ) 
 

return the information about the sidtune in the outInfo struct

Parameters:
outInfo sidTuneInfo where info will be written

Definition at line 181 of file sidtune.cpp.

References info.

Referenced by CSidPlayerStatusView::Draw(), CSidPlayAppUi::HandleCommandL(), CSidPlayer::InitL(), InitMainL(), main(), CSidPlayer::SongDelta(), CSidPlayer::SongSelect(), and CSidPlayAppUi::UpdateCbaL().

uword sidTune::getPlayAddr  )  [inline]
 

Definition at line 117 of file sidtune.h.

References info, sidTuneInfo::playAddr, and uword.

Referenced by returnPlayAddr().

bool sidTune::getSidtuneFromFileBuffer ubyte buffer,
udword  bufferLen
[private]
 

Definition at line 592 of file sidtune.cpp.

References buffer, sidTuneInfo::c64dataLen, cacheRawData(), fileOffset, sidTuneInfo::formatString, info, MUS_fileSupport(), PSID_fileSupport(), status, sidTuneInfo::statusString, text_na, text_noErrors, and text_unrecognizedFormat.

Referenced by load(), sidTune(), and stdinConstructor().

ubyte sidTune::getSongSpeed  )  [inline]
 

Definition at line 114 of file sidtune.h.

References info, sidTuneInfo::songSpeed, and ubyte.

Referenced by returnSongSpeed().

bool sidTune::getStatus  )  [inline]
 

Definition at line 133 of file sidtune.h.

References status.

Referenced by returnStatus().

bool sidTune::INFO_fileSupport void *  dataBuffer,
udword  dataBufLen,
void *  infoBuffer,
udword  infoBufLen
[protected, virtual]
 

Definition at line 48 of file info_.cpp.

References sidTuneInfo::authorString, convertOldStyleSpeedToTables(), copyItem(), sidTuneInfo::copyrightString, fileOffset, sidTuneInfo::formatString, GFLG_GADGIMAGE, info, sidTuneInfo::infoString, infoString, sidTuneInfo::initAddr, keyword_address, keyword_author, keyword_copyright, keyword_musPlayer, keyword_name, keyword_songs, keyword_speed, sidTuneInfo::loadAddr, sidTuneInfo::musPlayer, myStrNcaseCmp(), sidTuneInfo::nameString, sidTuneInfo::numberOfInfoStrings, sidTuneInfo::playAddr, readEndian(), safeBufferSize, sidTuneInfo::songs, sidTuneInfo::startSong, smartPtrBase< TP >::tellBegin(), text_corruptError, text_dataCorruptError, text_format, text_noMemError, text_noStringsError, ubyte, udword, ulong, uword, WB_DISKMAGIC, WB_DISKVERSION, and WB_PROJECT.

Referenced by filesConstructor().

bool sidTune::load ubyte oneFileFormatSidtune,
udword  sidtuneLength
 

Definition at line 146 of file sidtune.cpp.

References sidTuneInfo::dataFileLen, getSidtuneFromFileBuffer(), info, safeConstructor(), safeDestructor(), status, sidTuneInfo::statusString, and text_fileTooLong.

udword sidTune::loadFile const char *  fileName,
ubyte **  bufferRef
[protected]
 

Definition at line 280 of file sidtune.cpp.

References ELOG1, ELOG2, info, status, sidTuneInfo::statusString, text_cantLoadFile, text_cantOpenFile, text_noErrors, text_notEnoughMemory, ubyte, and udword.

Referenced by filesConstructor().

bool sidTune::MUS_fileSupport void *  buffer,
udword  bufLen
[protected, virtual]
 

Definition at line 12 of file mus_.cpp.

References c, smartPtrBase< TP >::fail(), fileOffset, sidTuneInfo::formatString, HLTcmd, info, sidTuneInfo::infoString, infoString, sidTuneInfo::initAddr, sidTuneInfo::loadAddr, sidTuneInfo::musPlayer, sidTuneInfo::numberOfInfoStrings, sidTuneInfo::playAddr, readEndian(), sidTuneInfo::songs, songSpeed, sidTuneInfo::startSong, text_format, ubyte, and udword.

Referenced by filesConstructor(), and getSidtuneFromFileBuffer().

void sidTune::MUS_installPlayer ubyte c64buf  )  [protected, virtual]
 

Definition at line 193 of file mus_.cpp.

References readEndian(), sidplayer, status, and uword.

Referenced by sidEmuInitializeSongOld().

bool sidTune::open const char *  sidTuneFileName  ) 
 

Definition at line 167 of file sidtune.cpp.

References deleteFileBuffers(), filesConstructor(), safeConstructor(), safeDestructor(), and status.

sidTune::operator bool  )  [inline]
 

Definition at line 132 of file sidtune.h.

References status.

bool sidTune::placeSidTuneInC64mem ubyte c64buf  )  [protected]
 

Definition at line 244 of file sidtune.cpp.

References sidTuneInfo::c64dataLen, cachePtr, fileOffset, info, isCached, sidTuneInfo::loadAddr, status, sidTuneInfo::statusString, text_dataTooLong, and udword.

Referenced by sidEmuInitializeSongOld().

bool sidTune::PSID_fileSupport void *  buffer,
udword  bufLen
[protected, virtual]
 

Definition at line 34 of file psid_.cpp.

References psidHeader::author, sidTuneInfo::authorString, buffer, convertOldStyleSpeedToTables(), psidHeader::copyright, sidTuneInfo::copyrightString, psidHeader::data, fileOffset, psidHeader::flags, sidTuneInfo::formatString, psidHeader::id, info, sidTuneInfo::infoString, infoString, psidHeader::init, sidTuneInfo::initAddr, psidHeader::load, sidTuneInfo::loadAddr, sidTuneInfo::musPlayer, psidHeader::name, sidTuneInfo::nameString, sidTuneInfo::numberOfInfoStrings, psidHeader::play, sidTuneInfo::playAddr, readBEdword(), readBEword(), readEndian(), psidHeader::songs, sidTuneInfo::songs, psidHeader::speed, psidHeader::start, sidTuneInfo::startSong, text_format, text_psidTruncated, ubyte, udword, and psidHeader::version.

Referenced by filesConstructor(), and getSidtuneFromFileBuffer().

uword sidTune::returnPlayAddr  )  [inline]
 

Definition at line 118 of file sidtune.h.

References getPlayAddr(), and uword.

Referenced by sidEmu::sidEmuFillBuffer().

ubyte sidTune::returnSongSpeed  )  [inline]
 

Definition at line 115 of file sidtune.h.

References getSongSpeed(), and ubyte.

Referenced by sidEmu::sidEmuFillBuffer().

bool sidTune::returnStatus  )  [inline]
 

Definition at line 134 of file sidtune.h.

References getStatus().

Referenced by sidEmu::sidEmuFillBuffer().

void sidTune::safeConstructor  )  [private]
 

Definition at line 488 of file sidtune.cpp.

References cacheLen, cachePtr, sidTuneInfo::clockSpeed, sidTuneInfo::commentString, CTOR, sidTuneInfo::currentSong, sidTuneInfo::dataFileLen, sidTuneInfo::dataFileName, defaultFileNameExt, fileBuf, fileBuf2, fileNameExtensions, fileOffset, fillUpWidth, sidTuneInfo::formatString, info, sidTuneInfo::infoFileName, infoString, sidTuneInfo::initAddr, sidTuneInfo::loadAddr, sidTuneInfo::musPlayer, myStrDup(), sidTuneInfo::numberOfCommentStrings, sidTuneInfo::numberOfInfoStrings, sidTuneInfo::playAddr, sidTuneInfo::songs, songSpeed, sidTuneInfo::songSpeed, sidTuneInfo::speedString, sidTuneInfo::startSong, status, sidTuneInfo::statusString, and text_na.

Referenced by load(), open(), and sidTune().

void sidTune::safeDestructor  )  [private]
 

Definition at line 535 of file sidtune.cpp.

References cachePtr, sidTuneInfo::commentString, sidTuneInfo::dataFileName, deleteFileBuffers(), DTOR, info, sidTuneInfo::infoFileName, sidTuneInfo::numberOfCommentStrings, status, and udword.

Referenced by load(), open(), and ~sidTune().

bool sidTune::saveC64dataFile const char *  destFileName,
bool  overWriteFlag = false
 

bool sidTune::savePSIDfile const char *  destFileName,
bool  overWriteFlag = false
 

bool sidTune::saveSID2file const char *  destFileName,
bool  overWriteFlag = false
 

bool sidTune::saveSIDfile const char *  destFileName,
bool  overWriteFlag = false
 

uword sidTune::selectSong uword  selectedSong  )  [private]
 

First check, whether a song is valid.

Then copy any song-specific variable information such a speed/clock setting to the info structure.

This is a private member function. It is used only by player.cpp.

Definition at line 191 of file sidtune.cpp.

References sidTuneInfo::clockSpeed, sidTuneInfo::currentSong, info, selectedSong, sidTuneInfo::songs, songSpeed, sidTuneInfo::songSpeed, sidTuneInfo::speedString, sidTuneInfo::startSong, sidTuneInfo::statusString, text_NTSC_CIA, text_NTSC_VBI, text_PAL_CIA, text_PAL_VBI, text_songNumberExceed, and uword.

Referenced by sidEmuInitializeSongOld().

bool sidTune::setInfo struct sidTuneInfo  )  [virtual]
 

Definition at line 176 of file sidtune.cpp.

Referenced by main().

void sidTune::setIRQaddress uword  address  )  [private]
 

Definition at line 237 of file sidtune.cpp.

References info, and sidTuneInfo::irqAddr.

Referenced by sidEmuInitializeSongOld().

bool sidTune::SID_fileSupport void *  dataBuffer,
udword  dataBufLen,
void *  sidBuffer,
udword  sidBufLen
[protected, virtual]
 

Definition at line 29 of file sid_.cpp.

References sidTuneInfo::authorString, c, convertOldStyleSpeedToTables(), sidTuneInfo::copyrightString, copyStringValueToEOL(), fileOffset, sidTuneInfo::formatString, info, sidTuneInfo::infoString, infoString, sidTuneInfo::initAddr, keyword_address, keyword_author, keyword_copyright, keyword_id, keyword_musPlayer, keyword_name, keyword_songs, keyword_speed, sidTuneInfo::loadAddr, MaxInfoStringLen, sidTuneInfo::musPlayer, myStrNcaseCmp(), sidTuneInfo::nameString, sidTuneInfo::numberOfInfoStrings, parseChunkLen, sidTuneInfo::playAddr, readEndian(), returnNextLine(), sidMinFileSize, sidTuneInfo::songs, sidTuneInfo::startSong, text_format, text_noMemError, text_truncatedError, ubyte, udword, and uword.

Referenced by filesConstructor().

void sidTune::stdinConstructor  )  [private]
 

Definition at line 566 of file sidtune.cpp.

References sidTuneInfo::dataFileLen, deleteFileBuffers(), fileBuf, getSidtuneFromFileBuffer(), info, status, sidTuneInfo::statusString, text_fileTooLong, text_notEnoughMemory, ubyte, and uword.

Referenced by sidTune().


Friends And Related Function Documentation

bool sidEmuInitializeSongOld emuEngine thisEmuEngine,
sidTune thisTune,
uword  songNum
[friend]
 

Definition at line 86 of file player.cpp.


Member Data Documentation

udword sidTune::cacheLen [protected]
 

Definition at line 168 of file sidtune.h.

Referenced by cacheRawData(), getCachedRawData(), and safeConstructor().

ubyte* sidTune::cachePtr [protected]
 

Definition at line 167 of file sidtune.h.

Referenced by cacheRawData(), getCachedRawData(), placeSidTuneInC64mem(), safeConstructor(), and safeDestructor().

ubyte* sidTune::fileBuf [protected]
 

Definition at line 172 of file sidtune.h.

Referenced by deleteFileBuffers(), filesConstructor(), safeConstructor(), and stdinConstructor().

ubyte* sidTune::fileBuf2 [protected]
 

Definition at line 173 of file sidtune.h.

Referenced by deleteFileBuffers(), filesConstructor(), and safeConstructor().

const char* const* sidTune::fileNameExtensions [protected]
 

Definition at line 178 of file sidtune.h.

Referenced by filesConstructor(), safeConstructor(), and sidTune().

udword sidTune::fileOffset [protected]
 

Definition at line 175 of file sidtune.h.

Referenced by acceptSidTune(), getSidtuneFromFileBuffer(), INFO_fileSupport(), MUS_fileSupport(), placeSidTuneInC64mem(), PSID_fileSupport(), safeConstructor(), and SID_fileSupport().

ubyte sidTune::fillUpWidth [protected]
 

Definition at line 164 of file sidtune.h.

Referenced by safeConstructor().

sidTuneInfo sidTune::info
 

Definition at line 154 of file sidtune.h.

Referenced by acceptSidTune(), cacheRawData(), convertOldStyleSpeedToTables(), createNewFileName(), filesConstructor(), getCachedRawData(), getInfo(), getPlayAddr(), getSidtuneFromFileBuffer(), getSongSpeed(), INFO_fileSupport(), load(), loadFile(), MUS_fileSupport(), placeSidTuneInC64mem(), PSID_fileSupport(), safeConstructor(), safeDestructor(), selectSong(), setIRQaddress(), SID_fileSupport(), sidEmuInitializeSong(), sidEmuInitializeSongOld(), sidTune(), and stdinConstructor().

char sidTune::infoString[infoStringNum][infoStringLen] [protected]
 

Definition at line 162 of file sidtune.h.

Referenced by INFO_fileSupport(), MUS_fileSupport(), PSID_fileSupport(), safeConstructor(), and SID_fileSupport().

bool sidTune::isCached [protected]
 

Definition at line 166 of file sidtune.h.

Referenced by cacheRawData(), and placeSidTuneInC64mem().

uword sidTune::songLength[classMaxSongs] [protected]
 

Definition at line 159 of file sidtune.h.

ubyte sidTune::songSpeed[classMaxSongs] [protected]
 

Definition at line 158 of file sidtune.h.

Referenced by convertOldStyleSpeedToTables(), MUS_fileSupport(), safeConstructor(), and selectSong().

bool sidTune::status
 

Definition at line 153 of file sidtune.h.

Referenced by acceptSidTune(), cacheRawData(), createNewFileName(), filesConstructor(), getCachedRawData(), getSidtuneFromFileBuffer(), getStatus(), load(), loadFile(), MUS_installPlayer(), open(), operator bool(), placeSidTuneInC64mem(), safeConstructor(), safeDestructor(), sidEmuInitializeSongOld(), sidTune(), and stdinConstructor().


The documentation for this class was generated from the following files:
Generated on Tue Feb 8 04:34:48 2005 for Esidplay by doxygen 1.3.3