adlmidi icon indicating copy to clipboard operation
adlmidi copied to clipboard

Turn ADLMIDI into the "ADLCPP" library with keeping the same functionality

Open Wohlstand opened this issue 3 years ago • 17 comments

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 as adlinput.cc for ADL_Input, adlui.cc for ADL_UserInterface, and adlplay.cc for OPL3 and MIDIPlay.
  • 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 and Input classes. I turned them into pointers which should be set to make them work (that what I did at midiplay.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 and adlmidi 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 of midiplay.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.

Wohlstand avatar Aug 25 '20 22:08 Wohlstand

On Windows, it properly builds via QMake only, by direct build via mingw32-make it fails strongly even on a pure master branch build.

Wohlstand avatar Aug 29 '20 15:08 Wohlstand

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.

Wohlstand avatar Aug 29 '20 20:08 Wohlstand

It's the shortlist of what I did in it:

  • exploded midiplay.cpp into multiple modules, called as adlinput.cc for ADL_Input, adlui.cc for ADL_UserInterface, and adlplay.cc for OPL3 and MIDIPlay.
  • 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 and Input classes. I turned them into pointers which should be set to make them work (that what I did at midiplay.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 and adlmidi 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 of midiplay.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.

Wohlstand avatar Aug 29 '20 21:08 Wohlstand

The conflict that shown here is because I had to move src/midiplay.cc to utils/midiplay.cc.

Wohlstand avatar Oct 19 '20 07:10 Wohlstand

Okay, I had to rebase my branch, and it should be ok to merge.

Wohlstand avatar Oct 19 '20 09:10 Wohlstand

@bisqwit, ping?

Wohlstand avatar Dec 02 '20 11:12 Wohlstand

@bisqwit, ping?

I am alive, just very backlogged and delayed with pretty much everything possible.

bisqwit avatar Dec 02 '20 11:12 bisqwit

No problem, good luck then to resolve that as soon as possible! :wink:

Wohlstand avatar Dec 02 '20 11:12 Wohlstand

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?

Wohlstand avatar Jun 21 '21 20:06 Wohlstand

@bisqwit, ping?

Wohlstand avatar Aug 14 '21 20:08 Wohlstand

@bisqwit, are you okay?

Wohlstand avatar Sep 06 '21 22:09 Wohlstand

Yes, but I am only one person. Sorry.

bisqwit avatar Sep 06 '21 22:09 bisqwit

I understand, I just wanted to ask how are you

Wohlstand avatar Sep 06 '21 22:09 Wohlstand

@bisqwit, ping?

Wohlstand avatar Oct 25 '22 13:10 Wohlstand

@bisqwit, Hello, how are you? Long time not see :)

Wohlstand avatar May 15 '23 20:05 Wohlstand

@bisqwit, ping?

Wohlstand avatar Aug 19 '23 15:08 Wohlstand

@bisqwit, ping? Are you okay?

Wohlstand avatar Nov 12 '23 18:11 Wohlstand