adlmidi
adlmidi copied to clipboard
Turn ADLMIDI into the "ADLCPP" library with keeping the same functionality
As was discussed at #3, I started to work on a turning ADLMIDI into the library. This is my complete work to split ADLMIDI into the library part, and users part. Most of the code was been moved into own cc
files but didn't change. Therefore, a thing is working with the same as before the rework.
An updated build will produce two binaries:
- adlmidi - the player application
- libadlcpp.so - the re-useable shared library that contains a MIDI sequencer, MIDI Synthesizer, banks, etc.
- libadlcpp.a - the re-useable static library that contains same as the shared library.
- include/ - a directory that contains a set of public headers
However, I still need to complete the work, and there are items I need to complete:
- [x] tune the API for the library, make simpler use of it
- [x] make a simple playing example without a complex UI
- [x] make a proper installing by
make install
that will copy the library into/usr/local/libXX
and will copy all public headers into/usr/local/include/adlcpp
- [x] verify the build on Windows
- [x] verify the build on DJGPP, make sure it will be built as a monolith static build
- [x] replace DosBox emulator with Nuked OPL3 emulator which is more accurate and has LGPL license: https://github.com/nukeykt/Nuked-OPL3/
EDIT August 29, 2020:, I had to complete the full list, and now the thing is ready for merge.
The shortlist of all changes I made in this PR:
- exploded
midiplay.cpp
into multiple modules, called asadlinput.cc
forADL_Input
,adlui.cc
forADL_UserInterface
, andadlplay.cc
forOPL3
andMIDIPlay
. - made public headers: adlcpp.h, adlglob.h, adlinput.h, adlplay.h, adlui.h, made private header adlpriv.hh
- moved
fraction.hpp
into the place of public headers - I made the ability to use MIDIPlay class without necessary to define
UI
andInput
classes. I turned them into pointers which should be set to make them work (that what I did atmidiplay.cc
) - I managed to mark each class and public function as exported by the special set of macros I made
- I made the build system work to generate the
libadlcpp.so
shared library andadlmidi
which links it - I verified the work on Windows and DJGPP (I built DJGPP as a cross-compiler for Linux side usage) and fixed all broken cases
- I made the build to also produce the static library too
- I implemented the
AdlSimpleMidiPlay
class that re-implements the minimal part ofmidiplay.cc
to make the easier programmatical re-use of the ADLCPP library part. - I made the simple example that simply plays the MIDI file by ADLCPP without any extras.
- As a final part of the work, I replaced the DosBox OPL3 emulator with a Nuked OPL3 emulator which is more accurate which is licensed under LGPLv2.1. The DosBox emulator I kept at
gen_adldata
tool as it's needed the faster emulator than accurate for its measure work.
Feel free to write any comments, suggestions, tips, and notices here.
On Windows, it properly builds via QMake only, by direct build via mingw32-make it fails strongly even on a pure master branch build.
For a friendly usage of MIDI playing API, I made the AdlSimpleMidiPlay
class, defined at adlcpp.h for public, and the simple usgae example through SDL Audio.
It's the shortlist of what I did in it:
- exploded
midiplay.cpp
into multiple modules, called asadlinput.cc
forADL_Input
,adlui.cc
forADL_UserInterface
, andadlplay.cc
forOPL3
andMIDIPlay
. - made public headers: adlcpp.h, adlglob.h, adlinput.h, adlplay.h, adlui.h, made private header adlpriv.hh
- moved
fraction.hpp
into the place of public headers - I made the ability to use MIDIPlay class without necessary to define
UI
andInput
classes. I turned them into pointers which should be set to make them work (that what I did atmidiplay.cc
) - I managed to mark each class and public function as exported by the special set of macros I made
- I made the build system work to generate the
libadlcpp.so
shared library andadlmidi
which links it - I verified the work on Windows and DJGPP (I built DJGPP as a cross-compiler for Linux side usage) and fixed all broken cases
- I made the build to also produce the static library too
- I implemented the
AdlSimpleMidiPlay
class that re-implements the minimal part ofmidiplay.cc
to make the easier programmatical re-use of the ADLCPP library part. - I made the simple example that simply plays the MIDI file by ADLCPP without any extras.
- As a final part of the work, I replaced the DosBox OPL3 emulator with a Nuked OPL3 emulator which is more accurate which is licensed under LGPLv2.1. The DosBox emulator I kept at
gen_adldata
tool as it's needed the faster emulator than accurate for its measure work.
The conflict that shown here is because I had to move src/midiplay.cc
to utils/midiplay.cc
.
Okay, I had to rebase my branch, and it should be ok to merge.
@bisqwit, ping?
@bisqwit, ping?
I am alive, just very backlogged and delayed with pretty much everything possible.
No problem, good luck then to resolve that as soon as possible! :wink:
Hello! A bit more than two months has left until the "year anniversary" will happen for this pull request. How are you? Do you have any news?
@bisqwit, ping?
@bisqwit, are you okay?
Yes, but I am only one person. Sorry.
I understand, I just wanted to ask how are you
@bisqwit, ping?
@bisqwit, Hello, how are you? Long time not see :)
@bisqwit, ping?
@bisqwit, ping? Are you okay?