mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Cleanup and fixed implementation of clone and render sources.
This commit is contained in:
18
Mixer.cpp
18
Mixer.cpp
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user