AUDIO: Document issues with semantics of Audio::MidiPlayer::isPlaying()

This commit is contained in:
Max Horn 2011-03-25 17:01:36 +01:00
parent 9e65daef3b
commit 6cc0aca5b2
2 changed files with 19 additions and 1 deletions

View File

@ -174,8 +174,8 @@ void MidiPlayer::stop() {
void MidiPlayer::pause() {
// debugC(2, kDraciSoundDebugLevel, "Pausing track %d", _track);
setVolume(-1); // FIXME: This should be 0, shouldn't it?
_isPlaying = false;
setVolume(-1); // FIXME: This should be 0, shouldn't it?
}
void MidiPlayer::resume() {

View File

@ -69,6 +69,24 @@ public:
virtual void pause();
virtual void resume();
/**
* Return whether there is currently any MIDI music playing.
*
* @todo There is a subtle difference between the semantics of this in
* various subclasses, related to paused music: Namely, should this
* function return true or false if a MIDI song is currently loaded,
* but paused? In the base implementation of pause/resume, "false"
* will be returned (that is, it is not possible to distinguish between
* nothing being played, and an active but paused MIDI tune).
* But in several subclasses (e.g. in HUGO), there is a separate _paused
* variable, which is used to pause playback, and for these, "true"
* will be returned.
* And in SAGA, isPlaying is overwritten to return the value
* of _parser->isPlaying() (which should amount to "true" in the
* described situation).
* We really should unify this and clearly define the desired
* semantics of this method.
*/
bool isPlaying() const { return _isPlaying; }
/**