22 #ifndef GROOVIE_MUSIC_H 23 #define GROOVIE_MUSIC_H 25 #include "common/array.h" 26 #include "common/mutex.h" 27 #include "common/file.h" 28 #include "audio/mididrv.h" 29 #include "audio/mididrv_ms.h" 30 #include "audio/mixer.h" 31 #include "audio/miles.h" 45 void playSong(uint32 fileref);
49 void setBackgroundSong(uint32 fileref);
50 void playCD(uint8 track);
51 void startBackground();
52 bool isPlaying() {
return _isPlaying; }
56 virtual void pause(
bool pause) { }
59 void setMidiInit(
bool midiInit) { _midiInit = midiInit; }
61 bool isMidiInit() {
return _midiInit; }
64 void setBackgroundDelay(uint16 delay);
67 virtual void setUserVolume(uint16 volume);
68 void setGameVolume(uint16 volume, uint16 time);
72 bool play(uint32 fileref,
bool loop);
74 uint32 _backgroundFileRef;
77 uint16 _backgroundDelay;
80 void playCreditsIOS();
81 void stopCreditsIOS();
85 uint32 _fadingStartTime;
86 uint16 _fadingStartVolume;
87 uint16 _fadingEndVolume;
88 uint16 _fadingDuration;
98 static void onTimer(
void *data);
99 virtual void onTimerInternal() {}
108 virtual void updateVolume() = 0;
109 virtual bool load(uint32 fileref,
bool loop) = 0;
110 virtual void unload(
bool updateState =
true);
119 void send(uint32 b)
override;
120 void sysEx(
const byte* msg, uint16 length)
override;
121 uint16 sysExNoDelay(
const byte *msg, uint16 length)
override;
122 void metaEvent(byte type, byte *data, uint16 length)
override;
124 void pause(
bool pause)
override;
128 byte _chanVolumes[0x10];
129 void updateChanVolume(byte channel);
136 void onTimerInternal()
override;
137 void updateVolume()
override;
138 void unload(
bool updateState =
true)
override;
150 void send(int8 source, uint32 b)
override;
151 using MusicPlayerMidi::metaEvent;
152 void metaEvent(int8 source, byte type, byte *data, uint16 length)
override;
153 void stopAllNotes(
bool stopSustainedNotes)
override;
155 if (_milesXmidiTimbres)
156 _milesXmidiTimbres->processXMIDITimbreChunk(timbreListPtr, timbreListSize);
158 bool isReady(int8 source = -1)
override;
160 void setUserVolume(uint16 volume)
override;
163 void updateVolume()
override;
164 bool load(uint32 fileref,
bool loop)
override;
165 void unload(
bool updateState =
true)
override;
172 MidiDriver_Miles_Xmidi_Timbres *_milesXmidiTimbres;
180 bool load(uint32 fileref,
bool loop)
override;
191 bool load(uint32 fileref,
bool loop)
override;
200 void updateVolume()
override;
201 bool load(uint32 fileref,
bool loop)
override;
202 void unload(
bool updateState =
true)
override;
215 void updateVolume()
override;
216 bool load(uint32 fileref,
bool loop)
override;
217 void unload(
bool updateState =
true)
override;
234 #endif // GROOVIE_MUSIC_H
void processXMIDITimbreChunk(const byte *timbreListPtr, uint32 timbreListSize) override
Definition: music.h:154
Definition: groovie.h:118
Definition: mididrv_ms.h:86
Definition: mididrv.h:309
void send(uint32 b) override
Definition: mididrv.h:112
Definition: midiparser.h:289