Commit Graph

349 Commits

Author SHA1 Message Date
Johannes Schickel
452cec49d9 AUDIO: Make GPL headers consistent in themselves. 2014-02-18 02:39:32 +01:00
Alyssa Milburn
f92df4c6aa Revert "AUDIO: Simplify MidiTracker::processEvent return value"
MI2 deletes the parser object(!) so we can't access any member
variables here. Thanks to athrxx for finding this.

This reverts commit 86c2fe47e0 and adds
a comment explaining why.
2014-01-27 00:20:50 +01:00
Alyssa Milburn
83ce4cfb5e Revert "AUDIO: fix invalid mem access in midiparser.cpp"
This broke SCI, since it doesn't call processEvent any more.

This reverts commit afa54072a9.
2014-01-27 00:08:57 +01:00
athrxx
afa54072a9 AUDIO: fix invalid mem access in midiparser.cpp
(this caused a crash in MI2)
2014-01-26 22:51:39 +01:00
Johannes Schickel
417064e311 Merge pull request #417 from digitall/STACK_fixes
ALL: Fix optimization unstable code on checking for null after new.
2014-01-17 17:48:16 -08:00
Johannes Schickel
e00ae0918a AUDIO: Cleanup MT-32 code a bit.
This removes overwrites in ReportHandlerScummVM which are simply the default
implementation anyway. A side effect is that this silences/fixes a warning
about the former onProgramChanged to hide an virtual method due to parameter
differences.
2014-01-16 22:46:21 +01:00
Johannes Schickel
1eb10b1a46 AUDIO: Register EAS sound driver as plain sound type.
MIDI code will control volume via MIDI events thus the generated audio should
not be affected by mixer sound volumes.

The initial commit 0e6cdfd675 added it as music
sound type. Might be copied from the (also) incorrect FluidSynth code.
2014-01-16 22:21:39 +01:00
Johannes Schickel
d99f23fb10 AUDIO: Register FluidSynth driver as plain sound type.
MIDI code will control volume via MIDI events thus the generated audio should
not be affected by mixer sound volumes.

The initial commit(s) in d4d045b117 /
13dc149ded added it as music sound type.
So, this seems to be a long standing issue.
2014-01-16 22:20:23 +01:00
Johannes Schickel
5ea87462e4 AUDIO: Register MT-32 emulator as plain sound type.
Formerly the audio stream was registered as sfx. This is incorrect behavior
since the client code will control music volume with MIDI events on its own.
It seems 67b311713d introduced this very long
ago.

This should fix unintended coupling of sfx volume and music volume in BASS.
2014-01-16 22:18:47 +01:00
D G Turner
ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
Johannes Schickel
b22aeafcc8 AUDIO: Do not add extrapath to SearchMan in MT-32 emu code.
At the point where the emulator is created extrapath should already been
added to extrapath. If not, the check in checkDevice already failed and thus
adding it would be too late anyway.

It seems this was added in 805b21181a. The
comment about it being a HACK has been removed in bbad3f333a
but it's not clear to my why... At any rate, this should not be here.
2013-11-03 19:36:04 +01:00
Filippos Karapetis
eb84b9fc02 MT-32: Update to munt 1.3.0 2013-09-24 11:30:46 +03:00
Willem Jan Palenstijn
3792af8e95 AUDIO: Simplify SCI inFastForward flag by moving it to MidiParser 2013-09-21 09:31:08 +02:00
Willem Jan Palenstijn
86c2fe47e0 AUDIO: Simplify MidiTracker::processEvent return value 2013-09-21 01:08:26 +02:00
Willem Jan Palenstijn
da81c59308 AUDIO: Let jumpToTick use processEvent too 2013-09-21 00:22:58 +02:00
Willem Jan Palenstijn
6c5a5cd8e9 AUDIO: Split event processing from MidiParser::onTimer
This is to prepare for overriding more of this functionality in SCI.
2013-09-21 00:22:56 +02:00
Filippos Karapetis
00992c1e68 MT-32: Sync with the latest changes in munt 2013-08-21 03:41:30 +03:00
Eugene Sandulenko
2c812ade01 Merge pull request #353 from clone2727/eventrec_timer_fix
ALL: Don't use EventRecorder at all when not compiled in
2013-07-18 08:15:28 -07:00
Sven Hesse
989ea7cb56 JANITORIAL: Remove trailing whitespace 2013-07-14 19:01:47 +02:00
Matthew Hoops
4a7e4e5b22 ALL: Don't use EventRecorder at all when not compiled in 2013-07-06 23:54:45 -04:00
D G Turner
9fb96a9256 AUDIO: Further fix to ReportHandlerScummVM::printDebug in MT32 code. 2013-07-06 04:05:22 +01:00
Johannes Schickel
d7ff665737 AUDIO: Fix ReportHandlerScummVM::printDebug in MT32 code.
Formerly it tried to pass 'va_list' as '...' to debug. Now it's first creating
a String containing the output via String::vformat and then passing it
to debug.

Found by buildbot (master-dc). The warning message was:
audio/softsynth/mt32.cpp:65: warning: cannot pass objects of non-POD type
`struct va_list' through `...'; call will abort at runtime
2013-07-04 14:44:41 +02:00
Eugene Sandulenko
49210a803a Merge pull request #331 from sev-/gsoc2012-eventsrecorder
GSoC2012: Event Recorder (reworked)
2013-07-04 04:58:54 -07:00
Filippos Karapetis
5f3ddae421 MT-32: Sync with the latest changes in munt
This syncs our code with munt commits 258cd89 and 17b40a6
2013-07-02 03:53:09 +03:00
Johannes Schickel
a1cfe235e4 AUDIO: Reduce callback frequency of the MT-32 emulator.
Formerly the frequency was at 10000Hz. This resulted in 3,4 or even only 1
sample to be generated between callbacks on my system. All the other MIDI
drivers use a much lower frequency here. The MidiDriver_Emulated subclasses
use a frequency of 250Hz (by default) and the MidiDriver_MPU401 subclasses
(which are for example the ALSA output) use 100Hz. With the new frequency
of 250Hz 128 samples are generated between callbacks. This will hopefully
reduce the overhead of the MT-32 emulator (the engine's code was run 10000
times a second too) a bit.

I talked with KingGuppy and it seems the value was increased in the past
(still with the very old MT-32 emulator code) because there were accuracy
issues. However, I gave the lower frequency a quick test with the MI1, MI2
and ITE intro and didn't spot any obvious differences. As a result, KingGuppy
and I agreed to lower it back to 250Hz. If there are any problems coming up
we can still slightly increase the frequency to 1000Hz for example.

Thanks to waltervn for noticing this. Thanks to KingGuppy for discussion.
2013-05-17 00:40:34 +02:00
Eugene Sandulenko
f59512c47e RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00
Torbjörn Andersson
6bcc4136a8 XMIDI: Forget old loop points when changing track
This fixes warnings that would appear after a little while in
Kyrandia 2, which would happen because every time the music
changed it would add a new loop point. This was probably harmless
because once the list was full it would keep re-using the last
element, and I imagine all songs were set to loop forever. But
this should be more correct, as I understand it.
2013-05-04 21:57:00 +02:00
Eugene Sandulenko
5cc5104692 AUDIO: Fix uninitalized variable. CID 1003160 2013-05-02 14:10:40 +03:00
Eugene Sandulenko
0a329688d3 AUDIO: Fix unitialized variable. CID 1003161 2013-05-02 14:07:44 +03:00
Eugene Sandulenko
7c26b6ee0a AUDIO: Fix unitialized variable. CID 1003162 2013-05-02 14:01:13 +03:00
Filippos Karapetis
635847b979 MT32: Fix some non-initialized fields in MidiDriver_MT32 - CID 1002949 2013-05-01 15:46:23 +03:00
Filippos Karapetis
6c3e05e678 AUDIO: Add missing breaks to switch statement - CID 1003770
A mistake in commit 3dc788da63
2013-05-01 15:46:23 +03:00
Eugene Sandulenko
3263a5eda6 AUDIO: Fix identation. CID 1003641 2013-04-28 23:59:20 +03:00
Sven Hesse
2c5a0008ba AUDIO: Do not error out when channel offset >= length after interrupt()
This fixes a Protracker module in the OS/2 version of
Hopkins FBI (bug #3612101). In row 0x30 of the first
pattern, the set channel offset effect in the fourth track
pushes the offset past the sample (repeat) length.
This is not error; the mixing function already handles this
case flawlessly. No assert() is necessary there.
2013-04-28 17:31:53 +02:00
Willem Jan Palenstijn
3a1de9a182 AUDIO: Handle empty parent stream in LoopingAudioStream
This should fix bug #3571139.
2013-04-21 13:52:40 +02:00
Matthew Hoops
72101c66fa AUDIO: Cleanup naming 2013-04-20 15:18:09 -04:00
Matthew Hoops
c38beb0ced AUDIO: Remove default makeADPCMStream rate/channels values 2013-04-20 14:54:41 -04:00
Max Horn
8b602816f4 AUDIO: Remove unused MixerImpl::_syst member var 2013-04-18 23:50:20 +02:00
Matthew Hoops
54d4707edc AUDIO: Fix invalid free call 2013-04-16 12:05:42 -04:00
Filippos Karapetis
3f01f34b1f MT-32: Sync with the latest changes in munt
This syncs our code with munt commit 15e9f65
2013-03-27 23:01:47 +02:00
Filippos Karapetis
8a62471b21 MT-32: Sync with the latest changes in munt 2013-03-03 23:01:12 +02:00
Filippos Karapetis
7880323590 MT-32: Also replace cosf() (C99) with cos() 2013-03-03 22:59:33 +02:00
Filippos Karapetis
bb7930cf9c MT-32: Avoid using sinf() (which is C99) in favor of sin() 2013-03-03 16:10:02 +02:00
Filippos Karapetis
f4cc45d367 MT32: Sync with the latest changes in munt
The major change is the addition of a refined wave generator based on
logarithmic fixed-point computations and LUTs
2013-03-02 14:09:39 +02:00
Filippos Karapetis
8884c240fc MT32: Update copyright year 2013-03-02 13:46:11 +02:00
Dreammaster
bb3285d933 Merge branch 'master' into hopkins 2013-02-15 08:25:09 -05:00
Filippos Karapetis
059f5ee138 MT32: Also attempt to load roms named CM32L_CONTROL.ROM / CM32L_PCM.ROM
This was accidentally removed in commit 5711d23
2013-02-04 23:13:53 +02:00
Filippos Karapetis
e2a8c8ea86 MT32: Sync with the latest changes in munt
This syncs our code with munt commit ee380de
2013-02-04 23:13:53 +02:00
Torbjörn Andersson
a50c05f7d0 HOPKINS: Work around broken cadavre.mod in OS/2 and BeOS versions
A large part of cadavre.mod is broken. No new notes play, and only
the old background sounds remain. It's possible, perhaps even
probable, that the original MOD player didn't have this problem,
but all standalone players I've tried do, so I'm assuming it's the
file that's broken. We work around it by changing the length of
the song after it's been loaded to only include the good parts.
2013-01-27 18:18:04 +01:00
Johannes Schickel
354aa0f5f3 JANITORIAL: Use "End of anonymous namespace" as comment for anonymous namespaces. 2013-01-26 19:38:02 +01:00