Ardour  9.0-pre0-386-g96ef4d20f2
ARDOUR::AudioTrigger Class Reference

#include <triggerbox.h>

Inheritance diagram for ARDOUR::AudioTrigger:
[legend]

Classes

struct  AudioData
 

Public Member Functions

 AudioTrigger (uint32_t index, TriggerBox &)
 
 ~AudioTrigger ()
 
template<bool actually_run>
pframes_t audio_run (BufferSet &bufs, samplepos_t start_sample, samplepos_t end_sample, Temporal::Beats const &start, Temporal::Beats const &end, pframes_t nframes, pframes_t dest_offset, double bpm, pframes_t &quantize_offset)
 
pframes_t run (BufferSet &bufs, samplepos_t start_sample, samplepos_t end_sample, Temporal::Beats const &start, Temporal::Beats const &end, pframes_t nframes, pframes_t dest_offset, double bpm, pframes_t &quantize_offset)
 
bool playable () const
 
StretchMode stretch_mode () const
 
void set_stretch_mode (StretchMode)
 
double segment_tempo () const
 
void set_segment_tempo (double t)
 
double segment_beatcnt ()
 
void set_segment_beatcnt (double count)
 
void set_start (timepos_t const &)
 
void set_end (timepos_t const &)
 
void set_legato_offset (timepos_t const &)
 
void set_length (timecnt_t const &)
 
timepos_t start_offset () const
 
timepos_t current_length () const
 
timepos_t natural_length () const
 
void reload (BufferSet &, void *)
 
void io_change ()
 
bool probably_oneshot () const
 
void captured (SlotArmInfo &, BufferSet &)
 
int set_region_in_worker_thread (std::shared_ptr< Region >)
 
int set_region_in_worker_thread_from_capture (std::shared_ptr< Region >)
 
void jump_start ()
 
void jump_stop (BufferSet &bufs, pframes_t dest_offset)
 
XMLNodeget_state () const
 
int set_state (const XMLNode &, int version)
 
RubberBand::RubberBandStretcher * stretcher ()
 
SegmentDescriptor get_segment_descriptor () const
 
timepos_t compute_end (Temporal::TempoMap::SharedPtr const &, Temporal::BBT_Time const &, samplepos_t, Temporal::Beats &)
 
void start_and_roll_to (samplepos_t start, samplepos_t position, uint32_t cnt)
 
bool stretching () const
 
uint32_t channels () const
 
RubberBand::RubberBandStretcher * alloc_stretcher () const
 
Sample const * audio_data (size_t n) const
 
size_t data_length () const
 
- Public Member Functions inherited from ARDOUR::Trigger
 Trigger (uint32_t index, TriggerBox &)
 
virtual ~Trigger ()
 
void set_launch_style (LaunchStyle)
 
LaunchStyle launch_style () const
 
void set_follow_action0 (FollowAction const &)
 
FollowAction follow_action0 () const
 
void set_follow_action1 (FollowAction const &)
 
FollowAction follow_action1 () const
 
void set_follow_action_probability (int)
 
int follow_action_probability () const
 
void set_follow_count (uint32_t)
 
uint32_t follow_count () const
 
void set_quantization (Temporal::BBT_Offset const &)
 
Temporal::BBT_Offset quantization () const
 
void set_follow_length (Temporal::BBT_Offset const &)
 
Temporal::BBT_Offset follow_length () const
 
void set_use_follow_length (bool)
 
bool use_follow_length () const
 
void set_legato (bool)
 
bool legato () const
 
void set_velocity_effect (float)
 
float velocity_effect () const
 
void set_stretchable (bool)
 
bool stretchable () const
 
void set_cue_isolated (bool)
 
bool cue_isolated () const
 
void set_allow_patch_changes (bool)
 
bool allow_patch_changes () const
 
void set_gain (gain_t)
 
gain_t gain () const
 
void set_stretch_mode (StretchMode)
 
StretchMode stretch_mode () const
 
