Commit Graph

193 Commits (60dcf3b5e25e58fa09ac41015436dc9f330c3846)

Author SHA1 Message Date
Peter Nelson 9cf47af490
Change: Invalidate music volume when restarting music playback on Windows. (#11836) 5 months ago
Rubidium e3f49ee7a0 Codechange: coding style fixes 6 months ago
Peter Nelson 4c6ccb5248
Change: Try stopping extmidi player with SIGINT first. (#11404)
This may give the player a chance to issue MIDI note-off commands.

The kill/waitpid cycle is also less aggressive, waiting 50ms each time.
7 months ago
Peter Nelson 08778094f4
Fix: extmidi did not move on to next song after playing ends. (#11469)
`song` is no longer a C-style string so cannot be cleared by writing a NUL char.
Use `.clear()` to properly clear a std::string.
8 months ago
Peter Nelson d4008850e3 Codechange: Ensure function opening `{` is on new line. 8 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 8 months ago
Rubidium f16399f4c9 Codechange: replace x.size() > 0 with !x.empty() 8 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 8 months ago
frosch 6b586dddad Cleanup: TransmitNotesOff is only called with buffer==_buffer. 9 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
12 months ago
Rubidium 794b642b9a Codechange: use std::string/std::vector over stredup/strecpy/CallocT/free 1 year ago
PeterN fc2510e2ba
Codechange: Use std::vector for midifile's ByteBuffer. (#11019) 1 year ago
Owen Rudge 1a3d1bca59 Remove: OS/2 port 1 year ago
Rubidium 556b44713e Codechange: use std::string for midi filenames 1 year ago
PeterN d086f288cd
Codechange: Remove duplicated includes. (#10888)
These are now included by stdafx.h so don't need to be included again.
1 year ago
Rubidium 3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 1 year ago
Peter Nelson 83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 1 year ago
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
1 year ago
Rubidium 9fe853f7b5 Codechange: use fmt::format instead of vseprintf for midi command formatting 1 year ago
Rubidium 43c65a3fec Codechange: use std::string for base media filename/warning storage 1 year ago
Niels Martin Hansen 41c40f130b Fix: Original music playback rate was slightly too fast
Found a new tempo value experimentally. The new value gives a timing error of less than 0.01 second per minute.
2 years ago
Charles Pigott 1e529e1632
Fix: [Fluidsynth] Crash when debug output enabled (#9446) 3 years ago
rubidium42 eb6cdadc4d Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
milek7 886f5c104a Fix: Workarounds for BeMidi driver to work properly on Haiku 3 years ago
milek7 36bcd2956a Fix: Building on Haiku 3 years ago
Rubidium 79fc094c54 Cleanup: [Fluidsynth] Remove fluid_player_join
The function fluid_player_join in the library is broken beyond compare for the
usecases it was used for (see their #872). It does not wait until it is safe
to delete the player, so it is up to the end user to ensure that.

For OpenTTD we acquire a lock before fluid_synth_write_s16 and we acquire the
same lock in the stop function. So, only one of the functions can be doing its
thing, meaning we do not need to wait for the player to be stopped as it
cannot be doing anything as we prevent that by the lock.
3 years ago
rubidium42 a432009f06 Cleanup: [Fluidsynth] Comply better with the coding style 3 years ago
rubidium42 6bd7f8816d
Fix #9117, 04ce1f07: [Fluidsynth] Infinite wait when stopping song (#9181)
In FluidSynth 2.2.0 an extra state was added to denote stopping. To transition
from this state to a stopped state the rendering needs to be running. Since
04ce1f07 locking was added that skipped the rendering when something else held
a lock, so the state would never get to stopped and join would never return.
3 years ago
Loïc Guilloux 888389c28d
Codechange: Use std::string in console commands/aliases registration, and std::map instead our sorted linked list (#9057)
* Codechange: Use std::string in console commands and aliases registration

* Codechange: Use std::map to register console commands

* Codechange: Use std::map to register console aliases

* Cleanup: Remove now unused function
3 years ago
Ghislain Antony Vaillant e7cf589868 Fix: Honor default soundfont for FluidSynth
Debian now provides a default soundfont for FluidSynth via its alternatives system.

In short, FluidSynth is configured to look for `/usr/share/sounds/sf3/default-GM.sf3` as its default soundfont, and each soundfront package (FluidR3, OPL-3, MuseScore...) may provide or override this symlink. By default, FluidSynth is installed on Debian with the `TimGM6mb` soundfont by default due to its limited size.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929185 for further details.
3 years ago
Ghislain Antony Vaillant 9725bd8dd0 Fix: Use FluidSynth default soundfont 3 years ago
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 3 years ago
Milek7 33c5f984f5
Codechange: Use COINIT_MULTITHREADED in CoInitializeEx (#8938) 3 years ago
Niels Martin Hansen b427ddce88 Codechange: Switch to explicit wide strings 3 years ago
Niels Martin Hansen beeb9e0a1b Remove: [Win32] Last pretenses of being able to build for Windows 95 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
Michael Lutz 65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 4 years ago
Michael Lutz f3326d34e7 Codechange: Use std::string in FIO search path handling. 4 years ago
Charles Pigott 348c231e12 Codechange: Make codestyle for CMake files consistent for 'control' statements 4 years ago
TechGeekNZ 716c883737 Fix: Globally apply preprocessor directive coding style
Global; except for the 32-bit SSE blitter, which has some #DEFINEs
in not-very-nice places.
4 years ago
Patric Stout 4d04009d12 Codechange: remove #ifdef from .cpp files to exclude features
With CMake, these files are simply not compiled to start with.
4 years ago
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
4 years ago
Michael Lutz 37bc2f8064 Codechange: Use std::string in the driver and blitter selection code. 4 years ago
Niels Martin Hansen 2c84549db0 Fix: Two issues in MIDI file writer
Variable-length values would write threshold values with a byte too many.
System Exclusive messages would cause write to fail since the end byte was treated as part of next message.
4 years ago
Michael Lutz 4bfa3ff619 Remove: [OSX] Old QuickTime music driver. 4 years ago
Michael Lutz b17ea3de36 Remove: [OSX] Support for the pre-10.5 audio/music APIs. 4 years ago
Niels Martin Hansen 04ce1f0713 Fix #7885: [Fluidsynth] Use recommended method of setting sample rate 4 years ago
Milek7 41163331aa Fix: Silence all notes when stopping song in fluidsynth 5 years ago