resonance 1.0.1
Loading...
Searching...
No Matches
activefilter.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/mem.h"
4#include "sch/cmdid.h"
5#include "sch/time.h"
6
7class FilterLover;
8
9namespace Sch {
10class Command;
11class TickClock;
12} // namespace Sch
13
28private:
29 float mTarget;
30 // The share of the previous value each step keeps.
31 float mRetention;
32 float mValue;
33 FilterLover *mLover;
34 Sch::TickClock *mClock;
35 // The handle the command is queued under.
36 Sch::CmdID mCommand;
37 // The file-local command, created by the first SetTarget().
38 Sch::Command *mStepCommand;
39
40public:
52
64
70 static void operator delete(void *pBlock) {
71 OperatorDeleteOverride(pBlock, "ActiveFilter");
72 }
73
84 void SetTarget(float flTarget);
85
96 void Update();
97
105};
~ActiveFilter()
Withdraw the pending step and release the command.
void Update()
Take one step, report it, and post the next.
ActiveFilter(Sch::TickClock *pClock, FilterLover *pLover)
Prepare an idle filter.
void SetTarget(float flTarget)
Set the value to move towards, starting the steps on the first call.
Sch::Time mInterval
Time between steps, in nanoseconds.
Definition activefilter.h:104
Receiver of the values an ActiveFilter produces.
Definition filterlover.h:10
Handle that identifies one batch of commands the scheduler has queued.
Definition cmdid.h:35
Base of every action the scheduler performs on behalf of another subsystem.
Definition command.h:60
Pausable view of scheduler time, together with the tempo that maps it to a song position.
Definition tickclock.h:40
Scheduler time, as a signed 64-bit count.
Definition time.h:44
void OperatorDeleteOverride(void *pBlock, const char *pszClass)
Release a block that AllocateTaggedMemory() handed out.
Scheduling of timed commands.
Definition activefilter.h:9