mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-09 05:27:57 +00:00
New code style refactor
This commit is contained in:
@@ -1,40 +1,34 @@
|
||||
#include "amuse/Studio.hpp"
|
||||
#include "amuse/Engine.hpp"
|
||||
|
||||
namespace amuse
|
||||
{
|
||||
namespace amuse {
|
||||
|
||||
#ifndef NDEBUG
|
||||
bool Studio::_cyclicCheck(Studio* leaf)
|
||||
{
|
||||
for (auto it = m_studiosOut.begin(); it != m_studiosOut.end();)
|
||||
{
|
||||
if (leaf == it->m_targetStudio.get() || it->m_targetStudio->_cyclicCheck(leaf))
|
||||
return true;
|
||||
++it;
|
||||
}
|
||||
return false;
|
||||
bool Studio::_cyclicCheck(Studio* leaf) {
|
||||
for (auto it = m_studiosOut.begin(); it != m_studiosOut.end();) {
|
||||
if (leaf == it->m_targetStudio.get() || it->m_targetStudio->_cyclicCheck(leaf))
|
||||
return true;
|
||||
++it;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
Studio::Studio(Engine& engine, bool mainOut) : m_engine(engine), m_master(engine), m_auxA(engine), m_auxB(engine)
|
||||
{
|
||||
if (mainOut && engine.m_defaultStudioReady)
|
||||
addStudioSend(engine.getDefaultStudio(), 1.f, 1.f, 1.f);
|
||||
Studio::Studio(Engine& engine, bool mainOut) : m_engine(engine), m_master(engine), m_auxA(engine), m_auxB(engine) {
|
||||
if (mainOut && engine.m_defaultStudioReady)
|
||||
addStudioSend(engine.getDefaultStudio(), 1.f, 1.f, 1.f);
|
||||
}
|
||||
|
||||
void Studio::addStudioSend(ObjToken<Studio> studio, float dry, float auxA, float auxB)
|
||||
{
|
||||
m_studiosOut.emplace_back(studio, dry, auxA, auxB);
|
||||
void Studio::addStudioSend(ObjToken<Studio> studio, float dry, float auxA, float auxB) {
|
||||
m_studiosOut.emplace_back(studio, dry, auxA, auxB);
|
||||
|
||||
/* Cyclic check */
|
||||
assert(!_cyclicCheck(this));
|
||||
/* Cyclic check */
|
||||
assert(!_cyclicCheck(this));
|
||||
}
|
||||
|
||||
void Studio::resetOutputSampleRate(double sampleRate)
|
||||
{
|
||||
m_master.resetOutputSampleRate(sampleRate);
|
||||
m_auxA.resetOutputSampleRate(sampleRate);
|
||||
m_auxB.resetOutputSampleRate(sampleRate);
|
||||
}
|
||||
void Studio::resetOutputSampleRate(double sampleRate) {
|
||||
m_master.resetOutputSampleRate(sampleRate);
|
||||
m_auxA.resetOutputSampleRate(sampleRate);
|
||||
m_auxB.resetOutputSampleRate(sampleRate);
|
||||
}
|
||||
} // namespace amuse
|
||||
|
||||
Reference in New Issue
Block a user