Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions include/element/audioengine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class AudioEngine final : public juce::ReferenceCountedObject {
bool addGraph (RootGraph* graph);
bool removeGraph (RootGraph* graph);

void setCurrentGraph (const int index) { setActiveGraph (index); }
void setActiveGraph (const int index);
int getActiveGraph() const;
void setActiveGraphIndex (const int index);
int getActiveGraphIndex() const;

RootGraph* getGraph (const int index);

Expand Down
1 change: 0 additions & 1 deletion include/element/session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Session : public Model,

inline int getNumGraphs() const { return objectData.getChildWithName (tags::graphs).getNumChildren(); }
inline Node getGraph (const int index) const { return Node (getGraphValueTree (index), false); }
Node getCurrentGraph() const { return getActiveGraph(); }
Node getActiveGraph() const;
int getActiveGraphIndex() const;

Expand Down
281 changes: 135 additions & 146 deletions src/engine/audioengine.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void Services::run()
if (auto* gui = find<GuiService>())
{
gui->stabilizeContent();
const Node graph (session->getCurrentGraph());
const Node graph (session->getActiveGraph());
auto* const window = gui->getMainWindow();

// don't show plugin windows on load if the UI is hidden
Expand Down
10 changes: 5 additions & 5 deletions src/services/engineservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class EngineService::RootGraphs
auto engine = owner.context().audio();
if (! engine)
return 0;
const int currentIndex = engine->getActiveGraph();
const int currentIndex = engine->getActiveGraphIndex();
if (currentIndex >= 0)
for (auto* h : graphs)
if (auto* root = h->getRootGraph())
Expand Down Expand Up @@ -313,7 +313,7 @@ EngineService::~EngineService()
void EngineService::addConnection (const uint32 s, const uint32 sp, const uint32 d, const uint32 dp)
{
if (auto session = context().session())
if (auto* h = graphs->findFor (session->getCurrentGraph()))
if (auto* h = graphs->findFor (session->getActiveGraph()))
if (auto* c = h->getController())
c->addConnection (s, sp, d, dp);
}
Expand Down Expand Up @@ -403,7 +403,7 @@ void EngineService::duplicateGraph()
auto& world = context();
auto engine = world.audio();
auto session = world.session();
const Node current (session->getCurrentGraph());
const Node current (session->getActiveGraph());
duplicateGraph (current);
}

Expand Down Expand Up @@ -451,7 +451,7 @@ void EngineService::removeGraph (int index)
index = session->getNumGraphs() - 1;

sgraphs.setProperty (tags::active, index, 0);
const Node nextGraph = session->getCurrentGraph();
const Node nextGraph = session->getActiveGraph();

if (nextGraph.isRootGraph())
{
Expand Down Expand Up @@ -846,7 +846,7 @@ void EngineService::setRootNode (const Node& newRootNode)
r->setNodeModel (newRootNode);
}

engine->setCurrentGraph (index);
engine->setActiveGraphIndex (index);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/services/guiservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void GuiService::ForegroundCheck::timerCallback()
if (foreground)
{
if (session)
ui.showPluginWindowsFor (session->getCurrentGraph(), true, false);
ui.showPluginWindowsFor (session->getActiveGraph(), true, false);
ui.getMainWindow()->toFront (true);
}
else if (! foreground)
Expand Down Expand Up @@ -1084,7 +1084,7 @@ bool GuiService::perform (const InvocationInfo& info)
}
case Commands::exportGraph: {
auto session = context().session();
auto node = session->getCurrentGraph();
auto node = session->getActiveGraph();
node.savePluginState();

if (! impl->lastExportedGraph.isDirectory())
Expand Down
2 changes: 1 addition & 1 deletion src/ui/connectiongrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,6 @@ void ConnectionGrid::itemDropped (const SourceDetails& sd)
void ConnectionGrid::didBecomeActive()
{
auto session = ViewHelpers::findContentComponent (this)->session();
setNode (session->getCurrentGraph());
setNode (session->getActiveGraph());
}
} // namespace element
2 changes: 1 addition & 1 deletion src/ui/content.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ Content::Content (Context& ctx)
toolBarVisible = true;
toolBarSize = 32;

const Node node (context().session()->getCurrentGraph());
const Node node (context().session()->getActiveGraph());
setCurrentNode (node);

resized();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/grapheditorview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void GraphEditorView::stabilizeContent()
if (! getGraph().isValid() || ! getGraph().isGraph())
{
if (auto session = ViewHelpers::getSession (this))
setNode (session->getCurrentGraph());
setNode (session->getActiveGraph());
}

const auto g = getGraph();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/graphsettingsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ void GraphSettingsView::stabilizeContent()
auto& ui = *srvc.find<UI>();

if (! props->node().isValid())
props->setNode (world->session()->getCurrentGraph());
props->setNode (world->session()->getActiveGraph());

if (! props->node().isValid())
props->setNode (detail::findGraph (ui.getSelectedNode()));
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void MainWindow::nameChangedSession()
}

auto sessionName = session->getName().trim();
auto graphName = session->getCurrentGraph().getName().trim();
auto graphName = session->getActiveGraph().getName().trim();
if (sessionName.isEmpty())
{
const auto file = controller->getSessionFile();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/sessiontreepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class SessionRootGraphTreeItem : public SessionGraphTreeItem

void activateGraph()
{
const bool nodeIsCurrent = node == session()->getCurrentGraph();
const bool nodeIsCurrent = node == session()->getActiveGraph();
if (nodeIsCurrent)
return;

Expand Down