Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ArrangerObjectFactory Class Reference

Factory for arranger objects. More...

#include <src/gui/dsp/arranger_object_factory.h>

Inheritance diagram for ArrangerObjectFactory:
Collaboration diagram for ArrangerObjectFactory:

Data Structures

class  Builder
 

Public Member Functions

 ArrangerObjectFactory (ArrangerObjectRegistry &registry, TrackResolver track_resolver, gui::SettingsManager &settings_mgr, std::function< dsp::FramesPerTick()> frames_per_tick_getter, gui::SnapGrid &snap_grid_timeline, gui::SnapGrid &snap_grid_editor, AudioClipResolverFunc clip_resolver, RegisterNewAudioClipFunc clip_registration_func, std::function< sample_rate_t()> sample_rate_provider, std::function< bpm_t()> bpm_provider, ArrangerObjectSelectionManager timeline_selections_manager, ArrangerObjectSelectionManager midi_selections_manager, ArrangerObjectSelectionManager chord_selections_manager, ArrangerObjectSelectionManager automation_selections_manager, QObject *parent=nullptr)
 
template<typename ObjT>
auto get_builder () const
 
AudioRegionadd_audio_region_with_clip (AudioLane &lane, const AudioClip::Uuid &clip_id, double start_ticks)
 
ScaleObjectadd_scale_object (ChordTrack &chord_track, const dsp::MusicalScale &scale, double start_ticks)
 
Q_INVOKABLE MarkeraddMarker (MarkerTrack *markerTrack, const QString &name, double startTicks)
 
Q_INVOKABLE MidiRegionaddEmptyMidiRegion (MidiLane *lane, double startTicks)
 
Q_INVOKABLE ChordRegionaddEmptyChordRegion (ChordTrack *track, double startTicks)
 
Q_INVOKABLE AutomationRegionaddEmptyAutomationRegion (AutomationTrack *automationTrack, double startTicks)
 
AudioRegionadd_empty_audio_region_for_recording (AudioLane &lane, int num_channels, const utils::Utf8String &clip_name, double start_ticks)
 
Q_INVOKABLE AudioRegionaddAudioRegionFromFile (AudioLane *lane, const QString &absPath, double startTicks)
 
Q_INVOKABLE MidiRegionaddMidiRegionFromChordDescriptor (MidiLane *lane, const dsp::ChordDescriptor &descr, double startTicks)
 Creates a MIDI region at lane from the given descr starting at startTicks.
 
Q_INVOKABLE MidiRegionaddMidiRegionFromMidiFile (MidiLane *lane, const QString &absolutePath, double startTicks, int midiTrackIndex)
 Creates a MIDI region at lane from MIDI file path abs_path starting at startTicks.
 
Q_INVOKABLE MidiNoteaddMidiNote (MidiRegion *region, double startTicks, int pitch)
 
Q_INVOKABLE AutomationPointaddAutomationPoint (AutomationRegion *region, double startTicks, double value)
 
Q_INVOKABLE ChordObjectaddChordObject (ChordRegion *region, double startTicks, const int chordIndex)
 
auto create_audio_region_from_audio_buffer_FIXME (AudioLane &lane, const utils::audio::AudioBuffer &buf, utils::audio::BitDepth bit_depth, const utils::Utf8String &clip_name, double start_ticks) const
 Temporary solution for splitting regions.
 
template<FinalArrangerObjectSubclass ObjT>
auto clone_new_object_identity (const ObjT &other) const
 
template<FinalArrangerObjectSubclass ObjT>
auto clone_object_snapshot (const ObjT &other, QObject &owner) const
 
template<FinalArrangerObjectSubclass ObjT>
auto get_selection_manager_for_object (const ObjT &obj) const
 
template<FinalArrangerObjectSubclass ObjT>
void set_selection_handler_to_object (ObjT &obj)
 

Static Public Member Functions

static ArrangerObjectFactoryget_instance ()
 

Detailed Description

Factory for arranger objects.

Note
API that starts with add adds the object to the project and should be used in most cases. API that starts with create only creates and registers the object but does not add it to the project (this should only be used internally).

Definition at line 19 of file arranger_object_factory.h.

Constructor & Destructor Documentation

◆ ArrangerObjectFactory()

ArrangerObjectFactory::ArrangerObjectFactory ( ArrangerObjectRegistry & registry,
TrackResolver track_resolver,
gui::SettingsManager & settings_mgr,
std::function< dsp::FramesPerTick()> frames_per_tick_getter,
gui::SnapGrid & snap_grid_timeline,
gui::SnapGrid & snap_grid_editor,
AudioClipResolverFunc clip_resolver,
RegisterNewAudioClipFunc clip_registration_func,
std::function< sample_rate_t()> sample_rate_provider,
std::function< bpm_t()> bpm_provider,
ArrangerObjectSelectionManager timeline_selections_manager,
ArrangerObjectSelectionManager midi_selections_manager,
ArrangerObjectSelectionManager chord_selections_manager,
ArrangerObjectSelectionManager automation_selections_manager,
QObject * parent = nullptr )
inline

