Skip to content

Commit

Permalink
Added clear function to multiplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
roymacdonald committed Nov 12, 2023
1 parent dd5f422 commit 8573e99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/ofxSoundMultiplexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>& group){
for(auto& g: group){
Expand Down
5 changes: 4 additions & 1 deletion src/ofxSoundMultiplexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class ofxSoundBaseMultiplexer{

bool deleteChannelGroup(const std::vector<int>& group);
bool deleteChannel(int chan);


///\brief will clear all channels
void clear();

std::map < std::vector<int>, ofxSoundObject>& getChannelGroups();

const std::map < std::vector<int>, ofxSoundObject>& getChannelGroups() const ;
Expand Down

0 comments on commit 8573e99

Please sign in to comment.