Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
graph_helpers.h
1// SPDX-FileCopyrightText: © 2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/graph_node.h"
7#include "dsp/itransport.h"
8
9#include <gmock/gmock.h>
10
11namespace zrythm::dsp::graph_test
12{
14{
15public:
16 MOCK_METHOD (utils::Utf8String, get_node_name, (), (const, override));
17 MOCK_METHOD (nframes_t, get_single_playback_latency, (), (const, override));
18 MOCK_METHOD (
19 void,
22 (override));
23 MOCK_METHOD (
24 void,
25 process_block,
27 (noexcept, override));
28 MOCK_METHOD (void, release_resources, (), (override));
29};
30
32{
33public:
34 MOCK_METHOD (
35 (std::pair<units::sample_t, units::sample_t>),
37 (),
38 (const, noexcept, override));
39 MOCK_METHOD (
40 (std::pair<units::sample_t, units::sample_t>),
42 (),
43 (const, noexcept, override));
44 MOCK_METHOD (PlayState, get_play_state, (), (const, noexcept, override));
45 MOCK_METHOD (
46 units::sample_t,
48 (),
49 (const, noexcept, override));
50 MOCK_METHOD (bool, loop_enabled, (), (const, noexcept, override));
51 MOCK_METHOD (bool, punch_enabled, (), (const, noexcept, override));
52 MOCK_METHOD (bool, recording_enabled, (), (const, noexcept, override));
53 MOCK_METHOD (
54 units::sample_t,
56 (),
57 (const, noexcept, override));
58 MOCK_METHOD (
59 units::sample_t,
61 (),
62 (const, noexcept, override));
63};
64}
Interface for transport.
Definition itransport.h:17
virtual units::sample_t recording_preroll_frames_remaining() const noexcept=0
Frames remaining to preroll (playing back some time earlier before actually recording/rolling).
virtual bool recording_enabled() const noexcept=0
Returns whether recording is enabled.
virtual std::pair< units::sample_t, units::sample_t > get_loop_range_positions() const noexcept=0
Returns the loop range positions in samples.
virtual std::pair< units::sample_t, units::sample_t > get_punch_range_positions() const noexcept=0
Returns the punch recording range positions in samples.
virtual units::sample_t get_playhead_position_in_audio_thread() const noexcept=0
Get the playhead position.
virtual units::sample_t metronome_countin_frames_remaining() const noexcept=0
Frames remaining for metronome countin.
Interface for objects that can be processed in the DSP graph.
Definition graph_node.h:52
virtual nframes_t get_single_playback_latency() const
Returns the latency of only the given processable, without adding the previous/next latencies.
Definition graph_node.h:65
virtual utils::Utf8String get_node_name() const =0
Returns a human friendly name of the node.
virtual void prepare_for_processing(sample_rate_t sample_rate, nframes_t max_block_length)
Called to allocate resources required for processing.
Definition graph_node.h:77
virtual void release_resources()
Called to release resources allocated by prepare_for_processing().
Definition graph_node.h:91
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38
uint32_t sample_rate_t
Sample rate.
Definition types.h:61
uint32_t nframes_t
Frame count.
Definition types.h:58
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition types.h:136