aboutsummaryrefslogtreecommitdiff
path: root/sky/music
diff options
context:
space:
mode:
authorMax Horn2005-01-28 22:05:51 +0000
committerMax Horn2005-01-28 22:05:51 +0000
commitabd12dd1b63d9e680bdc157fd5aa1fdb579e111e (patch)
treeda026a16edefcc56119ef2376eb0b26f7ec9d500 /sky/music
parentc62d82450b7fc4d64bf6102cb8074457e3d0cb47 (diff)
downloadscummvm-rg350-abd12dd1b63d9e680bdc157fd5aa1fdb579e111e.tar.gz
scummvm-rg350-abd12dd1b63d9e680bdc157fd5aa1fdb579e111e.tar.bz2
scummvm-rg350-abd12dd1b63d9e680bdc157fd5aa1fdb579e111e.zip
Use class Mutex instead of MutexRef
svn-id: r16679
Diffstat (limited to 'sky/music')
-rw-r--r--sky/music/adlibmusic.cpp4
-rw-r--r--sky/music/adlibmusic.h2
-rw-r--r--sky/music/gmmusic.cpp4
-rw-r--r--sky/music/gmmusic.h2
-rw-r--r--sky/music/mt32music.cpp4
-rw-r--r--sky/music/mt32music.h2
-rw-r--r--sky/music/musicbase.cpp13
-rw-r--r--sky/music/musicbase.h7
8 files changed, 16 insertions, 22 deletions
diff --git a/sky/music/adlibmusic.cpp b/sky/music/adlibmusic.cpp
index 0fb112efbe..6db9b83359 100644
--- a/sky/music/adlibmusic.cpp
+++ b/sky/music/adlibmusic.cpp
@@ -26,8 +26,8 @@
namespace Sky {
-AdlibMusic::AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system)
- : MusicBase(pDisk, system) {
+AdlibMusic::AdlibMusic(SoundMixer *pMixer, Disk *pDisk)
+ : MusicBase(pDisk) {
_driverFileBase = 60202;
_mixer = pMixer;
diff --git a/sky/music/adlibmusic.h b/sky/music/adlibmusic.h
index 86ab9a899c..b4be9b8cde 100644
--- a/sky/music/adlibmusic.h
+++ b/sky/music/adlibmusic.h
@@ -32,7 +32,7 @@ namespace Sky {
class AdlibMusic : public AudioStream, public MusicBase {
public:
- AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system);
+ AdlibMusic(SoundMixer *pMixer, Disk *pDisk);
~AdlibMusic(void);
virtual void setVolume(uint8 volume);
diff --git a/sky/music/gmmusic.cpp b/sky/music/gmmusic.cpp
index ba68ec2259..49f2796006 100644
--- a/sky/music/gmmusic.cpp
+++ b/sky/music/gmmusic.cpp
@@ -32,8 +32,8 @@ void GmMusic::passTimerFunc(void *param) {
((GmMusic*)param)->timerCall();
}
-GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system)
- : MusicBase(pDisk, system) {
+GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk)
+ : MusicBase(pDisk) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
diff --git a/sky/music/gmmusic.h b/sky/music/gmmusic.h
index b75c0f69a3..90e9ec68db 100644
--- a/sky/music/gmmusic.h
+++ b/sky/music/gmmusic.h
@@ -30,7 +30,7 @@ namespace Sky {
class GmMusic : public MusicBase {
public:
- GmMusic(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system);
+ GmMusic(MidiDriver *pMidiDrv, Disk *pDisk);
~GmMusic(void);
virtual void setVolume(uint8 volume);
private:
diff --git a/sky/music/mt32music.cpp b/sky/music/mt32music.cpp
index 6f941499d1..0b176fe44c 100644
--- a/sky/music/mt32music.cpp
+++ b/sky/music/mt32music.cpp
@@ -32,8 +32,8 @@ void MT32Music::passTimerFunc(void *param) {
((MT32Music*)param)->timerCall();
}
-MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system)
- : MusicBase(pDisk, system) {
+MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk)
+ : MusicBase(pDisk) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
diff --git a/sky/music/mt32music.h b/sky/music/mt32music.h
index fb2e131554..bf56f161da 100644
--- a/sky/music/mt32music.h
+++ b/sky/music/mt32music.h
@@ -30,7 +30,7 @@ namespace Sky {
class MT32Music : public MusicBase {
public:
- MT32Music(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system);
+ MT32Music(MidiDriver *pMidiDrv, Disk *pDisk);
~MT32Music(void);
private:
static void passTimerFunc(void *param);
diff --git a/sky/music/musicbase.cpp b/sky/music/musicbase.cpp
index 104b132103..29c2b73c19 100644
--- a/sky/music/musicbase.cpp
+++ b/sky/music/musicbase.cpp
@@ -22,20 +22,17 @@
#include "sky/music/musicbase.h"
#include "sky/disk.h"
#include "common/util.h"
-#include "common/system.h"
namespace Sky {
-MusicBase::MusicBase(Disk *pDisk, OSystem *system) {
+MusicBase::MusicBase(Disk *pDisk) {
_musicData = NULL;
_allowedCommands = 0;
_skyDisk = pDisk;
_currentMusic = 0;
_musicVolume = 127;
- _system = system;
_numberOfChannels = _currentMusic = 0;
- _mutex = _system->createMutex();
}
MusicBase::~MusicBase(void) {
@@ -46,7 +43,7 @@ MusicBase::~MusicBase(void) {
void MusicBase::loadSection(uint8 pSection) {
- _system->lockMutex(_mutex);
+ _mutex.lock();
if (_currentMusic)
stopMusic();
if (_musicData)
@@ -63,7 +60,7 @@ void MusicBase::loadSection(uint8 pSection) {
_numberOfChannels = _currentMusic = 0;
setupPointers();
startDriver();
- _system->unlockMutex(_mutex);
+ _mutex.unlock();
}
bool MusicBase::musicIsPlaying(void) {
@@ -166,7 +163,7 @@ void MusicBase::loadNewMusic(void) {
void MusicBase::pollMusic(void) {
- _system->lockMutex(_mutex);
+ _mutex.lock();
uint8 newTempo;
if (_onNextPoll.doReInit) startDriver();
if (_onNextPoll.doStopMusic) stopMusic();
@@ -182,7 +179,7 @@ void MusicBase::pollMusic(void) {
updateTempo();
}
}
- _system->unlockMutex(_mutex);
+ _mutex.unlock();
_aktTime &= 0xFFFF;
}
diff --git a/sky/music/musicbase.h b/sky/music/musicbase.h
index f3e88dc1f2..f44c828d83 100644
--- a/sky/music/musicbase.h
+++ b/sky/music/musicbase.h
@@ -26,8 +26,6 @@
#include "common/scummsys.h"
#include "common/mutex.h"
-class OSystem;
-
namespace Sky {
class Disk;
@@ -50,7 +48,7 @@ private:
class MusicBase {
public:
- MusicBase(Disk *pDisk, OSystem *system);
+ MusicBase(Disk *pDisk);
virtual ~MusicBase(void);
void loadSection(uint8 pSection);
void musicCommand(uint16 command);
@@ -62,7 +60,6 @@ public:
protected:
- OSystem *_system;
Disk *_skyDisk;
uint8 *_musicData;
uint8 _allowedCommands;
@@ -77,7 +74,7 @@ protected:
uint32 _aktTime;
Actions _onNextPoll;
ChannelBase *_channels[10];
- Common::MutexRef _mutex;
+ Common::Mutex _mutex;
virtual void setupPointers(void) = 0;
virtual void setupChannels(uint8 *channelData) = 0;