Commit Graph

183 Commits

Author SHA1 Message Date
Niels Martin Hansen a0c78c73e3 Fix: Correctly reset playback between songs in win32_m driver 2019-07-04 22:27:34 +02:00
Niels Martin Hansen 27b7c5a5fd Fix: Correctly reset playback between songs in DMusic driver 2019-07-04 22:27:34 +02:00
Niels Martin Hansen a4cf1c8aec Fix: Don't keep mutex locked while parsing MIDI data 2019-07-04 22:27:34 +02:00
Niels Martin Hansen 9839ce006c Fix: Time values should be DWORD everywhere in win32_m 2019-07-04 22:27:34 +02:00
Niels Martin Hansen f8633fc63b Codechange: Fix comment indentation 2019-07-04 22:27:34 +02:00
Niels Martin Hansen 27384486e4 Codechange: Use common source for well-known SysEx messages in Windows music drivers 2019-07-04 22:27:34 +02:00
Niels Martin Hansen 9d8a83bf8d Codechange: Add some const in preparation 2019-07-04 22:27:34 +02:00
Niels Martin Hansen c74df8581d Codechange: Use std::mutex instead of CRITICAL_SECTION in win32_m 2019-07-04 22:27:34 +02:00
glx 9184a62958 Codechange: replace grow() usage for MidiFile 2019-05-04 19:50:53 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz ae748166d0 Codechange: Use platform independent C++11 function for sleeping on a thread. 2019-04-06 11:27:39 +02:00
Michael Lutz 05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
2019-04-06 11:27:39 +02:00
Michael Lutz 05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
2019-04-06 11:27:39 +02:00
Niels Martin Hansen df673e9b2c Fix: Fluidsynth should not try to lock sample data in memory 2019-03-30 22:11:32 +01:00
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 2019-03-28 00:09:33 +01:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
2019-03-24 16:10:04 +01:00
Patric Stout aa350528df Remove: libtimidity support (NOT timidity support)
libtimidity was introduced with the support for PSP. PSP has been
dropped almost a year ago, but this music driver was not. This
corrects that oversight.

timidity (via extmidi) still works fine. This purely removes the
libtimidity support, which was only really available for PSP.
2019-03-05 22:03:00 +01:00
Nikolas Nyby 8a6e03c4d2 Fix #7189: Fluidsynth volume gain too high 2019-02-21 10:08:07 +01:00
Niels Martin Hansen cb60a5e57f Change: Fluidsynth music driver plays through mixer instead of own audio driver 2019-01-05 17:17:10 +01:00
Michael Lutz 05a93c121c Fix: [OSX] Macro redefinition warning. 2018-12-08 20:13:27 +01:00
Charles Pigott 0c619b7c4b Add: Fluidsynth music driver support (jmak) 2018-11-01 18:06:38 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Charles Pigott ca5b68145a Fix #6839: OLD_GM_DIR midi search path got lost (#6900) 2018-09-12 09:19:06 +02:00
Niels Martin Hansen bb086f9240 Fix: Better "temp" path for decoded MPSMIDI files when source filename has no path separators 2018-09-03 21:57:04 +02:00
Niels Martin Hansen 560b01f307 Fix: Check the search paths for standard MIDI files 2018-09-03 21:57:04 +02:00
glx a4eccd8076 Fix: dmusic compilation with MSYS2/MINGW 2018-07-24 21:39:21 +02:00
Charles Pigott 63898f61b0 Codechange: Rearrange struct packing defines and make MinGW use _Pragma pack style 2018-07-19 20:24:17 +02:00
Niels Martin Hansen a1b7812c7e Change: Improved looping of title song 2018-06-15 23:09:17 +02:00
Niels Martin Hansen 11a846e3d5 Change: Compensate for MIDI transmission time when skipping start of song 2018-06-15 23:09:17 +02:00
Niels Martin Hansen 276192f714 Change #6684: Cutting point overrides for music base sets
This improves bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
2018-06-15 23:09:17 +02:00
Niels Martin Hansen a8080f14a9 Change: DOS music loading for non-Windows music drivers 2018-06-05 22:58:35 +02:00
Niels Martin Hansen e2fa4b71c6 Feature: Console command to dump decoded music to .mid file 2018-06-05 22:58:35 +02:00
Niels Martin Hansen 2ae9df7248 Feature: Decoder for DOS version music
This is based on reverse-engineering the TTD DOS driver for General MIDI music.
2018-06-05 22:58:35 +02:00
Niels Martin Hansen f946b3da56 Codechange: Pass a MusicSongInfo struct instead of bare filename to music drivers.
Preparation for later extending the info passed to music drivers.
2018-06-05 22:58:35 +02:00
Michael Lutz ce51e54d26 Change: [Win32] Parse and load DLS files for the DirectMusic driver without relying on high-level functions. 2018-05-26 22:28:01 +02:00
Michael Lutz 255549250f Change: [Win32] Replace the current high-level Direct Music driver with a low-level driver that directly works with MIDI data.
This allows using different music sources besides standard MIDI files on disk.
2018-05-26 22:28:01 +02:00
Niels Martin Hansen 52655b5849 Change: [Win32 MIDI] Reset pitch bend range controllers on song change
Some songs (at least one in OpenMSX) use the MIDI pitch bend range controllers
but don't reset these at the end. This causes all subsequent songs to sound
wrong.
2018-05-01 22:29:53 +02:00
Niels Martin Hansen 99a39c842c Change: [Win32 MIDI] Send Roland reverb control message like TTD DOS does 2018-05-01 22:29:53 +02:00
Niels Martin Hansen b902e01e10 Change #6685: Replace Win32 music driver with one not depending on MCI
MCI MIDI is poorly supported on newer versions of Windows and can cause large
delays at the beginning of tracks.

