Skip to content

Commit 4ab13ec

Browse files
committed
Add standalone target for the gain example
1 parent a4135d5 commit 4ab13ec

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

examples/gain-plugin/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ standalone = ["plinth-plugin/standalone"]
99
[lib]
1010
crate-type = ["cdylib", "lib", "staticlib"]
1111

12+
[[bin]]
13+
name = "gain-standalone"
14+
path = "src/main.rs"
15+
required-features = ["standalone"]
16+
1217
[dependencies]
1318
plinth-derive.workspace = true
1419
plinth-plugin.workspace = true

examples/gain-plugin/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
use gain_plugin::GainPlugin;
2+
3+
plinth_plugin::export_standalone!(GainPlugin);

examples/gain-plugin/src/plugin.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::editor::{EditorSettings, GainPluginEditor};
1212
use crate::{parameters::GainParameters, processor::GainPluginProcessor};
1313

1414
#[derive(Default)]
15-
struct GainPlugin {
15+
pub struct GainPlugin {
1616
parameters: Rc<GainParameters>,
1717
editor_settings: Rc<RefCell<EditorSettings>>,
1818
}
@@ -88,3 +88,6 @@ impl Vst3Plugin for GainPlugin {
8888

8989
export_clap!(GainPlugin);
9090
export_vst3!(GainPlugin);
91+
92+
#[cfg(feature = "standalone")]
93+
impl plinth_plugin::standalone::StandalonePlugin for GainPlugin {}

0 commit comments

Comments
 (0)