8 years agoImplement MIDI and LV2 volume control in sampler plugin.
Gabriel M. Beddingfield [Wed, 3 Mar 2010 04:06:23 +0000 (22:06 -0600)]
Implement MIDI and LV2 volume control in sampler plugin.

8 years agoPrep DefaultMidiImplementation for handling controller changes.
Gabriel M. Beddingfield [Wed, 3 Mar 2010 02:50:39 +0000 (20:50 -0600)]
Prep DefaultMidiImplementation for handling controller changes.

8 years agoImplement master volume as LV2 port.
Gabriel M. Beddingfield [Tue, 2 Mar 2010 03:48:11 +0000 (21:48 -0600)]
Implement master volume as LV2 port.

8 years agoImplement master volume on Mixer and replace Song::get_volume().
Gabriel M. Beddingfield [Tue, 2 Mar 2010 03:03:48 +0000 (21:03 -0600)]
Implement master volume on Mixer and replace Song::get_volume().

Song::get_volume() still persists because the Serialization code is a
little brittle.  The easiest way to handle that data was to leave it
in Song and manually plug it in to the mixer.

8 years agoRefactor Plugin MIDI Implementation using new interface.
Gabriel M. Beddingfield [Sat, 27 Feb 2010 15:31:41 +0000 (09:31 -0600)]
Refactor Plugin MIDI Implementation using new interface.

Basically does the same thing, but is now more extensible and can be
used to refactor the GUI's implementation.

8 years agoAdd MidiImplementation and MidiImplementationBase templates.
Gabriel M. Beddingfield [Sat, 27 Feb 2010 15:06:23 +0000 (09:06 -0600)]
Add MidiImplementation and MidiImplementationBase templates.

These provide some infrastructure for semi-generic midi

8 years agoDelete EngineLv2::_obj_bdl after _serializer.
Gabriel M. Beddingfield [Thu, 25 Feb 2010 05:06:49 +0000 (23:06 -0600)]
Delete EngineLv2::_obj_bdl after _serializer.

It's possible that the serializer will be working on an _obj_bdl.  If
we delete the bundle first, then the serializer will segfault.

8 years agoReplace size_t with uint32_t in Tritium::Mixer and AudioPortManager.
Gabriel M. Beddingfield [Wed, 24 Feb 2010 13:30:18 +0000 (07:30 -0600)]
Replace size_t with uint32_t in Tritium::Mixer and AudioPortManager.

These were being used interchangeably on my 32-bit system.  This
creates a build error on a 64-bit system.  Thanks to Patrick Shirkey
for the report!

8 years agoBump version to 0.005 for development.
Gabriel M. Beddingfield [Wed, 24 Feb 2010 04:37:06 +0000 (22:37 -0600)]
Bump version to 0.005 for development.

8 years agoBump version to 0.004. composite-0.004
Gabriel M. Beddingfield [Wed, 24 Feb 2010 03:34:15 +0000 (21:34 -0600)]
Bump version to 0.004.

8 years agoRemove some debugging output from Sampler Plugin.
Gabriel M. Beddingfield [Wed, 24 Feb 2010 03:33:58 +0000 (21:33 -0600)]
Remove some debugging output from Sampler Plugin.

8 years agoAdd plugin type to manifest.ttl.
Gabriel M. Beddingfield [Wed, 24 Feb 2010 02:39:44 +0000 (20:39 -0600)]
Add plugin type to manifest.ttl.

8 years agoRemove stray "> 0" when scheduling notes with instruments.
Gabriel M. Beddingfield [Wed, 24 Feb 2010 02:39:26 +0000 (20:39 -0600)]
Remove stray "> 0" when scheduling notes with instruments.

8 years agoAdd some extra cleanup code to the EngineLv2 destructors.
Gabriel M. Beddingfield [Wed, 24 Feb 2010 02:38:43 +0000 (20:38 -0600)]
Add some extra cleanup code to the EngineLv2 destructors.

8 years agoImplement some notes and velocities in plugin.
Gabriel M. Beddingfield [Tue, 23 Feb 2010 18:51:14 +0000 (12:51 -0600)]
Implement some notes and velocities in plugin.

8 years agoLoad GMkit by default and get drum sounds instead of noise.
Gabriel M. Beddingfield [Tue, 23 Feb 2010 04:22:40 +0000 (22:22 -0600)]
Load GMkit by default and get drum sounds instead of noise.

The white noise generator is removed.  Loading the GMkit by default
was hastily implemented to get things working... and a long-term
solution will follow.

8 years agoConvert Serialization, LocalFileMng, and SoundLibrary to EngineInterface.
Gabriel M. Beddingfield [Mon, 22 Feb 2010 18:22:58 +0000 (12:22 -0600)]
Convert Serialization, LocalFileMng, and SoundLibrary to EngineInterface.

For the playlist, I worked around adding that to EngineInterface by
doing a dynamic pointer cast.

8 years agoCreate Tritium::EngineInterface super-class.
Gabriel M. Beddingfield [Mon, 22 Feb 2010 13:51:17 +0000 (07:51 -0600)]
Create Tritium::EngineInterface super-class.

This will allow, for instance, the EngineLv2 pointer to be given to
the Serializer so that it can load/save drum kits.

8 years agoAdd basic event handling to sampler plugin.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 19:53:54 +0000 (13:53 -0600)]
Add basic event handling to sampler plugin.

However, we still only output noise... and there are no instruments
being loaded.

8 years agoAdd the in-tree 3rd party LV2 headers to sampler build.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 19:52:58 +0000 (13:52 -0600)]
Add the in-tree 3rd party LV2 headers to sampler build.

8 years agoAdd the LV2 Midi Event extension description.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 13:12:51 +0000 (07:12 -0600)]
Add the LV2 Midi Event extension description.

8 years agoAdd the LV2 Event extension headers and description.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 13:11:47 +0000 (07:11 -0600)]
Add the LV2 Event extension headers and description.

8 years agoAdd symbolic links to lv2.h and lv2core.lv2.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 13:11:14 +0000 (07:11 -0600)]
Add symbolic links to lv2.h and lv2core.lv2.

8 years agoImport the LV2 Core spec into the source tree.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 13:10:17 +0000 (07:10 -0600)]
Import the LV2 Core spec into the source tree.

8 years agoAdd MIDI In port to TTL file, rename ports.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 04:33:30 +0000 (22:33 -0600)]
Add MIDI In port to TTL file, rename ports.

This just adds the port to the manifest, and allows hosts to think we
actually take MIDI data.  This plugin is still just outputting noise.

8 years agoSet LINK_INTERFACE_LIBRARIES on libTritium.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 04:09:16 +0000 (22:09 -0600)]

CMake cascades link libraries.  So, the sampler and the gui were
getting linked with every library that libTritium was getting linked
to.  This is totally wrong for the LV2 plugin, which should /not/ be
linked to FLAC, sndfile, JACK, etc.  This CMake property overrides
this behavior for both the GUI and the LV2 plugin.

8 years agoAdd LV2 sampler to the build system.
Gabriel M. Beddingfield [Sun, 21 Feb 2010 03:46:50 +0000 (21:46 -0600)]
Add LV2 sampler to the build system.

8 years agoCommit LV2 Plugin of Sampler.
Gabriel M. Beddingfield [Sat, 20 Feb 2010 17:54:52 +0000 (11:54 -0600)]
Commit LV2 Plugin of Sampler.

This plugin has most of the internals, but at the moment only outputs
white noise (as a debugging tool).  There is a simple in-tree Makefile
that probably won't work for everyone.  This sampler is currently
unable to load misc. drumkits, nor is it able to accept any input data
(MIDI).  However, it is able to successfully build, install, load
(ingen, zynjacku), and output noise.

8 years agoAdd a file for wish-list items.
Gabriel M. Beddingfield [Fri, 19 Feb 2010 18:40:38 +0000 (12:40 -0600)]
Add a file for wish-list items.

8 years agoTotally remove Sampler's need for Engine.
Gabriel M. Beddingfield [Fri, 19 Feb 2010 18:38:33 +0000 (12:38 -0600)]
Totally remove Sampler's need for Engine.


8 years agoTie in Mixer parameters to GUI.
Gabriel M. Beddingfield [Fri, 19 Feb 2010 18:28:31 +0000 (12:28 -0600)]
Tie in Mixer parameters to GUI.

This includes the fader gain, the FX gain settings, etc.  This
required several infrastructure inprovements... such as access to the
Mixer::Channel parameters that the Mixer manages.

8 years agoMixer is now mixing for the Sampler.
Gabriel M. Beddingfield [Fri, 19 Feb 2010 13:48:25 +0000 (07:48 -0600)]
Mixer is now mixing for the Sampler.

The Sampler was taking out a single 'main out' port from the Sampler.
It now takes out a port for each instrument... and the mixer handles
mixing of the instruments.

Note that to test this commit, you'll need to patch
MixerImplPrivate.hpp so that the default send gain is 1.0 (instead of

8 years agoMove FX processing into Mixer.
Gabriel M. Beddingfield [Wed, 17 Feb 2010 02:51:53 +0000 (20:51 -0600)]
Move FX processing into Mixer.

However, this breaks the FX processing because Mixer::Channel
properties are not being set.

8 years agoAdd send/return (fx) to Mixer, also clipping.
Gabriel M. Beddingfield [Tue, 16 Feb 2010 18:16:57 +0000 (12:16 -0600)]
Add send/return (fx) to Mixer, also clipping.

Note that it isn't actually being utilized, yet, by Tritium::Engine.

8 years agoAdd get_mixer() access from Tritium::Engine.
Gabriel M. Beddingfield [Mon, 15 Feb 2010 13:45:07 +0000 (07:45 -0600)]
Add get_mixer() access from Tritium::Engine.

This created a namespace clash between Tritium::Mixer and ::Mixer in
the GUI code.  Rather than put the GUI code in a namespace (the Right
thing to do), I instead worked around by adding the global accessor
(::Mixer) and, where necc., only imported some things from Tritium
(esp. in composite-gui/Mixer/Mixer.cpp).

8 years agoRename Mixer to MixerImpl and create super-class Mixer.
Gabriel M. Beddingfield [Mon, 15 Feb 2010 13:28:09 +0000 (07:28 -0600)]
Rename Mixer to MixerImpl and create super-class Mixer.

Tritium::Mixer is now a generic interface to a Mixer object, for use
by something like a GUI.

8 years agoSet up per-mixer-channel parameters.
Gabriel M. Beddingfield [Sat, 13 Feb 2010 16:29:04 +0000 (10:29 -0600)]
Set up per-mixer-channel parameters.

Created extensible class Mixer::Channel with various properites like
gain, pan, etc.

8 years agoRemove some dead code.
Gabriel M. Beddingfield [Sat, 13 Feb 2010 13:38:05 +0000 (07:38 -0600)]
Remove some dead code.

8 years agoAdd some documentation on misc DSP matters.
Gabriel M. Beddingfield [Fri, 12 Feb 2010 15:35:32 +0000 (09:35 -0600)]
Add some documentation on misc DSP matters.

8 years agoKludge Mixer into Engine and Sampler.
Gabriel M. Beddingfield [Fri, 12 Feb 2010 03:29:45 +0000 (21:29 -0600)]
Kludge Mixer into Engine and Sampler.

This works, but has the following shorcomings:

* It breaks the per-instrument outputs.  These will
  be reinstated in the Mixer.

* The Mixer isn't handling per-instrument volumes.
  This is still being handled by Instrument and
  inside the Sampler.

* Sampler still needs the engine pointer in order
  to access the effects.  These, too, will be moved
  to the Mixer.

8 years agoUpdate t_AudioPort for change in zero_flag() behavior.
Gabriel M. Beddingfield [Fri, 12 Feb 2010 02:28:49 +0000 (20:28 -0600)]
Update t_AudioPort for change in zero_flag() behavior.

8 years agoProtect Mixer::eval_pan() from a couple error conditions.
Gabriel M. Beddingfield [Thu, 11 Feb 2010 23:18:45 +0000 (17:18 -0600)]
Protect Mixer::eval_pan() from a couple error conditions.

* Division by zero.
* Invalid inputs.

8 years agoImplement Tritium::Mixer and some basic tests for it.
Gabriel M. Beddingfield [Thu, 11 Feb 2010 19:01:04 +0000 (13:01 -0600)]
Implement Tritium::Mixer and some basic tests for it.

This is a generic mixer object.

8 years agoAdd get/set name to AudioPort.
Gabriel M. Beddingfield [Thu, 11 Feb 2010 03:42:09 +0000 (21:42 -0600)]
Add get/set name to AudioPort.

8 years agoRename some of the tests.
Gabriel M. Beddingfield [Thu, 11 Feb 2010 00:00:53 +0000 (18:00 -0600)]
Rename some of the tests.

8 years agoAdd an AudioPort (buffer) class.
Gabriel M. Beddingfield [Wed, 10 Feb 2010 18:55:32 +0000 (12:55 -0600)]
Add an AudioPort (buffer) class.

Aiming at implementing a mixer instead of having the sampler deal with
audio drivers directly.

8 years agoGet preview instrument/sample working.
Gabriel M. Beddingfield [Sun, 7 Feb 2010 14:03:35 +0000 (08:03 -0600)]
Get preview instrument/sample working.

These had been marked with assert(false) in the transport redesign.

8 years agoSampler no longer queries Preferences.
Gabriel M. Beddingfield [Sun, 7 Feb 2010 12:58:41 +0000 (06:58 -0600)]
Sampler no longer queries Preferences.

Instead, the sampler has some configuration features.  If need be,
Preferences should query the sampler in the future.  The main things
that the Sampler was using from Preferences was the maximum notes
(polyphony) setting, whether or not to have per-instrument outputs,
and whether those outputs should be pre- or post- fader.

Also did some code reformatting in Sampler.cpp.

8 years agoFix a regression with per-track outputs.
Gabriel M. Beddingfield [Sun, 7 Feb 2010 03:58:23 +0000 (21:58 -0600)]
Fix a regression with per-track outputs.

The tracks weren't being divided up, and the first instrument
typically got all of the data while the other tracks were silent.

8 years agoMove the Instruments from Song to Sampler.
Gabriel M. Beddingfield [Thu, 4 Feb 2010 04:19:04 +0000 (22:19 -0600)]
Move the Instruments from Song to Sampler.

The array of Instrument instances is now managed by the Sampler class
instead of the Song class.

8 years agoFinish tests on saving a song.
Gabriel M. Beddingfield [Tue, 2 Feb 2010 13:02:30 +0000 (07:02 -0600)]
Finish tests on saving a song.

8 years agoRemove the obsolete SongWriter and SongReader classes.
Gabriel M. Beddingfield [Tue, 2 Feb 2010 04:29:23 +0000 (22:29 -0600)]
Remove the obsolete SongWriter and SongReader classes.

8 years agoRefactor Song::load() to use new Serialization code.
Gabriel M. Beddingfield [Tue, 2 Feb 2010 04:25:48 +0000 (22:25 -0600)]
Refactor Song::load() to use new Serialization code.

8 years agoRefactor Song::save() to use new Serialization code.
Gabriel M. Beddingfield [Tue, 2 Feb 2010 03:49:51 +0000 (21:49 -0600)]
Refactor Song::save() to use new Serialization code.

Note that the serializer expects a T<Song>::shared_ptr, so I couldn't
pass it a 'this' pointer.  So, as a workaround Song now inherits

8 years agoImplement song saving and basic tests in Serialization code.
Gabriel M. Beddingfield [Mon, 1 Feb 2010 18:47:14 +0000 (12:47 -0600)]
Implement song saving and basic tests in Serialization code.

8 years agoRefactor LocalFileMng::saveDrumkit() with new Serialization code.
Gabriel M. Beddingfield [Mon, 1 Feb 2010 13:01:36 +0000 (07:01 -0600)]
Refactor LocalFileMng::saveDrumkit() with new Serialization code.

8 years agoAbstract the way that SerializationQueue handles callbacks.
Gabriel M. Beddingfield [Mon, 1 Feb 2010 03:14:35 +0000 (21:14 -0600)]
Abstract the way that SerializationQueue handles callbacks.

I started noticing I was copying the same code over and over to handle
the callbacks.  So, I gathered them into once convenience function so
that things are handled in a uniform manner.

8 years agoAdd tests for loading the temporary drumkit.
Gabriel M. Beddingfield [Sun, 31 Jan 2010 21:35:03 +0000 (15:35 -0600)]
Add tests for loading the temporary drumkit.

8 years agoAdd most of save_drumkit test and fixed some issues.
Gabriel M. Beddingfield [Sun, 31 Jan 2010 20:07:02 +0000 (14:07 -0600)]
Add most of save_drumkit test and fixed some issues.

8 years agoUpdate t_Serialization for the new test_kit drumkit.
Gabriel M. Beddingfield [Wed, 27 Jan 2010 18:37:56 +0000 (12:37 -0600)]
Update t_Serialization for the new test_kit drumkit.

8 years agoChange the test drumkit.
Gabriel M. Beddingfield [Wed, 27 Jan 2010 18:32:18 +0000 (12:32 -0600)]
Change the test drumkit.

The test drumkit was a symbolic link to the GMkit.  However, when
saving, there have been plenty of schema changes since that drumkit
was originally created.  So, I created a test_kit that is a "fresh
save" of the GMkit.  All the samples for the kit are still symbolic

Note that this creates new failures on the t_Serialization test
because things like the drumkit name don't match.

8 years agoMigrate LocalFileMng::saveDrumkit code into Serialization.
Gabriel M. Beddingfield [Tue, 26 Jan 2010 20:59:19 +0000 (14:59 -0600)]
Migrate LocalFileMng::saveDrumkit code into Serialization.

8 years agoAdd test for drumkit metadata in t_Serialization.
Gabriel M. Beddingfield [Tue, 26 Jan 2010 18:27:47 +0000 (12:27 -0600)]
Add test for drumkit metadata in t_Serialization.

This was overlooked when Drumkit_t was added.

8 years agoRewrite LocalFileMng::savePattern() using Serialization code.
Gabriel M. Beddingfield [Tue, 26 Jan 2010 18:18:36 +0000 (12:18 -0600)]
Rewrite LocalFileMng::savePattern() using Serialization code.

8 years agoMigrate save pattern code to Serialization.
Gabriel M. Beddingfield [Tue, 26 Jan 2010 03:41:15 +0000 (21:41 -0600)]
Migrate save pattern code to Serialization.

8 years agoJackOutput accidentally activated the jack client pointer too early.
Gabriel M. Beddingfield [Sun, 24 Jan 2010 20:27:10 +0000 (14:27 -0600)]
JackOutput accidentally activated the jack client pointer too early.

This created a sort of deadlock.
EnginePrivate::audioEngine_startAudioDrivers() would lock the mutex to
the audio driver.  When the audio driver is initialized, it would
activate the jack client... which uses the
EnginePrivate::audioEngine_process_clearAudioBuffers() -- and which
locks the same mutex.  All well and good... except that...

The mutex takes too long, and the jack server terminates the thread.
When audioEngine_startAudioDrivers() unlocks the thread, it tries to
signal the wait condition to the locking instance in
audioEngine_process_clearAudioBuffers().  But, since the thread was
terminated... this is now an invalid memory location and the program

8 years agoInstrument::load_from_placeholder(): handle absolute and anonymous paths.
Gabriel M. Beddingfield [Sat, 23 Jan 2010 21:46:25 +0000 (15:46 -0600)]
Instrument::load_from_placeholder(): handle absolute and anonymous paths.

8 years agoLoad a Drumkit object when loading a drumkit.
Gabriel M. Beddingfield [Sat, 23 Jan 2010 21:25:11 +0000 (15:25 -0600)]
Load a Drumkit object when loading a drumkit.

8 years agoRefactor LocalFileMng::loadPattern with new Serialization code.
Gabriel M. Beddingfield [Fri, 22 Jan 2010 21:42:48 +0000 (15:42 -0600)]
Refactor LocalFileMng::loadPattern with new Serialization code.

8 years agoRe-indent and untabify LocalFileMng.cpp.
Gabriel M. Beddingfield [Fri, 22 Jan 2010 21:16:44 +0000 (15:16 -0600)]
Re-indent and untabify LocalFileMng.cpp.

8 years agoHandle drumkit directory when loading samples.
Gabriel M. Beddingfield [Fri, 22 Jan 2010 20:53:50 +0000 (14:53 -0600)]
Handle drumkit directory when loading samples.

Now the drumkit loading passes the basic tests.

8 years agoAdd tests for loading drumkits.
Gabriel M. Beddingfield [Fri, 22 Jan 2010 15:40:57 +0000 (09:40 -0600)]
Add tests for loading drumkits.

Fails the tests, though.

8 years agoRun emacs 'untabify' on Serialization.cpp
Gabriel M. Beddingfield [Wed, 20 Jan 2010 13:52:16 +0000 (07:52 -0600)]
Run emacs 'untabify' on Serialization.cpp

8 years agoHandle .h2pattern style <pattern> elements.
Gabriel M. Beddingfield [Wed, 20 Jan 2010 13:51:41 +0000 (07:51 -0600)]
Handle .h2pattern style <pattern> elements.

8 years agoCommit several more tests for loading .h2pattern.
Gabriel M. Beddingfield [Mon, 18 Jan 2010 21:55:15 +0000 (15:55 -0600)]
Commit several more tests for loading .h2pattern.

Note that it fails one test because of the differing XML schema
between the .h2pattern and .h2song.  These are documented in
Documentation/Xml_Schemas.txt (see previous commit).

8 years agoAdd notes on the XML file schemas.
Gabriel M. Beddingfield [Mon, 18 Jan 2010 17:27:54 +0000 (11:27 -0600)]
Add notes on the XML file schemas.

8 years agoCreate a Documentation/ folder and move dev docs there.
Gabriel M. Beddingfield [Mon, 18 Jan 2010 16:54:53 +0000 (10:54 -0600)]
Create a Documentation/ folder and move dev docs there.

8 years agoStart Pattern Serialization test, fix infinite loop.
Gabriel M. Beddingfield [Wed, 13 Jan 2010 03:17:05 +0000 (21:17 -0600)]
Start Pattern Serialization test, fix infinite loop.

While loading a pattern, if there is not a match in the current
drumkit, code entered an infinite loop.

8 years agoFinish out tests for loading a song.
Gabriel M. Beddingfield [Tue, 12 Jan 2010 13:32:49 +0000 (07:32 -0600)]
Finish out tests for loading a song.

8 years agoAdd some basic Serialization tests.
Gabriel M. Beddingfield [Tue, 12 Jan 2010 03:59:17 +0000 (21:59 -0600)]
Add some basic Serialization tests.

It currently passes all tests, but has one built-in failure that says
"need to write more tests."

Because of a typo, this also uncovered a bug that occured when the
filename was invalid (e.g. didn't end in .h2song).  Resulted in a
deadlock of sorts.

8 years agoMassage Serialization code to make it more readable.
Gabriel M. Beddingfield [Sun, 10 Jan 2010 17:40:41 +0000 (11:40 -0600)]
Massage Serialization code to make it more readable.

* De-crypt local variable names.
* Wrap long lines (except for LocalFileManager::readXml###()
  lines.  Those are hopeless, and LocalFileManager is
  probably going to be split up in the future.)

8 years agoRefactor CMake dependencies to be distributed.
Gabriel M. Beddingfield [Sun, 10 Jan 2010 14:56:40 +0000 (08:56 -0600)]
Refactor CMake dependencies to be distributed.

This makes the CMakeLists files for libTritium and composite-gui
/more/ standalone... however they are not totally standalone.

8 years agoBoost is now a required library (boost::shared_ptr<>).
Gabriel M. Beddingfield [Sun, 10 Jan 2010 13:13:26 +0000 (07:13 -0600)]
Boost is now a required library (boost::shared_ptr<>).

8 years agoRefactor Tritium::SongReader with Tritium::Serializer.
Gabriel M. Beddingfield [Sun, 10 Jan 2010 12:56:57 +0000 (06:56 -0600)]
Refactor Tritium::SongReader with Tritium::Serializer.

Serializer (and its buddies) are a system to support asynchronous file
save/restore.  This is being done because it's an important feature to
Composite, and also because the act of moving the Instrument List into
the Sampler would require a bunch of hacking on this section of code,

Objects are passed asynchronously using Tritium::ObjectBundle.  This
is a callback/functor with the payload of Song and Instrument
pointers.  This is also the reason for implementing shared pointers.

A summary of the new API may be seen in SongReader::readSong()
[src/Tritium/src/Serialization.cpp, line 900].

8 years agoAdd class to manage object transfer (ObjectBundle).
Gabriel M. Beddingfield [Mon, 4 Jan 2010 04:36:00 +0000 (22:36 -0600)]
Add class to manage object transfer (ObjectBundle).

The ObjectBundle class is a container for several objects (like Song,
Pattern, Instrument, etc.) for the purpose of passing around related
groups.  For example, the intent for the future is that a song be
loaded and the Song and Instruments be passed to Engine after they are
initialized.  Engine will then "install" them.  This is one of the
features that will enable the serialization to code to load a song and
instruments in a non-audio thread, and pass the data when it's ready
to go.

8 years agoChecked the defaults in Note.
Gabriel M. Beddingfield [Mon, 4 Jan 2010 02:56:02 +0000 (20:56 -0600)]
Checked the defaults in Note.

8 years agoSong::save() was calling `delete this`
Gabriel M. Beddingfield [Mon, 4 Jan 2010 02:31:44 +0000 (20:31 -0600)]
Song::save() was calling `delete this`

The SongWriter::writeSong() method originally required a Song* as a
parameter.  When these were changed to T<Song>::shared_ptr, so was
this.  So, in Song::save() the following was used:

    err = writer.writeSong(engine, T<Song>::shared_ptr(this), fn);

This creates a temporary shared pointer to `this`.  When the temporary
variable goes out of scope it deletes the pointer (`delete this`).
This error would manifest itself in the 'autosave' where Composite
would crash while playing a song.

The simplest way to correct the error is to pass a reference (Song&)
instead of a pointer.

8 years agoUpdate build statistics.
Gabriel M. Beddingfield [Sun, 3 Jan 2010 18:33:12 +0000 (12:33 -0600)]
Update build statistics.

8 years agoReplace sprintf() with QString equiv, everywhere.
Gabriel M. Beddingfield [Fri, 1 Jan 2010 17:52:54 +0000 (12:52 -0500)]
Replace sprintf() with QString equiv, everywhere.

Was getting smashed stack errors.

8 years agoUpdate the NEW_DESIGN.txt for some of the rebranding/refactoring.
Gabriel M. Beddingfield [Fri, 1 Jan 2010 04:30:57 +0000 (23:30 -0500)]
Update the NEW_DESIGN.txt for some of the rebranding/refactoring.

8 years agoAdd todo to remove sprintf(). Got another smashed stack error.
Gabriel M. Beddingfield [Fri, 1 Jan 2010 04:24:16 +0000 (23:24 -0500)]
Add todo to remove sprintf().  Got another smashed stack error.

8 years agoStart using shared pointers in Tritium::Engine.
Gabriel M. Beddingfield [Thu, 31 Dec 2009 13:32:01 +0000 (07:32 -0600)]
Start using shared pointers in Tritium::Engine.

Working through the serialization code and issues with object
ownership, it became clear that it was time to implement shared
(smart, reference-counted) pointers and let the objects (mostly)
manage themselves rather than using documentation to express change of
ownership.  All of the major objects in Tritium::Engine are now
managed using a shared pointer.

The shared pointers are abstracted through a class template
Tritium::T<> (defined in Tritium/memory.hpp).  So, instead of writing

    boost::shared_ptr<Foo> obj( new Foo );

it is written like this:

    T<Foo>::shared_ptr obj( new Foo );

This abstraction comes at no cost and allows us to change the
implementation of the shared pointer later without changing much
code.  This also avoid possible problems of using a macro like:

    #define SharedPtr boost::shared_ptr

Which is what is done in Raul/Ingen, which is being considered for
future use with Tritium.

While object persistence is more stable, one issue that comes up is
deleting objects that really need to be deleted.  The only case where
this is /really/ important is with the Audio/Midi drivers... where we
need to make sure the driver is shut down so it will release the
hardware.  It's not clear how big an issue this is or will be, yet.
But, it is possible to replace the shared_ptr with something else that
allows more introspection.

The global Tritium::g_engine was not converted to a shared
pointer... nor any reference to Tritium::Engine itself.  I didn't
think it was necessary... but I may be wrong.  We'll see later.

To test for some object persistence issues, some of the tests now
look a little convoluted in the Fixtures.  What used to be declared as
"Foo x;" is now declared "T<Foo>::shared_ptr x_ptr; Foo& x;" so that
the life of the object can be controlled.  E.g. if there are notes
inside a SeqScript, then the Instrument pointers won't be deleted
until the SeqScript is deleted.

Note:  Since I was in the area, I went ahead and removed some of the
dead code in Engine.cpp.  The code has morphed enough that it's not
certain how helpful it will be to refer to those.

Finally, the use of managed pointers is pretty viral.  This "simple"
change resulted in about 2200 lines of code being touched.

8 years agoConvert pointers to std::auto_ptr<> in SongPrivate.
Gabriel M. Beddingfield [Sat, 19 Dec 2009 04:25:28 +0000 (22:25 -0600)]
Convert pointers to std::auto_ptr<> in SongPrivate.

8 years agoTweak Song tests and also initialize some Song objects.
Gabriel M. Beddingfield [Sat, 19 Dec 2009 04:03:59 +0000 (22:03 -0600)]
Tweak Song tests and also initialize some Song objects.

8 years agoTweak t_Song for how I /want/ Song to behave.
Gabriel M. Beddingfield [Sat, 19 Dec 2009 03:08:12 +0000 (21:08 -0600)]
Tweak t_Song for how I /want/ Song to behave.

8 years agoCommit a bunch of tests for Tritium::Song (fails).
Gabriel M. Beddingfield [Fri, 18 Dec 2009 18:51:29 +0000 (12:51 -0600)]
Commit a bunch of tests for Tritium::Song (fails).

8 years agoRename t_songhelpers.cpp to t_Song.cpp.
Gabriel M. Beddingfield [Fri, 18 Dec 2009 03:17:22 +0000 (21:17 -0600)]
Rename t_songhelpers.cpp to t_Song.cpp.

The 'songhelpers' methods have been merged into the Song class.

8 years agoChange namespace for t_TestTemplate.cpp
Gabriel M. Beddingfield [Tue, 15 Dec 2009 12:59:33 +0000 (06:59 -0600)]
Change namespace for t_TestTemplate.cpp

8 years agoAdd complete tests for Tritium::Sample.
Gabriel M. Beddingfield [Mon, 14 Dec 2009 14:47:30 +0000 (08:47 -0600)]
Add complete tests for Tritium::Sample.

8 years agoAdd samplerate parameter to Tritium::Sample constructor.
Gabriel M. Beddingfield [Sun, 13 Dec 2009 21:36:59 +0000 (15:36 -0600)]
Add samplerate parameter to Tritium::Sample constructor.

When FLAC files are loaded, they are loaded with the default sample
rate (44,100 Hz) because Tritium::Sample does not expose any way to
set the sample rate.  This adds a parameter to the constructor.