The new driver is based on a from-scratch reader for Standard MIDI Files. This
should be re-usable in other music drivers too, and can allow for finer control
of playback in general.

It also provides a better framework for reading MIDI data from other formats
than just SMF.
2018-05-01 22:29:53 +02:00
Patric Stout 85adde7485 Remove: PSP support 2018-04-29 15:32:16 +02:00
Patric Stout 17bd580630
Remove: NO_DEBUG_MESSAGES was only read and setting it broke compilation (#6703)
Given any speed issue cannot be attributed to checking for _debug_NNN_level, removing this is a safe action

This fixes #6652.
2018-04-11 22:07:21 +02:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
peter1138 a9a7abf26c (svn r27834) -Change: Parse extmidi command string for parameters to pass on. 2017-03-29 17:36:46 +00:00
michi_cc 94b3965989 (svn r27675) -Fix [FS#6502]: [OSX] Building with 10.11 or 10.12 SDKs. 2016-10-31 19:29:01 +00:00
michi_cc c83306391e (svn r27673) -Add: [Win32] Thread names for windows debuggers. 2016-10-30 18:22:55 +00:00
michi_cc 35b77450f8 (svn r27380) -Fix: [Win32] Compilation with MSVC2015. 2015-08-10 20:21:29 +00:00
rubidium d2357ec435 (svn r26556) -Codechange: use sources.list to tell a file shouldn't be built for a particular platform 2014-05-03 20:21:01 +00:00
rubidium b476086c39 (svn r26538) -Codechange: remove double accounting of the drivers 2014-04-28 21:06:51 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
rubidium defda16eb6 (svn r26108) -Codechange: some coding style (whitespace) 2013-11-25 14:30:22 +00:00
rubidium 6996b441d9 (svn r26107) -Codechange/cleanup: remove some coding bloat and simplify the driver factory instatiations 2013-11-25 14:26:46 +00:00
michi_cc 23a5c6a8c8 (svn r25269) -Feature [FS#5552]: [Win32] Driver param for the DirectMusic driver to specify the ouput port to use. (Based on patch by gulikoza) 2013-05-20 13:35:41 +00:00
michi_cc a959f0c23e (svn r25268) -Codechange: [Win32] Simplify resource deallocation in case initializing the DirectMusic driver fails. 2013-05-20 13:35:38 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
truebrain e1f04b89c3 (svn r23648) -Revert (r23646): partial revert; nobody has to know about my local changes and attempts 2011-12-21 12:28:02 +00:00
truebrain da8777d4e5 (svn r23646) -Fix [FS#4901]: rescan the Game Scripts when done downloading one. 2011-12-21 12:25:10 +00:00
rubidium 4d5dbf5170 (svn r22410) -Document: some more bits ;) 2011-05-02 16:14:23 +00:00
rubidium 21e4e7ce06 (svn r20427) -Revert (r20105): even though MCI has less problems with wrongly pitched songs than dmusic, it crashed instead. 2010-08-09 18:29:13 +00:00
frosch 4bd32799f1 (svn r20286) -Codechange: Unify end of doxygen comments. 2010-08-01 19:44:49 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
terkhen 88ca183191 (svn r20239) -Doc: Give a common name to all fall throughs (FALL THROUGH). 2010-07-29 14:26:28 +00:00
rubidium b8487afe54 (svn r20192) -Cleanup: bye bye variables.h, bye bye VARDEF... you won't be missed :) 2010-07-19 17:28:27 +00:00
rubidium d4da257ff9 (svn r20105) -Revert (r20102) [FS#3938]: resetting DirectMusic completely, although working, causes a temporary freeze of OpenTTD. As MCI behaves better than DirectMusic that has become the default music driver; small delay between songs beats wrongly pitched/bad sounding songs 2010-07-09 22:25:25 +00:00
michi_cc 58f1470129 (svn r20104) -Fix: [Win32] The win32 MIDI driver might clip the start of a song. 2010-07-09 20:50:28 +00:00
rubidium 24fe1f41a5 (svn r20102) -Fix: OpenMSX music sounds odd after certain songs are played. Likely because the instruments weren't reset properly 2010-07-09 17:47:52 +00:00
michi_cc b3a707ae4b (svn r20024) -Codechange: Remove the need to link with dxguid.lib for windows. 2010-06-27 00:19:28 +00:00
glx 895e3c312a (svn r19822) -Fix (r19814): missing semicolon 2010-05-14 20:29:26 +00:00
rubidium 062dd0e24c (svn r19814) -Codechange: give some more unnamed enums a name, in case they consisted of unrelated values use static const (u)int 2010-05-13 10:14:29 +00:00
rubidium 9c6512ef9e (svn r19168) -Fix: under some circumstances timidity (via extmidi) would not shut down properly causing all kinds of trouble (e.g. blocked audio output). Try harder to shut down timidity and first shut down the music so shut down order is the inverse of initialisation order. Based on a patch by Jindřich Makovička. 2010-02-20 17:30:22 +00:00
rubidium 1217bb9411 (svn r19097) -Fix [FS#3610] (r10444): compilation error in the BeMidi driver (jrepan) 2010-02-11 17:13:57 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium b0f1fcbead (svn r18520) -Fix [FS#3272]: allegro doesn't like to work with extmidi; it causes 'random' (looks like a racing condition in allegro) crashes when songs are stopped. 2009-12-16 23:49:21 +00:00
smatz d63e729cf1 (svn r17875) -Change [FS#3272]: prefer extmidi over allegro midi and allegro over null driver 2009-10-25 21:47:32 +00:00
rubidium d0d4cd7b8a (svn r17788) -Fix [FS#3268] (r16702): don't fail hard when no soundcard could be detected; just fall back on the null-driver 2009-10-17 15:15:00 +00:00
rubidium c37029d5e1 (svn r17787) -Codechange: be a bit more verbose about while allegro failed with some actions. 2009-10-17 14:39:43 +00:00
michi_cc dffd1be12d (svn r17710) -Feature [FS#3223]: [OSX] Add a MIDI driver using Cocoa/CoreAudio. 2009-10-04 21:24:09 +00:00
rubidium e8ddf001c8 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos 2009-09-19 09:51:14 +00:00
rubidium bc5241600a (svn r17428) -Codechange: add a function to get the name of a driver 2009-09-05 21:26:51 +00:00
rubidium bc8e66c202 (svn r17336) -Codechange: move some os specific files into src/os/ 2009-08-31 22:38:37 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium e3c7a77b40 (svn r16827) -Codechange: make OSX specific files include stdafx.h always as the first file. Also unify OSX specific stuff into osx_stdafx.h and remove unused includes. 2009-07-14 16:43:45 +00:00
rubidium c29afac0a7 (svn r16700) -Fix: if allegro fails to start or fails open a window or sound card fall back to another driver 2009-06-30 12:38:18 +00:00
alberth 2a2a9a27ba (svn r16464) -Codechange (r16422): Added a missing const_cast<> 2009-05-30 11:24:06 +00:00
rubidium 5f4eeee5f0 (svn r16221) -Change: support building 64 bits OSX binaries and add optional support for 64 bits binaries in OSX universal binaries. However, do not default to adding 64 bits binaries because benchmarking has shown that they are slower than the 32 bits binaries. 2009-05-03 15:46:36 +00:00
rubidium bee930f9b3 (svn r16024) -Codechange: harden string copying on places where it's possible 2009-04-10 20:37:05 +00:00
peter1138 6bf1a49475 (svn r16012) -Codechange: Code style clean up. 2009-04-10 11:03:48 +00:00
rubidium a4139d5693 (svn r15886) -Fix [FS#2770]: libtimidity cannot handle frees of NULL (in contrast of most other frees) 2009-03-29 10:52:54 +00:00
smatz 8585aa71ed (svn r15726) -Codechange: unify coding style for const pointers 2009-03-15 16:04:39 +00:00
rubidium b25a4f8231 (svn r15718) -Cleanup: apply some comment coding style on the rest of the sources too 2009-03-15 00:32:18 +00:00
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 2009-01-31 20:16:06 +00:00
rubidium 11da45ee55 (svn r14949) -Cleanup: pointer coding style 2009-01-10 00:31:47 +00:00
peter1138 020dbb180a (svn r14909) -Codechange: Remove global option for the extmidi driver and make it a driver parameter with the name cmd instead. This means if you have an "extmidi = ..." line in your config you must change it to "musicdriver = extmidi:cmd=...", in the [misc] section. 2009-01-08 12:05:14 +00:00
peter1138 6b6fd36050 (svn r14907) -Codechange: Remove 32 character limit from driver/blitter selection and parameters. 2009-01-08 11:06:07 +00:00
rubidium 34ddda1009 (svn r14632) -Add: support Allegro as midi backend. 2008-11-25 23:21:58 +00:00