summaryrefslogtreecommitdiff
path: root/src/drumkitloader.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-05-22 16:44:11 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-05-22 16:44:11 +0200
commit624d25b8c3e9bd1648fdadbe28e1859cecab494f (patch)
treeac2331735a1e87e1fd5b49b3849542b0862b4453 /src/drumkitloader.h
parent07415bae4e84a4c9316249f14c26c695c5dcadaa (diff)
Explicitly stop the loader thread to ensure we don't delete the DrumGizmo::drumkit member while the loader is attached to it.
Diffstat (limited to 'src/drumkitloader.h')
-rw-r--r--src/drumkitloader.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/drumkitloader.h b/src/drumkitloader.h
index cca11af..9608e14 100644
--- a/src/drumkitloader.h
+++ b/src/drumkitloader.h
@@ -49,15 +49,18 @@ class DrumKitLoader
: public Thread
{
public:
- //! The constrcutor starts the loader thread.
DrumKitLoader(Settings& settings, DrumKit& kit, AudioInputEngine& ie,
Resamplers& resamplers, Random& rand);
- //! The destructor signals the thread to stop and waits to merge before
- //! returning (ie. deleting the object will garantuee that the thread has
- //! been stopped).
~DrumKitLoader();
+ //! Starts the loader thread.
+ void init();
+
+ //! Signal the loader thread to stop and waits for the threads to merge
+ //! before returning.
+ void deinit();
+
bool loadkit(const std::string& file);
//! Signal the loader to start loading all audio files contained in the kit.
@@ -65,9 +68,6 @@ public:
//! scheduled.
void loadKit(DrumKit *kit);
- //! Signal the loader to stop and wait until it has.
- void stop();
-
//! Skip all queued AudioFiles.
void skip();