mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
Piano+LibDSP: Move Track to LibDSP
This is a tangly commit and it fixes all the bugs that a plain move would have caused (i.e. we need to touch other logic which had wrong assumptions).
This commit is contained in:
parent
125122a9ab
commit
4941cffdd0
29 changed files with 322 additions and 413 deletions
|
@ -79,7 +79,7 @@ public:
|
|||
void set_value(ParameterT value)
|
||||
{
|
||||
set_value_sneaky(value, DSP::Detail::ProcessorParameterSetValueTag {});
|
||||
if (did_change_value)
|
||||
for (auto const& did_change_value : m_change_value_listeners)
|
||||
did_change_value(value);
|
||||
}
|
||||
|
||||
|
@ -90,10 +90,15 @@ public:
|
|||
m_value = value;
|
||||
}
|
||||
|
||||
Function<void(ParameterT const&)> did_change_value;
|
||||
// FIXME: Devise a good API for unregistering listeners.
|
||||
void register_change_listener(Function<void(ParameterT const&)> listener)
|
||||
{
|
||||
m_change_value_listeners.append(move(listener));
|
||||
}
|
||||
|
||||
protected:
|
||||
ParameterT m_value;
|
||||
Vector<Function<void(ParameterT const&)>> m_change_value_listeners;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue