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#if 0
37 void timestretch_buf (
38 const AudioRegion * r,
40 uint64_t in_frame_offset,
41 double timestretch_ratio,
42 float * lbuf_after_ts,
43 float * rbuf_after_ts,
44 uint64_t out_frame_offset,
45 uint64_t frames_to_process);
46#endif
47
48private:
49 friend void to_json (nlohmann::json &j, const AudioTrack &track)
50 {
51 to_json (j, static_cast<const Track &> (track));
52 }
53 friend void from_json (const nlohmann::json &j, AudioTrack &track)
54 {
55 from_json (j, static_cast<Track &> (track));
56 }
57
58 bool initialize ();
59
60private:
62 std::unique_ptr<zrythm::dsp::Stretcher> rt_stretcher_;
63
71 units::sample_rate_t samplerate_;
72};
73}
Audio clips for the pool.
A region for playing back audio samples.
Track(Type type, std::optional< PortType > in_signal_type, std::optional< PortType > out_signal_type, TrackFeatures enabled_features, BaseTrackDependencies dependencies)
Constructor to be used by subclasses.