[Scummvm-cvs-logs] CVS: scummvm/sound imuse.cpp,1.29,1.30 imuse.h,1.2,1.3
Max Horn
fingolfin at users.sourceforge.net
Mon Apr 29 04:49:05 CEST 2002
Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv4494
Modified Files:
imuse.cpp imuse.h
Log Message:
replaced fragile hack (declaring class IMuse twice in two different places) with a (hopefully) better proxy approach: class IMuse just proxies thru to the real IMuseInternal class
Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/imuse.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** imuse.cpp 27 Apr 2002 15:19:44 -0000 1.29
--- imuse.cpp 29 Apr 2002 11:48:33 -0000 1.30
***************
*** 24,30 ****
#include "fmopl.h"
#include "mididrv.h"
! int num_mix;
!
#define TICKS_PER_BEAT 480
--- 24,32 ----
#include "fmopl.h"
#include "mididrv.h"
[...992 lines suppressed...]
+ int IMuse::clear_queue()
+ {
+ return _imuse->clear_queue();
+ }
+
+ void IMuse::setBase(byte **base)
+ {
+ _imuse->setBase(base);
+ }
+
+ uint32 IMuse::property(int prop, uint32 value)
+ {
+ return _imuse->property(prop, value);
+ }
+
+ IMuse *IMuse::create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) {
+ IMuse *i = new IMuse;
+ i->_imuse = IMuseInternal::create(syst, midi, mixer);
+ return i;
+ }
Index: imuse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/imuse.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** imuse.h 21 Apr 2002 17:46:42 -0000 1.2
--- imuse.h 29 Apr 2002 11:48:33 -0000 1.3
***************
*** 21,42 ****
*/
! //WARNING: These is only the public interface to the IMUSE class
! //This is safe as long as none of the methods are virtual,
! //and as long as no variables are put here.
! //Removing the private parts from the public class definition,
! //means that the internals of IMuse can change without having to
! //recompile all files that depend on this interface.
! //Also, it probably decreases compile times, since the IMuse specific
! //classes only will be parsed once (which is when imuse.cpp is compiled)
!
!
! //If you change stuff here, you *MUST* change stuff in imuse.cpp as well
class IMuse {
public:
- /* making a dummy constructor means that this object will never be
- * instanciated on its own */
-
- public:
enum {
PROP_TEMPO_BASE = 1,
--- 21,28 ----
*/
! class IMuseInternal;
class IMuse {
public:
enum {
PROP_TEMPO_BASE = 1,
***************
*** 44,50 ****
};
! void on_timer();
void pause(bool paused);
- int terminate();
int save_or_load(Serializer *ser, Scumm *scumm);
int set_music_volume(uint vol);
--- 30,38 ----
};
! IMuse();
! ~IMuse();
!
! void on_timer(); // For the MacOS 9 port only
void pause(bool paused);
int save_or_load(Serializer *ser, Scumm *scumm);
int set_music_volume(uint vol);
***************
*** 65,67 ****
--- 53,58 ----
static IMuse *create_adlib(OSystem *syst, SoundMixer *mixer) { return create(syst, NULL, mixer); }
static IMuse *create_midi(OSystem *syst, MidiDriver *midi) { return create(syst, midi, NULL); }
+
+ private:
+ IMuseInternal *_imuse; // Pointer to the real imuse object
};
More information about the Scummvm-git-logs
mailing list