69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
|
//#include "RDriver.h" // Mad Driver functions & globals
|
||
|
#include "fileio.h"
|
||
|
#include "error.h"
|
||
|
#include "config.h"
|
||
|
#include "music.h"
|
||
|
/*
|
||
|
MADDriverRec *gMADDriver;
|
||
|
MADLibrary *gMADLib;
|
||
|
MADMusic *gMADMusic;
|
||
|
*/
|
||
|
int gMusicPlaying=false;
|
||
|
tFileRef gSongRef=-1;
|
||
|
|
||
|
void MyDebugStr(short s, Ptr p1, Ptr p2)
|
||
|
{
|
||
|
FailWithErrorString(p2);
|
||
|
}
|
||
|
|
||
|
void MusicInit()
|
||
|
{
|
||
|
/* MADDriverSettings init;
|
||
|
MADGetBestDriver(&init);
|
||
|
HandleError(MADInitLibrary(nil,init.sysMemory,&gMADLib));
|
||
|
HandleError(MADCreateDriver(&init,gMADLib,&gMADDriver));
|
||
|
MADStartDriver(gMADDriver);
|
||
|
MusicSetVolume();*/
|
||
|
}
|
||
|
|
||
|
void MusicStopSong()
|
||
|
{
|
||
|
/* if(gMusicPlaying)
|
||
|
{
|
||
|
gMusicPlaying=false;
|
||
|
MADStopMusic(gMADDriver); // Stop reading current partition
|
||
|
MADCleanDriver(gMADDriver);
|
||
|
MADDisposeMusic(&gMADMusic,gMADDriver); // Dispose the current music
|
||
|
}*/
|
||
|
}
|
||
|
|
||
|
void MusicPlaySong(tFileRef song)
|
||
|
{
|
||
|
/* gSongRef=song;
|
||
|
if(gConfig->musicVolume!=0)
|
||
|
{
|
||
|
if(gMusicPlaying)
|
||
|
MusicStopSong();
|
||
|
HandleError(MADLoadMusicPtr(&gMADMusic,(char*)FileGetDataPtr(song)));
|
||
|
MADAttachDriverToMusic(gMADDriver,gMADMusic,0L);
|
||
|
MADPlayMusic(gMADDriver);
|
||
|
gMusicPlaying=true;
|
||
|
MusicSetVolume();
|
||
|
}*/
|
||
|
}
|
||
|
|
||
|
void MusicSetVolume()
|
||
|
{
|
||
|
/*gMADDriver->VolGlobal=64*gConfig->musicVolume;
|
||
|
if(gConfig->musicVolume==0)
|
||
|
MusicStopSong();
|
||
|
else if(!gMusicPlaying&&gSongRef!=-1)
|
||
|
MusicPlaySong(gSongRef);*/
|
||
|
}
|
||
|
|
||
|
void MusicExit()
|
||
|
{
|
||
|
/* MADStopDriver(gMADDriver); // Stop driver interrupt function
|
||
|
MADDisposeDriver(gMADDriver); // Dispose music driver
|
||
|
MADDisposeLibrary(gMADLib); // Close music library*/
|
||
|
}
|