void set_color (color_t)
 
color_t color () const
 
void set_name (std::string const &)
 
std::string name () const
 
void bang (float velocity=1.0f)
 
void unbang ()
 
void request_stop ()
 
void stop_quantized ()
 
virtual void tempo_map_changed ()
 
timepos_t current_pos () const
 
double position_as_fraction () const
 
virtual void arm ()
 
virtual void disarm ()
 
bool armed () const
 
Temporal::BBT_Argument compute_start (Temporal::TempoMap::SharedPtr const &, samplepos_t start, samplepos_t end, Temporal::BBT_Offset const &q, samplepos_t &start_samples, bool &will_start)
 
bool will_not_follow () const
 
bool will_follow () const
 
bool cue_launched () const
 
void process_state_requests (BufferSet &bufs, pframes_t dest_offset)
 
bool active () const
 
State state () const
 
void set_region (std::shared_ptr< Region >, bool use_thread=true)
 
void clear_region ()
 
std::shared_ptr< Regionthe_region () const
 
uint32_t index () const
 
void maybe_compute_next_transition (samplepos_t start_sample, Temporal::Beats const &start, Temporal::Beats const &end, pframes_t &nframes, pframes_t &dest_offset)
 
bool compute_quantized_transition (samplepos_t start_sample, Temporal::Beats const &start, Temporal::Beats const &end, Temporal::BBT_Argument &t_bbt, Temporal::Beats &t_beats, samplepos_t &t_samples, Temporal::TempoMap::SharedPtr const &tmap, Temporal::BBT_Offset const &q)
 
pframes_t compute_next_transition (samplepos_t start_sample, Temporal::Beats const &start, Temporal::Beats const &end, pframes_t nframes, Temporal::BBT_Argument &t_bbt, Temporal::Beats &t_beats, samplepos_t &t_samples, Temporal::TempoMap::SharedPtr const &tmap)
 
template<typename TriggerType >
void start_and_roll_to (samplepos_t start_pos, samplepos_t end_position, TriggerType &trigger, pframes_t(TriggerType::*run_method)(BufferSet &bufs, samplepos_t start_sample, samplepos_t end_sample, Temporal::Beats const &start_beats, Temporal::Beats const &end_beats, pframes_t nframes, pframes_t dest_offset, double bpm, pframes_t &), uint32_t cnt)
 
void set_next_trigger (int n)
 
int next_trigger () const
 
void startup (BufferSet &, pframes_t dest_offset, Temporal::BBT_Offset const &start_quantization=Temporal::BBT_Offset(9, 3, 0))
 
void startup_from_ffwd (BufferSet &, uint32_t loop_cnt)
 
void shutdown_from_fwd ()
 
virtual void shutdown (BufferSet &bufs, pframes_t dest_offset)
 
void begin_stop (bool explicit_stop=false)
 
void begin_switch (TriggerPtr)
 
bool explicitly_stopped () const
 
uint32_t loop_count () const
 
void set_ui (void *)
 
void * ui () const
 
TriggerBoxbox () const
 
std::shared_ptr< TriggerBoxboxptr () const
 
double estimated_tempo () const
 
virtual Evoral::SMF::UsedChannels used_channels () const
 
virtual void set_used_channels (Evoral::SMF::UsedChannels)
 
virtual void set_patch_change (Evoral::PatchChange< MidiBuffer::TimeType > const &)
 
virtual Evoral::PatchChange< MidiBuffer::TimeType > const patch_change (uint8_t) const
 
virtual void unset_patch_change (uint8_t channel)
 
virtual void unset_all_patch_changes ()
 
virtual bool patch_change_set (uint8_t channel) const
 
Temporal::Meter meter () const
 
void set_velocity_gain (gain_t g)
 
void set_pending (Trigger *)
 
Triggerswap_pending (Trigger *)
 
void update_properties ()
 
void get_ui_state (UIState &state) const
 
