Commit graph

20 commits

Author SHA1 Message Date
Fabian Greffrath
241d056f60 midiproc: some further improvements
Recent versions of SDL_Mixer allow for rendering MIDI songs using
the fluidsynth backend and recent versions of fluidsynth allow for
using soundfonts in SF3 format (which contain OGG compressed samples).

The midiproc process currently assumes that it is possible to remove
the temporary music file immediately after Mix_LoadMUS() has been
called, which is true if the music is rendered using Windows's limited
intrnal MIDI playback. However, when using an advanced backend like
fluidsynth, this file maybe locked by this library. Furthermore,
midiproc currently assumes that it is possible to override the
temporary music file as soon as Mix_HaltMusic() has been called which
is again not true if fluidsynth is used. In this case, this is only
possible after Mix_FreeMusic() has been called (and returned).
Additionally, we increase the time-out value after which we give up
waiting for the midiproc process to send an acknowledgement to 1s to
give it some time to load the fluidsynth library and a soundfont
(although 1s will still not be enough for soundfonts in SF3 format
which reportedly load up to the order of 10s!).
2017-12-11 14:46:09 +01:00
Fabian Greffrath
f88cbbaa4a midiproc: consider the case that RegisterSong() fails
More specifically, because Mix_LoadMUS() fails, e.g. because it does not
recognize the music lump's file format. Music lumps are not always in
MUS or MIDI format nowadays, so let other code handle that.
2017-11-23 15:22:37 +01:00
Alex Mayfield
b58976aa24 Put our winged Int16 writing into function 2017-03-14 21:19:46 -04:00
Alex Mayfield
e8e2d602e6 Move midipipe messages out of net
Rename them while we're at it.
2017-03-13 23:40:51 -04:00
Alex Mayfield
f09202ec5a Style fixes 2017-03-13 22:56:43 -04:00
Alex Mayfield
3d3d950a79 Move bytes_written declaration to top 2017-03-09 21:07:02 -05:00
Alex Mayfield
fee18df791 WriteFile requires 4th parameter
Fixes crashes on certain versions of Windows.
2017-03-09 20:28:17 -05:00
Alex Mayfield
b4701b6c91 Improve version mismatch error
The error message now spells out the entire client and server version
string, so they can be visually inspected for discrepancies.
2017-03-09 18:09:25 -05:00
Alex Mayfield
bad402578d Pass sample rate to midiproc 2017-03-09 00:03:22 -05:00
Alex Mayfield
044b3e839a Define and comment fixes 2017-03-08 23:16:00 -05:00
Alex Mayfield
4abf58cf86 Remove debugging bits 2017-03-08 22:45:41 -05:00
Alex Mayfield
37ea28a455 Fix GCC warnings 2017-02-26 17:24:04 -05:00
Mike Swanson
9f9d647297 Add midiproc to the automake system. 2017-02-22 22:49:57 -08:00
Alex Mayfield
5607efe36e Free resources that we use 2017-02-21 20:29:16 -05:00
Alex Mayfield
f7baca64df midiproc now compiles with no /W4 warnings 2017-02-18 22:56:03 -05:00
Alex Mayfield
7791ace57e Add server shutdown and music overrides
- The process will now cut the music and shut down when Chocolate Doom
does.
- The process will now peacefully coexist with music overrides, such as
digital music packs.
2017-02-18 22:47:22 -05:00
Alex Mayfield
73ef8a7e9d First working prototype
Since I had communication working, I then completely reworked the
original interface to cater to Chocolate Doom.  A couple of hours
later, I finally have a working prototype - launching Chocolate Doom
will play music, and you can control the music volume independently of
the sound effects.
2017-02-18 18:59:25 -05:00
Alex Mayfield
090bc3bb61 Whoops, forgot to update midiproc packet types 2017-02-18 16:33:46 -05:00
Alex Mayfield
af06c1fef0 Second attempt, this time with pipes
Unfortunately, as it turns out, SDL_net does not allow you to create a
TCP listening socket that only listens on localhost.  This has the
unfortunate side-effect of showing a firewall message, which is not
desirable.

Instead, I use pipes to communicate with the subprocess over stdin.
This approach actually works - the current state of the code is if you
launch Chocolate Doom, it will communicate with the subprocess.

This is only the beginning.  Although communication is occurring, I
don't appear to actually be able to hear anything, and Chocolate Doom
crashes as soon as there is an attempt to switch songs.
2017-02-18 00:40:02 -05:00
Alex Mayfield
2f8ed99c11 Normalize header comments and file extensions 2017-02-10 18:41:22 -05:00
Renamed from midiproc/main.cpp (Browse further)