Sunday, January 11, 2015

FMod - v2.3.1 and ImfPreview

I finally got around to writing up and posting v2.3.1 on the PCKF today. It doesn't include any new visible changes from last time I mentioned Abiathar on here (just some tweaks to the extension API).

I did, however, also finish and release something else. The same community member requesting the changes of v2.3.1 also wanted a way to preview the IMF songs in Music Mappings. I do not know anything at all about audio playing or conversion, but somebody had made an IMF-to-WAV converter. Unfortunately, it's licensed under the GPL, so had I used it in Abiathar, I would have to place the entire program under the GPL, which is not going to happen. Ever. So I made use of my own extension API to create an Abiathar extension called ImfPreview which could be placed under the GPL.

ImfPreview contains Imf2Wav as a datafile and spits it out when asked to play an IMF. It invokes the program, pointing it to a temporary IMF file on disk, waits for it to finish, and then takes the converted WAV file and plays it. As an Abiathar extension, it uses reflection to find the instance of the Music Mappings form, grabs its instance of the audio being edited, and injects a bunch of event handlers to add functionality and clean up after itself.

With ImfPreview installed, simply right-clicking a song in the right-hand Music Mappings list plays it. All temporary files are removed when Abiathar is closed.

It actually turns out that I don't have to place ImfPreview under the GPL because of the way I interface with Imf2Wav. (It's not the normal pointers-and-structures style of linking covered by the GPL.) In fact, GPL'ing ImfPreview - which has a linker dependency on Abiathar, which is not and never will be GPL'd - would require me to do a bunch of legal stuff that I don't want to deal with. So, the final result is that both Abiathar and ImfPreview are under the Berne Convention default license and ImfPreview is open source. I'll keep ImfPreview's functionality as an extension just in case I'm wrong about what constitutes executable linking.

You can download ImfPreview (includes source, Imf2Wav, Imf2Wav's source, and a copy of the GPLv2). All that's necessary to put next to Abiathar is ImfPreview.aex.

No comments:

Post a Comment