void set_ui_state (UIState &state)
 
virtual void check_edit_swap (timepos_t const &time, bool playing, BufferSet &bufs)
 
- Public Member Functions inherited from PBD::Stateful
 Stateful ()
 
virtual ~Stateful ()
 
virtual bool apply_change (PropertyBase const &)
 
PropertyChange apply_changes (PropertyList const &)
 
const OwnedPropertyListproperties () const
 
void add_property (PropertyBase &s)
 
void add_extra_xml (XMLNode &)
 
XMLNodeextra_xml (const std::string &str, bool add_if_missing=false)
 
void save_extra_xml (const XMLNode &)
 
const PBD::IDid () const
 
bool set_id (const XMLNode &)
 
void set_id (const std::string &)
 
void reset_id ()
 
void clear_changes ()
 
virtual void clear_owned_changes ()
 
PropertyListget_changes_as_properties (PBD::Command *) const
 
virtual void rdiff (std::vector< PBD::Command * > &) const
 
bool changed () const
 
virtual PropertyListproperty_factory (const XMLNode &) const
 
virtual void suspend_property_changes ()
 
virtual void resume_property_changes ()
 
bool property_changes_suspended () const
 

Protected Member Functions

void retrigger ()
 
- Protected Member Functions inherited from ARDOUR::Trigger
void copy_to_ui_state ()
 
void when_stopped_during_run (BufferSet &bufs, pframes_t dest_offset)
 
void set_region_internal (std::shared_ptr< Region >)
 
bool internal_use_follow_length () const
 
void send_property_change (PBD::PropertyChange pc)
 
- Protected Member Functions inherited from PBD::Stateful
void add_instant_xml (XMLNode &, const std::string &directory_path)
 
XMLNodeinstant_xml (const std::string &str, const std::string &directory_path)
 
void add_properties (XMLNode &) const
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 
bool regenerate_xml_or_string_ids () const
 

Private Member Functions

virtual void setup_stretcher ()
 
void drop_data ()
 
int load_data (std::shared_ptr< AudioRegion >)
 
void estimate_tempo ()
 
void reset_stretcher ()
 
void _startup (BufferSet &, pframes_t dest_offset, Temporal::BBT_Offset const &)
 
int set_region_in_worker_thread_internal (std::shared_ptr< Region > r, bool from_capture)
 

Private Attributes

AudioData data
 
RubberBand::RubberBandStretcher * _stretcher
 
samplepos_t _start_offset
 
samplecnt_t read_index
 
samplepos_t last_readable_sample
 
samplepos_t _legato_offset
 
samplecnt_t retrieved
 
samplecnt_t got_stretcher_padding
 
samplecnt_t to_pad
 
samplecnt_t to_drop
 

Additional Inherited Members

- Public Types inherited from ARDOUR::Trigger
enum  State {
  Stopped , WaitingToStart , Running , WaitingForRetrigger ,
  WaitingToStop , WaitingToSwitch , Stopping
}
 
enum  LaunchStyle {
  OneShot , ReTrigger , Gate , Toggle ,
  Repeat
}
 
enum  StretchMode { Crisp , Mixed , Smooth }
 
- Static Public Member Functions inherited from ARDOUR::Trigger
static void make_property_quarks ()
 
static void request_trigger_delete (Trigger *t)
 
- Public Attributes inherited from ARDOUR::Trigger
PBD::Signal< void()> ArmChanged
 
samplepos_t transition_samples
 
Temporal::Beats transition_beats
 
Temporal::BBT_Time _transition_bbt
 
- Public Attributes inherited from PBD::Stateful
PBD::Signal< void(const PropertyChange &)> PropertyChanged
 
- Static Public Attributes inherited from ARDOUR::Trigger
static PBD::Signal< void(Trigger const *)> TriggerArmChanged
 
static Trigger *const MagicClearPointerValue
 
static PBD::Signal< void(PBD::PropertyChange, Trigger *)> TriggerPropertyChange
 
