| 1721 | } |
| 1722 | |
| 1723 | DspNetwork::SelectionUpdater::SelectionUpdater(DspNetwork& parent_) : |
| 1724 | parent(parent_) |
| 1725 | { |
| 1726 | WeakReference<DspNetwork> weakParent = &parent; |
| 1727 | |
| 1728 | auto f = [weakParent, this]() |
| 1729 | { |
| 1730 | if (weakParent != nullptr) |
| 1731 | weakParent.get()->selection.addChangeListener(this); |
| 1732 | }; |
| 1733 | |
| 1734 | MessageManager::callAsync(f); |
| 1735 | |
| 1736 | #if 0 |
| 1737 | deleteChecker.setCallback(parent.data, valuetree::AsyncMode::Asynchronously, |
| 1738 | [this](ValueTree v, bool wasAdded) |
| 1739 | { |
| 1740 | if (!wasAdded) |
| 1741 | { |
| 1742 | if (auto nodeThatWasRemoved = parent.getNodeForValueTree(v)) |
| 1743 | { |
| 1744 | parent.deselect(nodeThatWasRemoved); |
| 1745 | } |
| 1746 | } |
| 1747 | }); |
| 1748 | |
| 1749 | deleteChecker.setTypeToWatch(PropertyIds::Nodes); |
| 1750 | #endif |
| 1751 | } |
| 1752 | |
| 1753 | DspNetwork::SelectionUpdater::~SelectionUpdater() |
| 1754 | { |
nothing calls this directly
no test coverage detected