Cleanup and fixed implementation of clone and render sources.

This commit is contained in:
brunoherbelin
2020-05-23 11:29:27 +02:00
parent 0eb31c7adc
commit 781023a93d
14 changed files with 477 additions and 152 deletions

View File

@@ -196,7 +196,7 @@ void Mixer::createSourceFile(std::string path)
}
else {
// (try to) create media source by default
MediaSource *ms = new MediaSource();
MediaSource *ms = new MediaSource;
ms->setPath(path);
s = ms;
}
@@ -224,6 +224,22 @@ void Mixer::createSourceRender()
insertSource(s);
}
void Mixer::createSourceClone(std::string namesource)
{
SourceList::iterator origin = session_->find(namesource);
if (origin != session_->end()) {
// create a source
CloneSource *s = (*origin)->clone();
// get new name
renameSource(s, (*origin)->name());
// add to mixer
insertSource(s);
}
}
void Mixer::insertSource(Source *s)
{
// Add source to Session and set it as current