Commit Graph

323 Commits

Author SHA1 Message Date
Matthew Hoops
9539017ee3 ALL: initialise -> initialize 2011-05-25 11:17:11 -04:00
Matthew Hoops
eea482fa43 ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
eriktorbjorn
3e8a7afeae CAMD: Added _isOpen checks to send() and sysEx()
At Raziel^'s request. This is the same as the ALSA checks I added
earlier today.
2011-05-08 13:08:09 +02:00
eriktorbjorn
3b2c3907a0 ALSA: Warn if events or SysEx messages are received when not open.
This should make it easier to spot errors like the one spotted in
the Queen engine yesterday. The Windows MIDI driver already seems
to do something like this; I don't know about the others.
2011-05-08 07:34:46 +02:00
Joost Peters
e28b402295 IRIX: Fix compilation 2011-05-08 01:25:09 +02:00
Max Horn
28403e4543 BACKENDS: Fix copy & paste mistakes in some comments 2011-05-04 16:18:18 +02:00
Hubert Maier
79b45cf535 AMIGAOS: Fix CAMD compiler warning 2011-04-29 14:08:49 +03:00
Alyssa Milburn
d5207ed6ea fix AmigaOS 4 build (thanks to Raziel^) 2011-04-29 11:47:49 +02:00
Max Horn
a0fc266c82 MACOSX: Fix compilation 2011-04-28 15:55:41 +02:00
Paul Gilbert
c6fa23a3d1 JANITORIAL: Add in necessary include files to fix compilation in MSVC 2011-04-28 22:32:12 +10: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
dhewg
d83a83ef50 JANITORIAL: Remove/comment unused vars
Found by GCC 4.6's -Wunused-but-set-variable
2011-03-29 21:57:56 +02: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
Johannes Schickel
ff9653ddea ALSA: Fix formatting. 2011-03-10 04:45:06 +01:00
Johannes Schickel
601a09e417 ALSA: Work around a firmware bug in USB-MIDI cables.
Thanks to waltervn (and wjp) for their investigation on this and Walter's SCI
specific workaround which I more or less just copied here so it will apply for
all engines.
2011-03-10 04:40:30 +01:00
Johannes Schickel
40e9374679 ALSA: Strip trailing spaces in device name.
This might fix odd problems when storing the device name in the config file,
when the name ends with a space by chance.
2011-03-10 02:54:32 +01:00
Max Horn
77fe90d95e MIDI: Really fix bug #3153076 (this time also for Timidity)
svn-id: r55857
2011-02-09 11:03:36 +00:00
Max Horn
ab78737abd MIDI: Fix bug #3153076 (warnings in SEQ driver)
svn-id: r55851
2011-02-09 01:11:58 +00:00
Max Horn
42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00
Filippos Karapetis
cc9f2944ed MIDI: Fixed unnecessary casts of return values to void, reported in bug #3153076
svn-id: r55248
2011-01-15 09:43:02 +00:00
Johannes Schickel
a1d99836cd BACKENDS: Fix SVN keyword usage.
svn-id: r54584
2010-11-29 18:48:43 +00:00
Max Horn
4bed2b3ff5 SDL: Trying to cleanup the FORBIDDEN_SYMBOL situation
svn-id: r54575
2010-11-29 16:35:29 +00:00
Max Horn
df05ed1a46 BACKENDS: Include scummsys.h at top of all .cpp files, *before* any #ifdefs
svn-id: r54573
2010-11-29 16:18:43 +00:00
Max Horn
44393b2dc8 ALL: Add code to help stop people from accidentally using "bad" APIs
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-10-30 21:27:42 +00:00
Johannes Schickel
3b81a9489e SOUND: Allow TiMidity support to be disabled via configure.
svn-id: r53395
2010-10-13 00:48:40 +00:00
Torbjörn Andersson
c91a07229a JANITORIAL: Removed most punctuation at end of warning() and error()
Our warning() and error() functions always add an exclamation mark
to the end of the message anyway.

svn-id: r52791
2010-09-18 10:55:16 +00:00
Torbjörn Andersson
bbd3f0dbb3 ALSA: Be more intelligent when picking MIDI port
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-27 17:18:02 +00:00
Torbjörn Andersson
47f93e9d07 ALSA: Tweak capability and type flags for the MIDI port
This keeps ScummVM's own port from being included in the list of
available MIDI devices.

