Tag Archives: C++

Ocarina 6.4.3

I just released Ocarina 6.4.3!  My main project over the last several months has been converting Ocarina over to C, and as of this release one quarter of my Ocarina codebase has been converted.

I have several reasons for this conversion, the first being that my natural coding style tends towards writing very C-ish code.  I don’t use a large number of classes or inheritance, and I find it easier to write a global function instead.  This can work in C++ or Python, but sufficiently large projects tend to get messy.

Switching over to C also makes it easier to make an interface in GTK.  Glade, the GTK interface designer, lets me assign callback functions in xml, cutting out a lot of code to wire everything up.  This works great in C, but breaks in C++ due to how C++ code is compiled.

Converting everything from C++ to C is surprisingly easy thanks to the extern keyword in C++, which I use to include C files in my remaining C++ code:

extern "C" {
#include <core/file.h>
#include <core/tags/track.h>
#include <core/audio.h>

I have enough changes stacked up that I can have an Ocarina release every other week for the next several months. This should give me plenty of buffer time while I work on GUI code.

Ocarina 6.4.3 can be downloaded here!

History of Ocarina

Ocarina started in April 2009 as an experiment in writing my own music player.  I used to use one of the big players included as an option in most Linux distributions, but they released a major update that happened to remove most of the features I relied on.  Clearly the only reasonable solution was to write my own, and so Ocarina was born!

Ocarina 1


I started working in Python, and wrote mostly experimental code that provided me with an opportunity to learn about both GTK+ and GStreamer.

Ocarina 2


A rewrite soon followed, adding many new features.  This was the first version to support a feature I can’t live without: the ability to queue up songs to play later.

Ocarina 3

I never got very far with Ocarina 3.  The goal was to create a generic Python framework that I could share with other projects, but I never got very far.  The code I wrote was too complicated to use, and I eventually tossed it out.

Ocarina 4


Ocarina 4 was when I really began to innovate.  I quickly decided that I should emphasize the “currently playing” song list, and the rest of the UI flowed from there.

Ocarina 5


I rewrote Ocarina 5 in C++ so I could take advantage of the syntax checking that compilers offer.  I also added in several new features including AutoPause, a visual history tab, and multiple rearrangeable queues.