- Static Public Attributes inherited from PBD::Stateful
static int current_state_version
 
static int loading_state_version
 
- Protected Attributes inherited from ARDOUR::Trigger
PBD::Property< LaunchStyle_launch_style
 
PBD::Property< FollowAction_follow_action0
 
PBD::Property< FollowAction_follow_action1
 
PBD::Property< int > _follow_action_probability
 
PBD::Property< uint32_t > _follow_count
 
PBD::Property< Temporal::BBT_Offset_quantization
 
PBD::Property< Temporal::BBT_Offset_follow_length
 
PBD::Property< bool > _use_follow_length
 
PBD::Property< bool > _legato
 
PBD::Property< gain_t_gain
 
PBD::Property< float > _velocity_effect
 
PBD::Property< bool > _stretchable
 
PBD::Property< bool > _cue_isolated
 
PBD::Property< bool > _allow_patch_changes
 
PBD::Property< StretchMode_stretch_mode
 
PBD::Property< std::string > _name
 
PBD::Property< color_t_color
 
std::shared_ptr< Region_region
 
samplecnt_t process_index
 
samplepos_t final_processed_sample
 
UIState ui_state
 
TriggerBox_box
 
UIRequests _requests
 
State _state
 
bool _playout
 
std::atomic< int > _bang
 
std::atomic< int > _unbang
 
uint32_t _index
 
int _next_trigger
 
uint32_t _loop_cnt
 
void * _ui
 
bool _explicitly_stopped
 
gain_t _pending_velocity_gain
 
gain_t _velocity_gain
 
bool _cue_launched
 
bool _armed
 
Evoral::SMF::UsedChannels _used_channels
 
Evoral::PatchChange< MidiBuffer::TimeType_patch_change [16]
 
std::vector< int > _channel_map
 
double _estimated_tempo
 
double _segment_tempo
 
double _beatcnt
 
Temporal::Meter _meter
 
samplepos_t expected_end_sample
 
Temporal::BBT_Offset _start_quantization
 
Temporal::BBT_Offset _nxt_quantization
 
std::atomic< Trigger * > _pending
 
std::atomic< unsigned int > last_property_generation
 
- Protected Attributes inherited from PBD::Stateful
XMLNode_extra_xml
 
XMLNode_instant_xml
 
PBD::PropertyChange _pending_changed
 
Glib::Threads::Mutex _lock
 
std::string _xml_node_name
 name of node to use for this object in XML More...
 
OwnedPropertyList_properties
 

Detailed Description

Definition at line 502 of file triggerbox.h.

Constructor & Destructor Documentation

◆ AudioTrigger()

ARDOUR::AudioTrigger::AudioTrigger ( uint32_t  index,
TriggerBox  
)

◆ ~AudioTrigger()

ARDOUR::AudioTrigger::~AudioTrigger ( )

Member Function Documentation

◆ _startup()

void ARDOUR::AudioTrigger::_startup ( BufferSet ,
pframes_t  dest_offset,
Temporal::BBT_Offset const &   
)
privatevirtual

Reimplemented from ARDOUR::Trigger.

◆ alloc_stretcher()

RubberBand::RubberBandStretcher* ARDOUR::AudioTrigger::alloc_stretcher ( ) const

◆ audio_data()

Sample const* ARDOUR::AudioTrigger::audio_data ( size_t  n) const

◆ audio_run()

template<bool actually_run>
pframes_t ARDOUR::AudioTrigger::audio_run ( BufferSet bufs,
samplepos_t  start_sample,
samplepos_t  end_sample,
Temporal::Beats const &  start,
Temporal::Beats const &  end,
pframes_t  nframes,
pframes_t  dest_offset,
double  bpm,
pframes_t quantize_offset 
)

◆ captured()

void ARDOUR::AudioTrigger::captured ( SlotArmInfo ,
BufferSet  
)
virtual

Reimplemented from ARDOUR::Trigger.

