aboutsummaryrefslogtreecommitdiff
path: root/backends/midi/alsa.cpp
AgeCommit message (Collapse)Author
2010-10-30ALL: Add code to help stop people from accidentally using "bad" APIsMax Horn
A new header file common/forbidden.h is included by scummsys.h and it re-#defines numerous symbols like fopen(), fread(), system(), etc. with garbage, in order to provoke compile errors in any code using them. If a .cpp file really *must* use any of these (e.g. because it is a backend file), then these redefinitions can be disabled by #defining FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever this is done, an explanatory comment should be added. Note that this system cannot catch all "bad" usages (notably the Lua code in the sword25 engine), as it can only work if scummsys.h is included. svn-id: r53961
2010-07-27ALSA: Be more intelligent when picking MIDI portTorbjörn Andersson
Often, a client has more than one available port. Pick the first one that isn't already in use. For instance, on my computer client 17 is the "Emu10k1 WaveTable", and it has four available ports. If, say, aplaymidi is already playing on port 17:0, ScummVM will use port 17:1 instead. Otherwise the two programs will mess up each others instruments and controller settings. Of course, in reality I doubt that anyone will run two different MIDI playing applications at once. svn-id: r51380
2010-07-27ALSA: Tweak capability and type flags for the MIDI portTorbjörn Andersson
This keeps ScummVM's own port from being included in the list of available MIDI devices. svn-id: r51378
2010-07-27ALSA: Simplify device querying code.Johannes Schickel
Thanks to eriktorbjorn for some quick testing. svn-id: r51366
2010-07-20MIDI: Build and use ALSA driver if and only if USE_ALSA is definedMax Horn
svn-id: r51053
2010-07-19ALSA: Get ALSA port settings from the new device config settings.Torbjörn Andersson
This is also an attempt to make the transition from the old settings to the new ones a little less rough, by trying to put something sensible into the first device, which is what's used by default. Currently it prefers 17:x and 65:x since they're the old defaults, followed by 128:x since that's probably TiMidity. The old SCUMMVM_PORT environment variable still overrides any config settings. I haven't made up my mind whether or not that's a good idea, but at least it prints a warning message. TODO: The old 'alsa_port' setting is not handled. It should probably be used to set sensible defaults for the new settings, but I'm not sure where this should be done. TODO: The documentation will need to be updated, once everything is working the way it should. svn-id: r51019
2010-07-19SUBSYSTEM: ALSA music driverTorbjörn Andersson
We should probably open the sequencer the exact same way, both when opening the driver and when asking it for available MIDI devices. Not that I've been able to figure out the difference between "hw" and "default" from the fine ALSA manual... And I'm not sure we really need to try and keep compatibility with ancient (pre-0.9.0?) ALSA any longer... svn-id: r51014
2010-07-14If the ALSA driver hasn't been opened, closing it should do nothing. This keepsTorbjörn Andersson
ScummVM from crashing if, for instance, someone accidentally closes the driver twice. svn-id: r50870
2010-06-21Patch #1956501: "GUI/LAUNCHER: Midi device selection"Max Horn
svn-id: r50128
2009-12-09Remove the Audio::Mixer parameter from the midi/music pluginsMax Horn
svn-id: r46315
2009-09-06Minor constness fixesBertrand Augereau
svn-id: r43974
2009-05-30Fixed compilation errorFilippos Karapetis
svn-id: r41037
2008-11-30- Extended MidiDriver::sysEx to allow 264 byte sysEx messagesJohannes Schickel
- Updated all drivers to allow 264+2 byte sysEx messages - Implemented sysEx processing for MT-32 for Kyra1 and HoF. MT-32 should now be working properly. svn-id: r35180
2008-11-05Turned enum PluginError into Common::Error, which in the future is to be ↵Max Horn
used in more places. Help with this is highly welcome svn-id: r34906
2008-08-05Committed my patch #2026097 ("ALSA: Try both 65:0 and 17:0 by default"), with aTorbjörn Andersson
slight modification to the README changes. (I don't know how to interpret all the output from aconnect, so I'm only documenting "the most important bit".) svn-id: r33648
2008-06-14Fixed ALSA's invalid port error messageJordi Vilalta Prat
svn-id: r32698
2008-06-13Added initial interface to list music devices and their typesJordi Vilalta Prat
svn-id: r32695
2008-06-13Renamed MIDI plugins to Music pluginsJordi Vilalta Prat
svn-id: r32693
2008-05-14- Added more information (ID and capabilities) to the MIDI driversJordi Vilalta Prat
- Added the MidiPlugin interface to the remaining MIDI drivers - Added an initial MidiManager to handle the MIDI plugins (just static plugins by now) svn-id: r32117
2008-05-14Moved midiplugin.h to sound/ since it will be used for more than just the ↵Jordi Vilalta Prat
native MIDI drivers. svn-id: r32097
2008-05-11Added the MidiPlugin interface (first step towards the MIDI plugins)Jordi Vilalta Prat
svn-id: r31993
2007-09-19Merged common/stdafx.h into common/scummsys.h. All referencing files have ↵Nicola Mettifogo
been updated. svn-id: r28966
2007-05-30Updated legal headers in source files, based on what Pidgin (the IM client ↵Max Horn
formerly knowns as Gaim) does; added new (incomplete) COPYRIGHT file; updated copyright dates in a few spots svn-id: r27024
2007-02-16Unified how we deal with (and how we generate) MIDI sysex messages -- in ↵Max Horn
particular, we now always do so w/o framing the message (documented this with a Doxygen comment in the MidiDriver class) svn-id: r25630
2006-09-20Some updates (mostly guesswork) for the ALSA MIDI driver, mostly prompted byTorbjörn Andersson
Waxworks (Simon engine). See http://www.borg.com/~jglatt/tech/midispec.htm for reference. * Added case for Aftertouch (Key Pressure). * Changed Channel Pressure to flush the event immediatley. The message could apply to notes while they are playing. * Downgraded the error for unknown MIDI messages to a warning, and clarified it slightly. svn-id: r23949
2006-04-04Don't use HAVE_CONFIG_H / config.h directly, use scummsys.h insteadMax Horn
svn-id: r21605
2006-02-27SysEx data now passed around with const pointers. Permits simplification of ↵Jamieson Christian
some SysEx client code. Testing on Windows. Developers on other platforms, please verify integrity of music handling in your respective MidiDrivers. svn-id: r20952
2006-02-27clear ALSA event structure before useWillem Jan Palenstijn
svn-id: r20951
2006-02-11Change CVS keywords to SVN keywordsMax Horn
svn-id: r20535
2006-01-18Update copyright noticeEugene Sandulenko
svn-id: r20088
2005-10-18Update FSF address. Eek. Actually that took place on May 1, 2005Eugene Sandulenko
svn-id: r19142
2005-07-30Remove trailing whitespaces.Eugene Sandulenko
svn-id: r18604
2005-06-24When including files from common/, explicitly use the common/ prefixMax Horn
svn-id: r18444
2005-01-01Updated copyrightMax Horn
svn-id: r16398
2004-07-27Add passthrough ability. Patch by Christian Schoenebeck with slight ↵Jonathan Gray
modifications svn-id: r14354
2004-01-20Handle command 0xD0 (queen uses this) - thanks aholler.Joost Peters
svn-id: r12533
2004-01-06updated copyright noticeMax Horn
svn-id: r12176
2003-12-11add config file parameter to specify the desired port when using the ALSA ↵Jonathan Gray
music driver svn-id: r11583
2003-09-18Extend the ALSA version check to look at SND_LIB_MAJOR as well. They'reTorbjörn Andersson
bound to hit 1.0 any year now. Of course, this is completely untested. svn-id: r10288
2003-09-10moved declaration of error/warning/debug from engine.h to util.hMax Horn
svn-id: r10151
2003-07-06fix compileOliver Kiehl
svn-id: r8814
2003-06-12Applied Jamieson630's race condition fix to the ALSA driver as well.Torbjörn Andersson
svn-id: r8440
2003-06-01actually sending the event helps tooJonathan Gray
svn-id: r8219
2003-06-01give alsa sysex more chance of working, still broken thoughJonathan Gray
svn-id: r8218
2003-06-01hopefully add sysex support to alsa midi backendJonathan Gray
svn-id: r8210
2003-05-18HAVE_CONFIG_HJonathan Gray
svn-id: r7632
2003-03-06updated copyrights headersPaweł Kołodziejski
svn-id: r6726
2003-03-06and more cleanup ....Paweł Kołodziejski
svn-id: r6719
2002-12-30make alsa driver print out the correct portJonathan Gray
svn-id: r6272
2002-12-12fix up alsa after recent midi changesJonathan Gray
svn-id: r5911