Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_track.h
1// SPDX-FileCopyrightText: © 2018-2020, 2024-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/stretcher.h"
7#include "structure/tracks/track.h"
8
9namespace zrythm::structure::tracks
10{
14class AudioTrack : public Track
15{
16 Q_OBJECT
17 QML_ELEMENT
18 QML_UNCREATABLE ("")
19
20public:
21 using AudioRegion = arrangement::AudioRegion;
22
23 AudioTrack (FinalTrackDependencies dependencies);
24
25 friend void init_from (
26 AudioTrack &obj,
27 const AudioTrack &other,
28 utils::ObjectCloneType clone_type);
29
30 // ========================================================================
31 // QML Interface
32 // ========================================================================
33
34 // ========================================================================
35
36 void timestretch_buf (
37 const AudioRegion * r,
39 unsigned_frame_t in_frame_offset,
40 double timestretch_ratio,
41 float * lbuf_after_ts,
42 float * rbuf_after_ts,
43 unsigned_frame_t out_frame_offset,
44 unsigned_frame_t frames_to_process);
45
46private:
47 friend void to_json (nlohmann::json &j, const AudioTrack &track)
48 {
49 to_json (j, static_cast<const Track &> (track));
50 }
51 friend void from_json (const nlohmann::json &j, AudioTrack &track)
52 {
53 from_json (j, static_cast<Track &> (track));
54 }
55
56 bool initialize ();
57
58private:
60 std::unique_ptr<zrythm::dsp::Stretcher> rt_stretcher_;
61
69 units::sample_rate_t samplerate_;
70};
71}
Audio clips for the pool.
A region for playing back audio samples.
Track(Type type, PortType in_signal_type, PortType out_signal_type, TrackFeatures enabled_features, BaseTrackDependencies dependencies)
Constructor to be used by subclasses.
uint_fast64_t unsigned_frame_t
Unsigned type for frame index.
Definition types.h:78