Commit Graph

24 Commits

Author SHA1 Message Date
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Max Horn
8c931fd1e8 AUDIO: Add Audio::MidiPlayer::createDriver(), let some engines use it 2011-03-28 18:06:36 +02:00
Max Horn
7949d7c6de AUDIO: Move more common code to Audio::MidiPlayer
This also should fix some regressions from the previous
commits, related to MidiParser's either being leaked,
or being deleted and then used again (i.e., crashing).

I tested as many games as I had available, but further
testing of all affected engines is called for anyway.
2011-03-25 14:15:53 +01:00
Max Horn
4780eb7393 DRACI: Change MusicPlayer to derive from Audio::MidiPlayer 2011-03-24 16:46:46 +01:00
Max Horn
2d4dff8cb4 DRACI: Fix incorrect 'all notes off' handling 2011-03-24 16:46:46 +01:00
Max Horn
088bd7a70b ENGINES: Remove unused MIDI pass-through code 2011-03-23 17:07:48 +01:00
Max Horn
e70fd59b35 ENGINES: Further simplify pseudo MidiDrivers; fix some regressions
The regression affected AGOS and maybe some others; specifically,
the real MidiDriver would have been deleted twice -- I previously
missed that the Engine instances takes care of freeing the real
MidiDriver, not the MidiPlayer wrapping it.

This commit should clarify the ownership of the real MidiDriver for
most pseudo MidiDrivers.
2011-03-23 16:49:41 +01:00
Max Horn
29847ea42d AUDIO: Change several fake MidiDrivers to MidiDriver_BASE subclasses
Many engines follow the advice in audio/midiparser.h and create a
"pseudo-MidiDriver" subclass. But MidiParser really only needs a tiny
subset of the MidiDriver capabilities, namely those found in
MidiDriver_BASE. So we try to subclass from that whenever possible; this
allows us to remove many stub methods, and enables further future
simplifications.
2011-03-23 15:25:47 +01:00
Max Horn
8982fff1b7 AUDIO: Add pure virtual MidiDriver::isOpen() method
This in turn enables modifying MidiDriver_MPU401::close() to allow
it to be called on a midi driver that has not yet been opened.

The specific issue that triggered me to make these changes was a
crash-upon-quit in HUGO, caused by it instantiating a midi driver,
then encountering an error (missing hugo.dat) *before* having
opened the new midi driver; the general cleanup code then tries
to close the (not yet opened) midi driver -> kaboom

Also fixed some engines which were leaking MidiDriver instances.
2011-03-22 23:51:47 +01:00
Max Horn
42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00
Johannes Schickel
b2c57117fd DRACI: Initialize MIDI channel volume properly.
This fixes bug #3067148 "DRACI: Volume range not respected". It seems Draci's
MIDI files do not setup the channel volume properly before using the channels,
but rely on having the maxed out. Since formerly the channel volume was
initialized to 255, it caused the channel volume to be zero in case the user
used 128 for his volume settings (128*255/255=128, and MIDI volume goes from
0-127).

svn-id: r52738
2010-09-15 22:30:00 +00:00
Johannes Schickel
6588398ce6 MIDI: Send a reset MIDI device signal on startup.
This is currently done in the engine code. I adapted AGI, AGOS, DRACI,
GROOVIE, LURE, MADE, QUEEN, SAGA, SKY, TINSEL and TOUCHE to send a reset
device on startup. The sound output still works fine (started up a game
from every engine), so this should hopefully not introduce any regressions.

As far as I can tell it seems that SCUMM does send a proper device reset, so
I did not touch it. KYRA only sends a proper reset for MT-32 currently. I am
not sure about SCI though.

This fixes bug #3066826 "SIMON: MIDI notes off when using RTL after SCI".

svn-id: r52736
2010-09-15 22:00:20 +00:00
Jordi Vilalta Prat
05f942917e DRACI: Don't try to set the volume for channels that couldn't be allocated (fixes bug #2907954: "DRAGON: Crash in Intro")
svn-id: r48147
2010-02-27 15:54:31 +00:00
Johannes Schickel
0d995c5920 Rename all "Adlib" uses to "AdLib" to match the real name of the sound card / company.
Check this for reference:
http://en.wikipedia.org/wiki/Ad_Lib,_Inc.
http://www.crossfire-designs.de/images/articles/soundcards/adlib.jpg (note the upper left of the card)

This commit does not touch "adlib" and "ADLIB" uses!

Also it does not update all the SCUMM detection entries, which still use "Adlib".

svn-id: r47279
2010-01-12 21:07:56 +00:00
Robert Špalek
24ccc94f79 Implemented "Mute All"
svn-id: r45873
2009-11-12 22:52:00 +00:00
Robert Špalek
8edfd6b56c Updated the list of TODOs
svn-id: r45768
2009-11-08 22:48:27 +00:00
Robert Špalek
839a7d5db6 Fixed svn:keywords
svn-id: r45523
2009-10-30 05:21:44 +00:00
Robert Špalek
46cb0be173 fix free/delete
svn-id: r45422
2009-10-26 22:04:03 +00:00
Robert Špalek
7bec12bbec Fix 2 MIDI bugs
svn-id: r45392
2009-10-26 09:03:54 +00:00
Robert Špalek
819449d099 Implemented GPL2 commands for music.
Debugged everything.

svn-id: r45330
2009-10-22 07:34:43 +00:00
Robert Špalek
8f75ee9a37 Fix uninitialized channel volumes.
This fixed stopped music after calling the configuration dialog.

svn-id: r45327
2009-10-22 06:41:11 +00:00
Robert Špalek
3903be61e7 Improved music handling:
- reading the volume from the configuration
- error handling of non-existent MIDI files
- pausing/resuming music

unfortunately, sometimes music stops playing or slows down, and my log
messages have so far not helped me to identify why

svn-id: r45326
2009-10-22 06:21:39 +00:00
Robert Špalek
8d8b4dc50a Enabled music.
Several TODO's added.

svn-id: r45298
2009-10-21 08:41:57 +00:00