Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
graph.h
1// SPDX-FileCopyrightText: © 2019-2021, 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/graph_node.h"
7
8namespace zrythm::dsp::graph
9{
10
19class Graph final
20{
21 friend class GraphExport;
22
23public:
24 void print () const;
25
34
35 GraphNode * add_initial_processor ()
36 {
37 setup_nodes_.initial_processor_ = std::make_unique<InitialProcessor> ();
38 return add_node_for_processable (*setup_nodes_.initial_processor_);
39 };
40
46 bool is_valid () const;
47
53 auto &&steal_nodes () { return std::move (setup_nodes_); }
54
55 auto &get_nodes () { return setup_nodes_; }
56
57 auto &get_nodes () const { return setup_nodes_; }
58
59 void finalize_nodes () { setup_nodes_.finalize_nodes (); }
60
61private:
69 GraphNodeCollection setup_nodes_;
70};
71
72} // namespace zrythm::dsp::graph
void finalize_nodes()
Sets the initial/terminal nodes.
Definition graph_node.h:322
Represents a node in a DSP graph.
Definition graph_node.h:129
The Graph class represents a graph of DSP nodes.
Definition graph.h:20
GraphNode * add_node_for_processable(IProcessable &node)
Creates a new node, adds it to the graph and returns it.
bool is_valid() const
Checks for cycles in the graph.
auto && steal_nodes()
Steals the nodes in the graph.
Definition graph.h:53
Interface for objects that can be processed in the DSP graph.
Definition graph_node.h:53