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

A region for playing back audio samples. More...

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

Inheritance diagram for zrythm::structure::arrangement::AudioRegion:
Collaboration diagram for zrythm::structure::arrangement::AudioRegion:

Public Member Functions

 AudioRegion (const dsp::TempoMap &tempo_map, ArrangerObjectRegistry &object_registry, dsp::FileAudioSourceRegistry &file_audio_source_registry, GlobalMusicalModeGetter musical_mode_getter, QObject *parent=nullptr) noexcept
MusicalMode musicalMode () const
Q_INVOKABLE bool effectivelyInMusicalMode () const
void setMusicalMode (MusicalMode musical_mode)
Q_SIGNAL void musicalModeChanged (MusicalMode musical_mode)
float gain () const
void setGain (float gain)
Q_SIGNAL void gainChanged (float gain)
void set_source (const ArrangerObjectUuidReference &source)
 Set the AudioSourceObject to the region.
juce::PositionableAudioSource & get_audio_source () const
std::string get_field_name_for_serialization (const AudioSourceObject *) const override
Public Member Functions inherited from zrythm::structure::arrangement::ArrangerObject
bool is_start_hit_by_range (const units::sample_t frames_start, const units::sample_t frames_end, bool range_start_inclusive=true, bool range_end_inclusive=false) const
auto type () const
dsp::AtomicPositionQmlAdapterposition () const
ArrangerObjectBoundsbounds () const
ArrangerObjectLoopRangeloopRange () const
ArrangerObjectNamename () const
ArrangerObjectColorcolor () const
ArrangerObjectMuteFunctionalitymute () const
ArrangerObjectFadeRangefadeRange () const
Q_SIGNAL void propertiesChanged ()
 Emitted when any of the properties of the object changed.
ArrangerObjectparentObject () const
void setParentObject (ArrangerObject *object)
Q_SIGNAL void parentObjectChanged (QObject *parentObject)
auto & get_tempo_map () const
Public Member Functions inherited from zrythm::utils::UuidIdentifiableObject< ArrangerObject >
UuidIdentifiableObject & operator= (const UuidIdentifiableObject &other)=default
auto get_uuid () const
Public Member Functions inherited from zrythm::structure::arrangement::ArrangerObjectOwner< AudioSourceObject >
 ArrangerObjectOwner (ArrangerObjectRegistry &registry, dsp::FileAudioSourceRegistry &file_audio_source_registry, T &derived)
auto & get_children_vector () const
auto get_children_view () const
auto get_sorted_children_view () const
void add_ticks_to_children (double ticks)
bool contains_object (const ArrangerObject::Uuid &id) const
 O(1) lookup if an object with the given ID exists.
ArrangerObjectListModel * get_model () const
ArrangerObjectUuidReference remove_object (this SelfT &self, const ArrangerObject::Uuid &id)
void insert_object (this SelfT &self, const ArrangerObjectUuidReference &obj_ref, int idx)
void add_object (this SelfT &self, const ArrangerObjectUuidReference &obj_ref)
void clear_objects ()
virtual std::string get_field_name_for_serialization (const ChildT *) const=0
 Get the children field name to be used during serialization/deserialization.

Properties

AudioRegion::MusicalMode musicalMode
float gain
Properties inherited from zrythm::structure::arrangement::ArrangerObject
QML_ELEMENT zrythm::structure::arrangement::ArrangerObjectparentObject
zrythm::structure::arrangement::ArrangerObject::Type type
zrythm::dsp::AtomicPositionQmlAdapterposition
zrythm::structure::arrangement::ArrangerObjectBoundsbounds
zrythm::structure::arrangement::ArrangerObjectLoopRangeloopRange
zrythm::structure::arrangement::ArrangerObjectNamename
zrythm::structure::arrangement::ArrangerObjectColorcolor
zrythm::structure::arrangement::ArrangerObjectMuteFunctionalitymute
zrythm::structure::arrangement::ArrangerObjectFadeRangefadeRange

Friends

void init_from (AudioRegion &obj, const AudioRegion &other, utils::ObjectCloneType clone_type)
void to_json (nlohmann::json &j, const AudioRegion &region)
void from_json (const nlohmann::json &j, AudioRegion &region)

Additional Inherited Members

Public Types inherited from zrythm::structure::arrangement::ArrangerObject
enum class  Type : basic_enum_base_type_t {
  MidiRegion , AudioRegion , ChordRegion , AutomationRegion ,
  MidiNote , ChordObject , ScaleObject , Marker ,
  AutomationPoint , AudioSourceObject , TempoObject , TimeSignatureObject
}
 The type of the object. More...
Public Types inherited from zrythm::structure::arrangement::ArrangerObjectOwner< AudioSourceObject >
using ArrangerObjectChildType
using ArrangerObjectListModel
Protected Types inherited from zrythm::structure::arrangement::ArrangerObject
enum class  ArrangerObjectFeatures : std::uint8_t {
  Bounds = 1 << 0 , LoopingBit = 1 << 1 , Name = 1 << 2 , Color = 1 << 3 ,
  Mute = 1 << 4 , Fading = 1 << 5 , Looping = LoopingBit | Bounds , Region = Looping | Name | Color | Mute
}
Protected Member Functions inherited from zrythm::structure::arrangement::ArrangerObject
 ArrangerObject (Type type, const dsp::TempoMap &tempo_map, ArrangerObjectFeatures features, QObject *parent=nullptr) noexcept
 Construct a new ArrangerObject.

Detailed Description

A region for playing back audio samples.

Definition at line 19 of file audio_region.h.

Member Function Documentation

◆ gain()

float zrythm::structure::arrangement::AudioRegion::gain ( ) const
inline

Definition at line 78 of file audio_region.h.

◆ get_field_name_for_serialization()

std::string zrythm::structure::arrangement::AudioRegion::get_field_name_for_serialization ( const AudioSourceObject * ) const
inlineoverride

Definition at line 101 of file audio_region.h.

◆ musicalMode()

MusicalMode zrythm::structure::arrangement::AudioRegion::musicalMode ( ) const
inline

Definition at line 66 of file audio_region.h.

◆ set_source()

void zrythm::structure::arrangement::AudioRegion::set_source ( const ArrangerObjectUuidReference & source)

Set the AudioSourceObject to the region.

This must be called before the AudioRegion is used.

◆ setGain()

void zrythm::structure::arrangement::AudioRegion::setGain ( float gain)
inline

Definition at line 79 of file audio_region.h.

◆ setMusicalMode()

void zrythm::structure::arrangement::AudioRegion::setMusicalMode ( MusicalMode musical_mode)
inline

Definition at line 68 of file audio_region.h.

◆ from_json

void from_json ( const nlohmann::json & j,
AudioRegion & region )
friend

Definition at line 121 of file audio_region.h.

◆ to_json

void to_json ( nlohmann::json & j,
const AudioRegion & region )
friend

Definition at line 114 of file audio_region.h.

Property Documentation

◆ gain

float zrythm::structure::arrangement::AudioRegion::gain
readwrite

Definition at line 25 of file audio_region.h.

◆ musicalMode

AudioRegion::MusicalMode zrythm::structure::arrangement::AudioRegion::musicalMode
readwrite

Definition at line 24 of file audio_region.h.


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