It was time for a rewrite on the replay routine that handles modules for 4champ. In the original app, playlist handling and replay were bundled in a single player class that used modplug to render the modules into audio stream. I wanted to avoid such tight coupling, and decided to implement the playing of modules in a way that allows for swapping the actual player libraries on the fly.
For now, I’m sticking with two libs: libOpenMPT and HivelyTracker. The first has a C++ interface, and the second is a C implementation. Since Swift does not have direct C/C++ interoperability, the Swift-facing Replay class and the library-specific wrappers are written in Objective-C.
To test run my implementation I also wrote a very bare-bones sample mod player app that bundles a set of different types of modules that resides under
SamplePlayer folder in the 4champ repository. You can try that out, just build the app in xcode and run in simulator or device.
Decided to start from the dependencies - I had LibOpenMPT integrated in my original project, but it was a very clumsy hack. In fact, I did not remember quite exactly how I put the iOS build together and after updating to latest OpenMPT sources from github I was facing some build errors.
Some tweaking with the OpenMPT Lua scripts and I could get the thing to work, somewhat. Premake5 official release does not work too well for iOS projects so it took a pbxproj file script hack to get it done, and building requires a manual step to add the dependency libraries to linking phase, but now I have it under my OpenMPT fork at https://github.com/sitomani/openmpt.
Output from the build scripts in my fork repo is a fat binary for libopenmpt-small containing all the necessary architectures for 4champ.
These pages are created to document my development efforts and related endeavours around 4champ mod player app. I hope publishing my progress here will inspire me to give the project a nudge more often than during past months.
As a first entry to this dev journal I guess it would make sense to introduce the project and the goals, as I have not pushed any code yet. Basically, I have two main goals for 4champ in 2018: