summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-10-06 13:10:00 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-10-06 13:10:00 +0200
commit88a906395ba7d33ae563e70d8b94c855e3b5a573 (patch)
treeb0fa632b4c59d276b292407f79ee07aa9ef8dab8 /src/drumgizmo.cc
parent5727436afe5a8b1b60d99863cfc939ee50d4c17e (diff)
Refactoring of AudioFile loading and message passing from engine to gui and vice versa.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index b99687d..c4ef194 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -43,21 +43,13 @@
DrumGizmo::DrumGizmo(AudioOutputEngine *o, AudioInputEngine *i)
: MessageReceiver(MSGRCV_ENGINE),
- loader(this), oe(o), ie(i)
+ loader(), oe(o), ie(i)
{
- loader.run(); // Start drumkit loader thread.
}
DrumGizmo::~DrumGizmo()
{
- /*
- AudioFiles::iterator i = audiofiles.begin();
- while(i != audiofiles.end()) {
- AudioFile *audiofile = i->second;
- delete audiofile;
- i++;
- }
- */
+ DEBUG(drumgizmo, "!");
loader.stop();
}
@@ -75,8 +67,10 @@ bool DrumGizmo::loadkit(std::string file)
DEBUG(drumgizmo, "loadkit(%s)\n", kitfile.c_str());
+ // Remove all queue AudioFiles from loader before we actually delete them.
loader.skip();
+ // Delete all Channels, Instruments, Samples and AudioFiles.
kit.clear();
DrumKitParser parser(kitfile, kit);
@@ -94,16 +88,7 @@ bool DrumGizmo::loadkit(std::string file)
bool DrumGizmo::init(bool preload)
{
- if(preload) {
- /*
- AudioFiles::iterator i = audiofiles.begin();
- while(i != audiofiles.end()) {
- AudioFile *audiofile = i->second;
- audiofile->load();
- i++;
- }
- */
- }
+ (void)preload;
if(!ie->init(kit.instruments)) return false;
if(!oe->init(kit.channels)) return false;