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>

Data Structures

struct  Dependencies
class  Builder

Public Types

using SampleRateProvider = std::function<units::sample_rate_t ()>
using BpmProvider = std::function<bpm_t ()>

Public Member Functions

 ArrangerObjectFactory (Dependencies dependencies, SampleRateProvider sample_rate_provider, BpmProvider bpm_provider)
template<typename ObjT>
auto get_builder () const
auto create_audio_region_with_clip (dsp::FileAudioSourceUuidReference clip_id, double startTicks) const
 To be used by the backend.
auto create_empty_audio_region_for_recording (int num_channels, const utils::Utf8String &clip_name, double start_ticks)
auto create_audio_region_from_file (const QString &absPath, double startTicks)
auto create_audio_region_from_audio_buffer (const utils::audio::AudioBuffer &buf, utils::audio::BitDepth bit_depth, const utils::Utf8String &clip_name, double start_ticks) const
 Creates and registers a new AudioClip and then creates and returns an AudioRegion from it.
template<structure::arrangement::RegionObject RegionT>
requires (!std::is_same_v<RegionT, structure::arrangement::AudioRegion>)
auto create_editor_object (double startTicks, std::variant< int, double > value)
 Used to create and add editor objects.
template<structure::arrangement::FinalArrangerObjectSubclass ObjT>
auto clone_new_object_identity (const ObjT &other) const

Detailed Description

Factory for arranger objects.

Definition at line 13 of file arranger_object_factory.h.

Member Typedef Documentation

◆ BpmProvider

using zrythm::structure::arrangement::ArrangerObjectFactory::BpmProvider = std::function<bpm_t ()>

Definition at line 17 of file arranger_object_factory.h.

◆ SampleRateProvider

using zrythm::structure::arrangement::ArrangerObjectFactory::SampleRateProvider = std::function<units::sample_rate_t ()>

Definition at line 16 of file arranger_object_factory.h.

Constructor & Destructor Documentation

◆ ArrangerObjectFactory()

zrythm::structure::arrangement::ArrangerObjectFactory::ArrangerObjectFactory ( Dependencies dependencies,
SampleRateProvider sample_rate_provider,
BpmProvider bpm_provider )
inline

Definition at line 36 of file arranger_object_factory.h.

Member Function Documentation

◆ 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 405 of file arranger_object_factory.h.

◆ create_audio_region_from_audio_buffer()

auto zrythm::structure::arrangement::ArrangerObjectFactory::create_audio_region_from_audio_buffer ( const utils::audio::AudioBuffer & buf,
utils::audio::BitDepth bit_depth,
const utils::Utf8String & clip_name,
double start_ticks ) const
inline

Creates and registers a new AudioClip and then creates and returns an AudioRegion from it.

Possible use cases: splitting audio regions, audio functions, recording.

Definition at line 361 of file arranger_object_factory.h.

◆ create_audio_region_from_file()

auto zrythm::structure::arrangement::ArrangerObjectFactory::create_audio_region_from_file ( const QString & absPath,
double startTicks )
inline

Definition at line 346 of file arranger_object_factory.h.

◆ create_audio_region_with_clip()

auto zrythm::structure::arrangement::ArrangerObjectFactory::create_audio_region_with_clip ( dsp::FileAudioSourceUuidReference clip_id,
double startTicks ) const
inline

To be used by the backend.

Definition at line 323 of file arranger_object_factory.h.

◆ create_editor_object()

template<structure::arrangement::RegionObject RegionT>
requires (!std::is_same_v<RegionT, structure::arrangement::AudioRegion>)
auto zrythm::structure::arrangement::ArrangerObjectFactory::create_editor_object ( double startTicks,
std::variant< int, double > value )
inline

Used to create and add editor objects.

Parameters
startTicksStart position of the object in ticks.
valueEither pitch (int), automation point value (double) or chord ID.

Definition at line 381 of file arranger_object_factory.h.

◆ create_empty_audio_region_for_recording()

auto zrythm::structure::arrangement::ArrangerObjectFactory::create_empty_audio_region_for_recording ( int num_channels,
const utils::Utf8String & clip_name,
double start_ticks )
inline

Definition at line 335 of file arranger_object_factory.h.

◆ get_builder()

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

Definition at line 314 of file arranger_object_factory.h.


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