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

Factory for arranger objects. More...

#include <src/structure/arrangement/arranger_object_factory.h>

Inheritance diagram for zrythm::structure::arrangement::ArrangerObjectFactory:
Collaboration diagram for zrythm::structure::arrangement::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 (structure::tracks::AudioLane &lane, const AudioClip::Uuid &clip_id, double start_ticks)
 
ScaleObjectadd_scale_object (structure::tracks::ChordTrack &chord_track, const dsp::MusicalScale &scale, double start_ticks)
 
Q_INVOKABLE MarkeraddMarker (structure::tracks::MarkerTrack *markerTrack, const QString &name, double startTicks)
 
Q_INVOKABLE MidiRegionaddEmptyMidiRegion (structure::tracks::MidiLane *lane, double startTicks)
 
Q_INVOKABLE ChordRegionaddEmptyChordRegion (structure::tracks::ChordTrack *track, double startTicks)
 
Q_INVOKABLE AutomationRegionaddEmptyAutomationRegion (tracks::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<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto clone_new_object_identity (const ObjT &other) const
 
template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto clone_object_snapshot (const ObjT &other, QObject &owner) const
 
template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto get_selection_manager_for_object (const ObjT &obj) const
 
template<structure::arrangement::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 21 of file arranger_object_factory.h.

Constructor & Destructor Documentation

◆ ArrangerObjectFactory()

zrythm::structure::arrangement::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 45 of file arranger_object_factory.h.

Member Function Documentation

◆ add_audio_region_with_clip()

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

Definition at line 477 of file arranger_object_factory.h.

◆ add_empty_audio_region_for_recording()

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

Definition at line 563 of file arranger_object_factory.h.

◆ add_scale_object()

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

Definition at line 489 of file arranger_object_factory.h.

◆ addAudioRegionFromFile()

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

Definition at line 578 of file arranger_object_factory.h.

◆ addAutomationPoint()

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

Definition at line 623 of file arranger_object_factory.h.

◆ addChordObject()

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

Definition at line 630 of file arranger_object_factory.h.

◆ addEmptyAutomationRegion()

Q_INVOKABLE AutomationRegion * zrythm::structure::arrangement::ArrangerObjectFactory::addEmptyAutomationRegion ( tracks::AutomationTrack * automationTrack,
double startTicks )
inline

Definition at line 544 of file arranger_object_factory.h.

◆ addEmptyChordRegion()

Q_INVOKABLE ChordRegion * zrythm::structure::arrangement::ArrangerObjectFactory::addEmptyChordRegion ( structure::tracks::ChordTrack * track,
double startTicks )
inline

Definition at line 534 of file arranger_object_factory.h.

◆ addEmptyMidiRegion()

Q_INVOKABLE MidiRegion * zrythm::structure::arrangement::ArrangerObjectFactory::addEmptyMidiRegion ( structure::tracks::MidiLane * lane,
double startTicks )
inline

Definition at line 523 of file arranger_object_factory.h.

◆ addMarker()

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

Definition at line 503 of file arranger_object_factory.h.

◆ addMidiNote()

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

Definition at line 617 of file arranger_object_factory.h.

◆ addMidiRegionFromMidiFile()

Q_INVOKABLE MidiRegion * zrythm::structure::arrangement::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()

template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto zrythm::structure::arrangement::ArrangerObjectFactory::clone_new_object_identity ( const ObjT & other) const
inline

Definition at line 654 of file arranger_object_factory.h.

◆ clone_object_snapshot()

template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto zrythm::structure::arrangement::ArrangerObjectFactory::clone_object_snapshot ( const ObjT & other,
QObject & owner ) const
inline

Definition at line 669 of file arranger_object_factory.h.

◆ create_audio_region_from_audio_buffer_FIXME()

auto zrythm::structure::arrangement::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 642 of file arranger_object_factory.h.

◆ get_builder()

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

Definition at line 355 of file arranger_object_factory.h.

◆ get_selection_manager_for_object()

template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto zrythm::structure::arrangement::ArrangerObjectFactory::get_selection_manager_for_object ( const ObjT & obj) const
inline

Definition at line 695 of file arranger_object_factory.h.

◆ set_selection_handler_to_object()

template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
void zrythm::structure::arrangement::ArrangerObjectFactory::set_selection_handler_to_object ( ObjT & obj)
inline

Definition at line 721 of file arranger_object_factory.h.


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