`node.release()`

portability/boost
zetaPRIME 2019-06-18 00:50:44 -04:00
parent 19bdb728a1
commit 8824df9efc
5 changed files with 6 additions and 2 deletions

2
notes
View File

@ -39,7 +39,7 @@ TODO {
- add standardized step values for knobs and set a default (int enum)
global pan (PXX) for InstrumentCore?
node function to release unneeded old data when stopping playback
- node function to release unneeded old data when stopping playback
...
}

View File

@ -141,6 +141,7 @@ void AudioEngine::play(std::shared_ptr<Project> p) {
void AudioEngine::stop() {
QMetaObject::invokeMethod(this, [this] {
if (project) project->rootGraph->release();
project = nullptr;
queueValid = false;
queue.clear();

View File

@ -37,6 +37,7 @@ Graph::Graph() {
// propagate
void Graph::reset() { for (auto c : children) c->reset(); }
void Graph::release() { for (auto c : children) c->release(); }
void Graph::saveData(QCborMap& m) const {
// graph properties

View File

@ -14,6 +14,7 @@ namespace Xybrid::Data {
int viewX{}, viewY{};
void reset() override;
void release() override;
void saveData(QCborMap&) const override;
void loadData(const QCborMap&) override;

View File

@ -119,7 +119,8 @@ namespace Xybrid::Data {
bool dependsOn(std::shared_ptr<Node>);
virtual void init() { }
virtual void reset() { }
virtual void reset() { } // called on starting playback to prepare for operation
virtual void release() { } // called on stop to release any resources that may be hanging
virtual void process() { }
virtual void saveData(QCborMap&) const { }
virtual void loadData(const QCborMap&) { }