From 8573e9976e52b961d44332313878107f46ddde2c Mon Sep 17 00:00:00 2001 From: Roy Macdonald Date: Sun, 12 Nov 2023 20:20:03 +0400 Subject: [PATCH] Added clear function to multiplayer --- src/ofxSoundMultiplexer.cpp | 7 +++++++ src/ofxSoundMultiplexer.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ofxSoundMultiplexer.cpp b/src/ofxSoundMultiplexer.cpp index 3708d79..d9f0205 100644 --- a/src/ofxSoundMultiplexer.cpp +++ b/src/ofxSoundMultiplexer.cpp @@ -31,6 +31,13 @@ ofxSoundObject& ofxSoundBaseMultiplexer::getOrCreateChannelGroup(const std::vect channelsMap.emplace(group, ofxSoundObject(OFX_SOUND_OBJECT_PROCESSOR)); return channelsMap[group]; } + +//-------------------------------------------------------------- +void ofxSoundBaseMultiplexer::clear(){ + channelsMap.clear(); + channelsSet.clear(); +} + //-------------------------------------------------------------- bool ofxSoundBaseMultiplexer::deleteChannelGroup(const std::vector& group){ for(auto& g: group){ diff --git a/src/ofxSoundMultiplexer.h b/src/ofxSoundMultiplexer.h index ae88f84..da3adf0 100644 --- a/src/ofxSoundMultiplexer.h +++ b/src/ofxSoundMultiplexer.h @@ -27,7 +27,10 @@ class ofxSoundBaseMultiplexer{ bool deleteChannelGroup(const std::vector& group); bool deleteChannel(int chan); - + + ///\brief will clear all channels + void clear(); + std::map < std::vector, ofxSoundObject>& getChannelGroups(); const std::map < std::vector, ofxSoundObject>& getChannelGroups() const ;