subgraph view previews subgraph input

portability/boost
zetaPRIME 2019-06-30 15:52:56 -04:00
parent c726d53687
commit 0ab25999cb
2 changed files with 7 additions and 4 deletions

View File

@ -377,8 +377,9 @@ void AudioEngine::nextTick() {
// send previewing commands
auto pnode = previewNode;
if (!pnode) pnode = project->rootGraph.get();
if (auto p = std::static_pointer_cast<CommandPort>(pnode->port(Port::Input, Port::Command, previewPort_)); p) {
uint8_t pport = 0;
if (!pnode) { pnode = project->rootGraph.get(); pport = previewPort_; }
if (auto p = std::static_pointer_cast<CommandPort>(pnode->port(Port::Input, Port::Command, pport)); p) {
p->push(buf);
}
buf.clear();

View File

@ -185,15 +185,17 @@ void PatchboardScene::keyReleaseEvent(QKeyEvent* e) {
void PatchboardScene::startPreview(int key, int16_t note) {
stopPreview(key); // end current preview first, if applicable
auto p = graph->project->shared_from_this();
previewKey[key] = {audioEngine->previewPort(), audioEngine->preview(p, -1, note)};
bool subgraph = true && graph->parent.lock();
previewKey[key] = {audioEngine->previewPort(), audioEngine->preview(p, -1, note, 0, subgraph ? graph.get() : nullptr)};
}
void PatchboardScene::stopPreview(int key) {
if (auto k = previewKey.find(key); k != previewKey.end()) {
auto p = graph->project->shared_from_this();
bool subgraph = true && graph->parent.lock();
//audioEngine->preview(p, k->second[0], k->second[1], false);
audioEngine->preview(p, k->second.first, -2, k->second.second);
audioEngine->preview(p, k->second.first, -2, k->second.second, subgraph ? graph.get() : nullptr);
previewKey.erase(k);
}
}