Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
internal_plugin_base.h
1// SPDX-FileCopyrightText: © 2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "plugins/plugin.h"
7
8namespace zrythm::plugins
9{
10
17{
18 Q_OBJECT
19 QML_ELEMENT
20 QML_UNCREATABLE ("")
21
22public:
32 StateDirectoryParentPathProvider state_path_provider,
33 QObject * parent = nullptr);
34
35 ~InternalPluginBase () override;
36
37protected:
38 // Plugin interface implementation
39 void save_state (std::optional<fs::path> abs_state_dir) override;
40 void load_state (std::optional<fs::path> abs_state_dir) override;
41
42 void prepare_for_processing_impl (
43 sample_rate_t sample_rate,
44 nframes_t max_block_length) override;
45
46 void process_impl (EngineProcessTimeInfo time_info) noexcept override;
47};
48
49} // namespace zrythm::plugins
void load_state(std::optional< fs::path > abs_state_dir) override
Load the state from the default directory or from abs_state_dir if given.
InternalPluginBase(dsp::ProcessorBase::ProcessorBaseDependencies dependencies, StateDirectoryParentPathProvider state_path_provider, QObject *parent=nullptr)
Constructor for InternalPluginBase.
void save_state(std::optional< fs::path > abs_state_dir) override
Saves the state inside the standard state directory.
Plugin(ProcessorBaseDependencies dependencies, StateDirectoryParentPathProvider state_path_provider, QObject *parent)
Creates/initializes a plugin and its internal plugin (LV2, etc.) using the given setting.
std::function< fs::path()> StateDirectoryParentPathProvider
Returns the parent path where the plugin should save its state directory in (or load it).
Definition plugin.h:48
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