svn-id: r51378
2010-07-27 16:35:28 +00:00
Johannes Schickel
2db4e71b66 ALSA: Simplify device querying code.
Thanks to eriktorbjorn for some quick testing.

svn-id: r51366
2010-07-27 13:01:10 +00:00
Torbjörn Andersson
5b3f31feec General: Fixed building the SEQ MIDI driver
An #include was missing, causing the driver to never be built. Also fixed what
looked like a cut-and-paste error in generating the features string.

svn-id: r51056
2010-07-20 08:56:53 +00:00
Max Horn
37aa8a7499 BUILD: Unify adding -DUNIX to DEFINES; complete SEQ MIDI detection
* Added a yes/no variable _unix to configure, which controls when
  -DUNIX is added to DEFINES
* Enable SEQ MIDI via _seq_midi by default on UNIX type systems,
  except for those which override that.
* Switch SEQ MIDI code to check #define USE_SEQ_MIDI
  (alternatively, we could compile it only conditionally...)

svn-id: r51055
2010-07-20 08:25:13 +00:00
Max Horn
211fcfe7ba MIDI: Build and use ALSA driver if and only if USE_ALSA is defined
svn-id: r51053
2010-07-20 08:24:34 +00:00
Torbjörn Andersson
abae29a2dc ALSA: Get ALSA port settings from the new device config settings.
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-19 07:47:11 +00:00
Torbjörn Andersson
75dd75a737 SUBSYSTEM: ALSA music driver
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-19 05:30:40 +00:00
Max Horn
0b48a71c99 Remove PalmOS port
svn-id: r50964
2010-07-17 18:41:38 +00:00
Torbjörn Andersson
bc0c306110 If the ALSA driver hasn't been opened, closing it should do nothing. This keeps
ScummVM from crashing if, for instance, someone accidentally closes the driver
twice.

svn-id: r50870
2010-07-14 04:33:35 +00:00
Angus Lees
bb300ec671 Skip /dev/sequencer MIDI on Android.
svn-id: r50664
2010-07-05 00:09:41 +00:00
Johannes Schickel
09b4f7cbed Define WIN32_LEAN_AND_MEAN before including windows.h.
This will cause our code to include less functionality, but might on the other hand fasten up the compilation.

svn-id: r50346
2010-06-26 21:55:52 +00:00
Jordi Vilalta Prat
063cef0c28 GUI: Add and improve some messages to translate
svn-id: r50324
2010-06-26 15:48:03 +00:00
Max Horn
bbad3f333a Patch #1956501: "GUI/LAUNCHER: Midi device selection"
svn-id: r50128
2010-06-21 21:36:36 +00:00
Johannes Schickel
caf31ee5af Replace various strncpy usages by strlcpy.
svn-id: r48955
2010-05-05 17:54:12 +00:00
Max Horn
0e0e11e641 Fix warnings
svn-id: r48277
2010-03-18 15:04:57 +00:00
Arnaud Boutonné
b14396edf2 Replace header by a standard header
svn-id: r47449
2010-01-22 23:56:25 +00:00
Torbjörn Andersson
72eb9ec9ea Fixed a bunch of cppcheck warnings. Mostly about checking if a pointer is null
before freeing it, which isn't necessary.

svn-id: r46941
2010-01-03 19:37:43 +00:00
Max Horn
84f3c98fad Remove the Audio::Mixer parameter from the midi/music plugins
svn-id: r46315
2009-12-09 18:05:20 +00:00
Max Horn
76132409d6 Removed Mac OS X QuickTime MIDI backend. It breaks on OS X 10.6, and it's not as good as the CoreAudio backend anyway
svn-id: r44428
2009-09-27 22:43:32 +00:00
Max Horn
6ec05c48f9 Fix CoreAudio MIDI backend on Mac OS X 10.6
svn-id: r44427
2009-09-27 22:42:51 +00:00
Bertrand Augereau
d454c9b379 Minor constness fixes
svn-id: r43974
2009-09-06 10:51:20 +00:00
Johannes Schickel
1431944294 Add GCC_PRINTF parameter.
svn-id: r42104
2009-07-04 18:54:06 +00:00