Commit graph

31 commits

Author SHA1 Message Date
Mike Swanson
cc9c4ef380 Makefile.am: add CMakeLists.txt and win32 to EXTRA_DIST
Closes: #1055
2018-06-05 10:41:38 -07:00
Alex Mayfield
d6cb093e4c Apply WIN32 to executables
This changes the binaries to use the WINDOWS subsystem.
2018-05-22 20:42:44 -04:00
Alex Mayfield
8101009bba CMake now works on Linux
It uses pkg-config to obtain hints about where the libraries are.
2018-05-04 17:46:19 -04:00
Alex Mayfield
5b30a0ac1f SDL2_mixer and midiproc 2018-05-02 18:43:39 -04:00
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
668d03699c Merge remote-tracking branch 'chungy/chocolate-midivolume' into chocolate-midivolume 2017-02-26 17:27:45 -05:00
Alex Mayfield
37ea28a455 Fix GCC warnings 2017-02-26 17:24:04 -05:00
Mike Swanson
f6581c534c midiproc: Change name to @PROGRAM_PREFIX@midiproc in automake 2017-02-26 14:19:49 -08: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
6f366890c4 Remove remnants of original IDL implementation 2017-02-18 19:08:57 -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
056cdff7ce Implement buffer reader functions
This functionality allows us to read data out of a buffer without
irrevocably consuming it.  We read what we can, and when we're done we
throw the reader away.

The plan is to read as much of a stream of data as is available, and if
we can't read a complete message, we simply toss the reader away and
try again when we get more data.  I think that perhaps this strategy
might be easier than coming up with a state machine to parse the stream.

Please do not advance the underlying buffer while trying to use a
reader.
2017-02-15 21:11:19 -05:00
Alex Mayfield
b5302fee81 Missing header, tidy up code 2017-02-13 00:52:13 -05:00
Alex Mayfield
ccef38fb99 Implement a buffer for the TCP stream to go into 2017-02-13 00:36:13 -05:00
Alex Mayfield
2f8ed99c11 Normalize header comments and file extensions 2017-02-10 18:41:22 -05:00
Alex Mayfield
a941e8c70a Initial version of MidiRPC from Eternity
Quasar has graciously offered this functionality under the GPLv2.
2017-02-10 18:27:07 -05:00