Definition at line 25 of file arranger_object_factory.h.

Member Function Documentation

◆ add_audio_region_with_clip()

AudioRegion * ArrangerObjectFactory::add_audio_region_with_clip ( AudioLane & lane,
const AudioClip::Uuid & clip_id,
double start_ticks )
inline
Parameters
lane
clip_id
start_ticks
Returns
AudioRegion*

Definition at line 449 of file arranger_object_factory.h.

◆ add_empty_audio_region_for_recording()

AudioRegion * ArrangerObjectFactory::add_empty_audio_region_for_recording ( AudioLane & lane,
int num_channels,
const utils::Utf8String & clip_name,
double start_ticks )
inline

Definition at line 532 of file arranger_object_factory.h.

◆ add_scale_object()

ScaleObject * ArrangerObjectFactory::add_scale_object ( ChordTrack & chord_track,
const dsp::MusicalScale & scale,
double start_ticks )
inline

Definition at line 461 of file arranger_object_factory.h.

◆ addAudioRegionFromFile()

Q_INVOKABLE AudioRegion * ArrangerObjectFactory::addAudioRegionFromFile ( AudioLane * lane,
const QString & absPath,
double startTicks )
inline

Definition at line 547 of file arranger_object_factory.h.

◆ addAutomationPoint()

Q_INVOKABLE AutomationPoint * ArrangerObjectFactory::addAutomationPoint ( AutomationRegion * region,
double startTicks,
double value )
inline

Definition at line 592 of file arranger_object_factory.h.

◆ addChordObject()

Q_INVOKABLE ChordObject * ArrangerObjectFactory::addChordObject ( ChordRegion * region,
double startTicks,
const int chordIndex )
inline

Definition at line 599 of file arranger_object_factory.h.

◆ addEmptyAutomationRegion()

Q_INVOKABLE AutomationRegion * ArrangerObjectFactory::addEmptyAutomationRegion ( AutomationTrack * automationTrack,
double startTicks )
inline

Definition at line 515 of file arranger_object_factory.h.

◆ addEmptyChordRegion()

Q_INVOKABLE ChordRegion * ArrangerObjectFactory::addEmptyChordRegion ( ChordTrack * track,
double startTicks )
inline

Definition at line 504 of file arranger_object_factory.h.

◆ addEmptyMidiRegion()

Q_INVOKABLE MidiRegion * ArrangerObjectFactory::addEmptyMidiRegion ( MidiLane * lane,
double startTicks )
inline

Definition at line 493 of file arranger_object_factory.h.

◆ addMarker()

Q_INVOKABLE Marker * ArrangerObjectFactory::addMarker ( MarkerTrack * markerTrack,
const QString & name,
double startTicks )
inline

Definition at line 476 of file arranger_object_factory.h.

◆ addMidiNote()

Q_INVOKABLE MidiNote * ArrangerObjectFactory::addMidiNote ( MidiRegion * region,
double startTicks,
int pitch )
inline

Definition at line 586 of file arranger_object_factory.h.

◆ addMidiRegionFromMidiFile()

Q_INVOKABLE MidiRegion * ArrangerObjectFactory::addMidiRegionFromMidiFile ( MidiLane * lane,
const QString & absolutePath,
double startTicks,
int midiTrackIndex )

Creates a MIDI region at lane from MIDI file path abs_path starting at startTicks.

Parameters
midi_track_idxThe index of this track, starting from 0. This will be sequential, ie, if idx 1 is requested and the MIDI file only has tracks 5 and 7, it will use track 7.

◆ clone_new_object_identity()

auto ArrangerObjectFactory::clone_new_object_identity ( const ObjT & other) const
inline

Definition at line 623 of file arranger_object_factory.h.

◆ clone_object_snapshot()

auto ArrangerObjectFactory::clone_object_snapshot ( const ObjT & other,
QObject & owner ) const
inline

Definition at line 638 of file arranger_object_factory.h.

◆ create_audio_region_from_audio_buffer_FIXME()

auto ArrangerObjectFactory::create_audio_region_from_audio_buffer_FIXME ( AudioLane & lane,
const utils::audio::AudioBuffer & buf,
utils::audio::BitDepth bit_depth,
const utils::Utf8String & clip_name,
double start_ticks ) const
inline

Temporary solution for splitting regions.

Eventually need a public method here that not only creates the region but also adds it to the project like the rest of the public API here.

Definition at line 611 of file arranger_object_factory.h.

◆ get_builder()

template<typename ObjT>
auto ArrangerObjectFactory::get_builder ( ) const
inline

Definition at line 328 of file arranger_object_factory.h.

◆ get_selection_manager_for_object()

auto ArrangerObjectFactory::get_selection_manager_for_object ( const ObjT & obj) const
inline

Definition at line 663 of file arranger_object_factory.h.

◆ set_selection_handler_to_object()

void ArrangerObjectFactory::set_selection_handler_to_object ( ObjT & obj)
inline

Definition at line 688 of file arranger_object_factory.h.


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