◆ channels()

uint32_t ARDOUR::AudioTrigger::channels ( ) const
inline

Definition at line 554 of file triggerbox.h.

◆ compute_end()

timepos_t ARDOUR::AudioTrigger::compute_end ( Temporal::TempoMap::SharedPtr const &  ,
Temporal::BBT_Time const &  ,
samplepos_t  ,
Temporal::Beats  
)
virtual

Implements ARDOUR::Trigger.

◆ current_length()

timepos_t ARDOUR::AudioTrigger::current_length ( ) const
virtual

Implements ARDOUR::Trigger.

◆ data_length()

size_t ARDOUR::AudioTrigger::data_length ( ) const
inline

Definition at line 571 of file triggerbox.h.

◆ drop_data()

void ARDOUR::AudioTrigger::drop_data ( )
private

◆ estimate_tempo()

void ARDOUR::AudioTrigger::estimate_tempo ( )
private

◆ get_segment_descriptor()

SegmentDescriptor ARDOUR::AudioTrigger::get_segment_descriptor ( ) const
virtual

Implements ARDOUR::Trigger.

◆ get_state()

XMLNode& ARDOUR::AudioTrigger::get_state ( ) const
virtual

Reimplemented from ARDOUR::Trigger.

◆ io_change()

void ARDOUR::AudioTrigger::io_change ( )
virtual

Reimplemented from ARDOUR::Trigger.

◆ jump_start()

void ARDOUR::AudioTrigger::jump_start ( )
virtual

Reimplemented from ARDOUR::Trigger.

◆ jump_stop()

void ARDOUR::AudioTrigger::jump_stop ( BufferSet bufs,
pframes_t  dest_offset 
)
virtual

Reimplemented from ARDOUR::Trigger.

◆ load_data()

int ARDOUR::AudioTrigger::load_data ( std::shared_ptr< AudioRegion )
private

◆ natural_length()

timepos_t ARDOUR::AudioTrigger::natural_length ( ) const
virtual

Implements ARDOUR::Trigger.

◆ playable()

bool ARDOUR::AudioTrigger::playable ( ) const
inlinevirtual

Implements ARDOUR::Trigger.

Definition at line 515 of file triggerbox.h.

◆ probably_oneshot()

bool ARDOUR::AudioTrigger::probably_oneshot ( ) const
virtual

Implements ARDOUR::Trigger.

◆ reload()

void ARDOUR::AudioTrigger::reload ( BufferSet ,
void *   
)
virtual

Implements ARDOUR::Trigger.

◆ reset_stretcher()

void ARDOUR::AudioTrigger::reset_stretcher ( )
private

◆ retrigger()

void ARDOUR::AudioTrigger::retrigger ( )
protectedvirtual

Reimplemented from ARDOUR::Trigger.

◆ run()

pframes_t ARDOUR::AudioTrigger::run ( BufferSet bufs,
samplepos_t  start_sample,
samplepos_t  end_sample,
Temporal::Beats const &  start,
Temporal::Beats const &  end,
pframes_t  nframes,
pframes_t  dest_offset,
double  bpm,
pframes_t quantize_offset 
)
inlinevirtual

Implements ARDOUR::Trigger.

Definition at line 511 of file triggerbox.h.

◆ segment_beatcnt()

double ARDOUR::AudioTrigger::segment_beatcnt ( )
inline

Definition at line 523 of file triggerbox.h.

◆ segment_tempo()

double ARDOUR::AudioTrigger::segment_tempo ( ) const
inlinevirtual

Implements ARDOUR::Trigger.

Definition at line 520 of file triggerbox.h.

◆ set_end()

void ARDOUR::AudioTrigger::set_end ( timepos_t const &  )
virtual

Implements ARDOUR::Trigger.

◆ set_legato_offset()

void ARDOUR::AudioTrigger::set_legato_offset ( timepos_t const &  )
virtual

Implements ARDOUR::Trigger.

◆ set_length()

void ARDOUR::AudioTrigger::set_length ( timecnt_t const &  )
virtual

Implements ARDOUR::Trigger.

◆ set_region_in_worker_thread()

int ARDOUR::AudioTrigger::set_region_in_worker_thread ( std::shared_ptr< Region )
virtual

Implements ARDOUR::Trigger.

◆ set_region_in_worker_thread_from_capture()

int ARDOUR::AudioTrigger::set_region_in_worker_thread_from_capture ( std::shared_ptr< Region )
virtual

Implements ARDOUR::Trigger.

◆ set_region_in_worker_thread_internal()

int ARDOUR::AudioTrigger::set_region_in_worker_thread_internal ( std::shared_ptr< Region r,
bool  from_capture 
)
private

◆ set_segment_beatcnt()

void ARDOUR::AudioTrigger::set_segment_beatcnt ( double  count)

◆ set_segment_tempo()

void ARDOUR::AudioTrigger::set_segment_tempo ( double  t)
virtual

Implements ARDOUR::Trigger.

◆ set_start()

void ARDOUR::AudioTrigger::set_start ( timepos_t const &  )
virtual

Implements ARDOUR::Trigger.

◆ set_state()

int ARDOUR::AudioTrigger::set_state ( const XMLNode ,
int  version 
)
virtual

Reimplemented from ARDOUR::Trigger.

◆ set_stretch_mode()

void ARDOUR::AudioTrigger::set_stretch_mode ( StretchMode  )

◆ setup_stretcher()

virtual void ARDOUR::AudioTrigger::setup_stretcher ( )
privatevirtual

Implements ARDOUR::Trigger.

◆ start_and_roll_to()

void ARDOUR::AudioTrigger::start_and_roll_to ( samplepos_t  start,
samplepos_t  position,
uint32_t  cnt 
)
virtual

Implements ARDOUR::Trigger.

◆ start_offset()

timepos_t ARDOUR::AudioTrigger::start_offset ( ) const
virtual

Implements ARDOUR::Trigger.

◆ stretch_mode()

StretchMode ARDOUR::AudioTrigger::stretch_mode ( ) const
inline

Definition at line 517 of file triggerbox.h.

◆ stretcher()

RubberBand::RubberBandStretcher* ARDOUR::AudioTrigger::stretcher ( )
inline

Definition at line 547 of file triggerbox.h.

◆ stretching()

bool ARDOUR::AudioTrigger::stretching ( ) const

Member Data Documentation

◆ _legato_offset

samplepos_t ARDOUR::AudioTrigger::_legato_offset
private

Definition at line 586 of file triggerbox.h.

◆ _start_offset

samplepos_t ARDOUR::AudioTrigger::_start_offset
private

Definition at line 579 of file triggerbox.h.

◆ _stretcher

RubberBand::RubberBandStretcher* ARDOUR::AudioTrigger::_stretcher
private

Definition at line 578 of file triggerbox.h.

◆ data

AudioData ARDOUR::AudioTrigger::data
private

Definition at line 577 of file triggerbox.h.

◆ got_stretcher_padding

samplecnt_t ARDOUR::AudioTrigger::got_stretcher_padding
private

Definition at line 588 of file triggerbox.h.

◆ last_readable_sample

samplepos_t ARDOUR::AudioTrigger::last_readable_sample
private

Definition at line 585 of file triggerbox.h.

◆ read_index

samplecnt_t ARDOUR::AudioTrigger::read_index
private

Definition at line 584 of file triggerbox.h.

◆ retrieved

samplecnt_t ARDOUR::AudioTrigger::retrieved
private

Definition at line 587 of file triggerbox.h.

◆ to_drop

samplecnt_t ARDOUR::AudioTrigger::to_drop
private

Definition at line 590 of file triggerbox.h.

◆ to_pad

samplecnt_t ARDOUR::AudioTrigger::to_pad
private

Definition at line 589 of file triggerbox.h.


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