Update SoundSource interface

Registered by Bill Good on 2011-07-09

The SoundSource interface has a handful of oddities, such as:

::open() can return ERR but this is ignored and one must set either length or sample rate to 0 to indicate an error in opening a file (this is likely leftover from the ::ParseHeader changes, as ParseHeader used to be able to be called and indicate an error on malformed files... or something like that, I think.) ::open needs to be able to indicate the file it was asked to open isn't acceptable for one reason or another (missing, inaccessible due to permissions, corrupted, malformed, ...).

::seek takes and returns a long. Longs mean different things on different archs and platforms Mixxx supports (see http://en.wikipedia.org/wiki/Long_integer, in essence long is 32-bit on Windows and 32-bit *nix, and 64-bit on 64-bit *nix). Using integer datatypes that aren't int are discourged for marvelous reasons, see http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Integer_Types. long is also used elsewhere in the interface and should be phased out in favor of something which holds the same width across our common platforms (::read, ::length).

::parseHeader: used to be static method ::ParseHeader, and ::open isn't explicitly called before ::parseHeader (which was obvious when the method was static ::ParseHeader, now not so much).

::read writes to a buffer declared const in the declaration (so you've got to const_cast it) of shorts (which really ought to be int16, but I digress). Writing int16's artificially restricts the sample size available to the mixing engine, which works in float32s.

Parts of this might be a documentation issue (::parseHeader), documentation exists (sorta) at http://www.mixxx.org/wiki/doku.php/soundsource_interface_sound_proxies. Otherwise, changes are needed in the interface and then the existing soundsource's (*including plugins that are in the tree*) need updating.

Blueprint information

RJ Skerry-Ryan
Bill Good
Uwe Klotz
Series goal:
Good progress
Milestone target:
Started by
Uwe Klotz on 2017-11-22


When tackling these issues, please consider including a way of accessing the Mixxx config from the soundsources. This would be nice for storing decoder settings through mixxx. However it is only useful if the user can edit those settings, e.g through a preferences dialog, which it seems is not supported for plugins.

Is this complete with the release of 2.1.0?


Work Items

This blueprint contains Public information 
Everyone can see this information.


No subscribers.