Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
Ase::ClipImpl::Generator Class Reference

Generator for MIDI events. More...

#include "clip.hh"

Public Types

using Receiver = std::function< void(int64 tick, MidiEvent &event)>
 Handler for generated MIDI events.
 

Public Member Functions

void setup (const ClipImpl &clip)
 Create generator from clip.
 
void jumpto (int64 target_tick)
 Assign new play_position() (and clip_position()), preserves all other state.
 
int64 generate (int64 target_tick, const Receiver &receiver)
 Advance tick and call receiver for generated events.
 
bool muted () const
 Mute MIDI note generation.
 
void muted (bool b)
 Assign muted state.
 
int64 start_offset () const
 Initial offset in ticks.
 
int64 loop_start () const
 Loop start in ticks.
 
int64 loop_end () const
 Loop end in ticks.
 
int64 play_length () const
 Maximum amount of ticks during playback.
 
int64 play_position () const
 Current playback position in ticks.
 
bool done () const
 Check if playback is done.
 
int64 clip_position () const
 Position within clip as tick.
 

Friends

class ClipImpl
 

Detailed Description

Generator for MIDI events.

Definition at line 64 of file clip.hh.

Member Typedef Documentation

◆ Receiver

Handler for generated MIDI events.

Definition at line 77 of file clip.hh.

Member Function Documentation

◆ clip_position()

int64 Ase::ClipImpl::Generator::clip_position ( ) const

Position within clip as tick.

Definition at line 99 of file clip.hh.

◆ done()

bool Ase::ClipImpl::Generator::done ( ) const

Check if playback is done.

Definition at line 97 of file clip.hh.

References play_length(), and play_position().

◆ generate()

int64 Ase::ClipImpl::Generator::generate ( int64  target_tick,
const Receiver receiver 
)

Advance tick and call receiver for generated events.

Definition at line 360 of file clip.cc.

References std::min(), return_unless, Ase::ClipNote::tick, and Ase::MidiEvent::type.

◆ jumpto()

void Ase::ClipImpl::Generator::jumpto ( int64  target_tick)

Assign new play_position() (and clip_position()), preserves all other state.

Definition at line 321 of file clip.cc.

References std::min(), and return_unless.

◆ loop_end()

int64 Ase::ClipImpl::Generator::loop_end ( ) const

Loop end in ticks.

Definition at line 91 of file clip.hh.

◆ loop_start()

int64 Ase::ClipImpl::Generator::loop_start ( ) const

Loop start in ticks.

Definition at line 89 of file clip.hh.

◆ muted() [1/2]

bool Ase::ClipImpl::Generator::muted ( ) const

Mute MIDI note generation.

Definition at line 83 of file clip.hh.

◆ muted() [2/2]

void Ase::ClipImpl::Generator::muted ( bool  b)

Assign muted state.

Definition at line 85 of file clip.hh.

◆ play_length()

int64 Ase::ClipImpl::Generator::play_length ( ) const

Maximum amount of ticks during playback.

Definition at line 93 of file clip.hh.

Referenced by done().

◆ play_position()

int64 Ase::ClipImpl::Generator::play_position ( ) const

Current playback position in ticks.

Definition at line 95 of file clip.hh.

Referenced by done().

◆ setup()

void Ase::ClipImpl::Generator::setup ( const ClipImpl clip)

Create generator from clip.

Definition at line 302 of file clip.cc.

References Ase::ClipImpl::tick_events().

◆ start_offset()

int64 Ase::ClipImpl::Generator::start_offset ( ) const

Initial offset in ticks.

Definition at line 87 of file clip.hh.

Friends And Related Symbol Documentation

◆ ClipImpl

friend class ClipImpl
friend

Definition at line 74 of file clip.hh.


The documentation for this class was generated from the following files: