resonance 1.0.1
Loading...
Searching...
No Matches
Sch Namespace Reference

Scheduling of timed commands. More...

Classes

class  Playbacker
 Replay of a recorded command stream that Sch::Scheduler::StartPlayback() installs. More...
class  Recorder
 Recording of every command the scheduler queues, installed by Sch::Scheduler::BeginRecording(). More...
class  Scheduler
 Scheduler that runs queued commands when their due time arrives. More...
class  SystemTime
 Clock the scheduler reads its due times from, in nanoseconds. More...
class  TimeClock
 Time base a scheduler measures its due times against, and the base class of Sch::TickClock. More...
class  Tick
 Song position in MIDI ticks, printed as measure, beat, and tick. More...
class  CmdID
 Handle that identifies one batch of commands the scheduler has queued. More...
class  Command
 Base of every action the scheduler performs on behalf of another subsystem. More...
class  CommandFactory
 Registrar that adds one command class to the factory list Command::NewCommand() searches. More...
class  TempoMap
 Affine map between a song position in MIDI ticks and scheduler time in nanoseconds. More...
class  TickClock
 Pausable view of scheduler time, together with the tempo that maps it to a song position. More...
class  Time
 Scheduler time, as a signed 64-bit count. More...
class  TimedCommand
 One queued command, together with the time the scheduler is to run it at. More...

Typedefs

typedef Command *(* CommandFactoryProc) ()
 Produces one command of a registered class.

Functions

OBStream & operator<< (OBStream &stream, Command *pCommand)
 Write a command through the stream, preceded by a presence byte.
IBStream & operator>> (IBStream &stream, Command *&pCommand)
 Read a command back through the stream and construct it from the factory list.
OBStream & operator<< (OBStream &stream, Command &command)
 Write a command that is known to exist through the stream, preceded by a presence byte.
IBStream & operator>> (IBStream &stream, Command &command)
 Read a command's payload back into an existing command.

Detailed Description

Scheduling of timed commands.

The scheduler, its clocks, the recorder and play-back of command streams, and the time and song-position types they use.

Typedef Documentation

◆ CommandFactoryProc

typedef Command *(* Sch::CommandFactoryProc) ()

Produces one command of a registered class.

Function Documentation

◆ operator<<() [1/2]

OBStream & Sch::operator<< ( OBStream & stream,
Command * pCommand )

Write a command through the stream, preceded by a presence byte.

A null command produces the single byte 0. A command whose CmdID() is zero is reported through Print() and Fatal(). Any other command produces the byte 1, then its identifier as four bytes, then its own payload.

Parameters
streamThe stream to write to.
pCommandThe command to write, or null.
Returns
The stream, allowing calls to be chained.
Ghidra address:
NTSC-U/C: 0x005384d0
Ghidra address:
PAL: 0x00577d90

◆ operator>>() [1/2]

IBStream & Sch::operator>> ( IBStream & stream,
Command *& pCommand )

Read a command back through the stream and construct it from the factory list.

The presence byte 0, and an end of data before it arrives, both produce a null result. Any byte other than 0 or 1 is reported through Fatal().

Parameters
streamThe stream to read from.
pCommandReceives the new command, or null.
Returns
The stream, allowing calls to be chained.
Ghidra address:
NTSC-U/C: 0x005385f0
Ghidra address:
PAL: 0x00577eb0

◆ operator<<() [2/2]

OBStream & Sch::operator<< ( OBStream & stream,
Command & command )

Write a command that is known to exist through the stream, preceded by a presence byte.

The same layout as the pointer overload. A command whose CmdID() is zero produces the single byte 0 here rather than a fatal report. The shipped program does not call it.

Parameters
streamThe stream to write to.
commandThe command to write.
Returns
The stream, allowing calls to be chained.
Ghidra address:
NTSC-U/C: 0x005382e8
Ghidra address:
PAL: 0x00577ba8

◆ operator>>() [2/2]

IBStream & Sch::operator>> ( IBStream & stream,
Command & command )

Read a command's payload back into an existing command.

The presence byte and the identifier are read together. A presence byte other than 1 and an identifier other than the command's own CmdID() are each reported through Fatal(). The shipped program does not call it.

Parameters
streamThe stream to read from.
commandThe command to fill.
Returns
The stream, allowing calls to be chained.
Ghidra address:
NTSC-U/C: 0x005383d8
Ghidra address:
PAL: 0x00577c98