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#include "dsp/tempo_map.h"
9
10#include <gmock/gmock.h>
11
12namespace zrythm::dsp::graph_test
13{
15{
16public:
17 MOCK_METHOD (utils::Utf8String, get_node_name, (), (const, override));
18 MOCK_METHOD (
19 units::sample_u32_t,
21 (),
22 (const, override));
23 MOCK_METHOD (
24 void,
26 (const graph::GraphNode *, units::sample_rate_t, units::sample_u32_t),
27 (override));
28 MOCK_METHOD (
29 void,
30 process_block,
32 const dsp::ITransport &,
33 const dsp::TempoMap &),
34 (noexcept, override));
35 MOCK_METHOD (void, release_resources, (), (override));
36};
37
39{
40public:
41 MOCK_METHOD (
42 (std::pair<units::sample_t, units::sample_t>),
44 (),
45 (const, noexcept, override));
46 MOCK_METHOD (
47 (std::pair<units::sample_t, units::sample_t>),
49 (),
50 (const, noexcept, override));
51 MOCK_METHOD (PlayState, get_play_state, (), (const, noexcept, override));
52 MOCK_METHOD (
53 units::sample_t,
55 (),
56 (const, noexcept, override));
57 MOCK_METHOD (bool, loop_enabled, (), (const, noexcept, override));
58 MOCK_METHOD (bool, punch_enabled, (), (const, noexcept, override));
59 MOCK_METHOD (bool, recording_enabled, (), (const, noexcept, override));
60 MOCK_METHOD (
61 units::sample_t,
63 (),
64 (const, noexcept, override));
65 MOCK_METHOD (
66 units::sample_t,
68 (),
69 (const, noexcept, override));
70};
71}
Interface for transport.
Definition itransport.h:16
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.
Represents a node in a DSP graph.
Definition graph_node.h:160
Interface for objects that can be processed in the DSP graph.
Definition graph_node.h:86
virtual void prepare_for_processing(const GraphNode *node, units::sample_rate_t sample_rate, units::sample_u32_t max_block_length)
Called to allocate resources required for processing.
Definition graph_node.h:112
virtual utils::Utf8String get_node_name() const =0
Returns a human friendly name of the node.
virtual void release_resources()
Called to release resources allocated by prepare_for_processing().
Definition graph_node.h:130
virtual units::sample_u32_t get_single_playback_latency() const
Returns the latency of only the given processable, without adding the previous/next latencies (zero l...
Definition graph_node.h:99
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:37
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition graph_node.h:51