Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

Wohlstand
Copy link
Contributor

@Wohlstand Wohlstand commented Aug 25, 2020

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:

  • tune the API for the library, make simpler use of it
  • make a simple playing example without a complex UI
  • 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
  • verify the build on Windows
  • verify the build on DJGPP, make sure it will be built as a monolith static build
  • 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
Copy link
Contributor Author

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
Copy link
Contributor Author

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 Wohlstand marked this pull request as ready for review August 29, 2020 20:55
@Wohlstand
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@Wohlstand Wohlstand force-pushed the library-3 branch 2 times, most recently from e116a29 to a365978 Compare October 19, 2020 09:04
- This emulator is more accurate
- This emulatir is licensed under LGPL 2.1 license
- midiplay is a separate tool, not a library
- dbopl is now a part of gen_adldata only as it's faster emulator for measures, accuracy and license is not important here
@Wohlstand
Copy link
Contributor Author

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

@Wohlstand
Copy link
Contributor Author

@bisqwit, ping?

@bisqwit
Copy link
Owner

bisqwit commented Dec 2, 2020

@bisqwit, ping?

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

@Wohlstand
Copy link
Contributor Author

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

@Wohlstand
Copy link
Contributor Author

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
Copy link
Contributor Author

@bisqwit, ping?

@Wohlstand
Copy link
Contributor Author

@bisqwit, are you okay?

@bisqwit
Copy link
Owner

bisqwit commented Sep 6, 2021

Yes, but I am only one person. Sorry.

@Wohlstand
Copy link
Contributor Author

I understand, I just wanted to ask how are you

@Wohlstand
Copy link
Contributor Author

@bisqwit, ping?

@Wohlstand
Copy link
Contributor Author

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

@Wohlstand
Copy link
Contributor Author

@bisqwit, ping?

@Wohlstand
Copy link
Contributor Author

@bisqwit, ping? Are you okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants