Skip to content

Commit 4485d34

Browse files
committed
linker hell
1 parent 5c0835a commit 4485d34

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name = "scamble"
33
version = "0.1.0"
44
edition = "2024"
55

6-
[lib]
7-
crate-type = ["dylib"]
8-
96
[workspace]
107
members = ["tester", "tcp_effects", "cassette_player"]
118

@@ -16,4 +13,5 @@ hound = "3.5.1"
1613
bindgen = "0.71.1"
1714

1815
[features]
16+
default = []
1917
fmod_bindings = []

build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::{env, fs};
33
use std::path::PathBuf;
44

55
fn main() {
6-
println!("cargo:rustc-link-search=./libs/");
7-
println!("cargo:rustc-link-lib=fmod");
6+
// println!("cargo:rustc-link-search=./libs/");
7+
// println!("cargo:rustc-link-lib= fmod");
88

99
let bindings = bindgen::Builder::default()
1010
.header("libs/wrapper.h")
@@ -22,10 +22,10 @@ fn main() {
2222
.expect("Couldn't write bindings!");
2323

2424
// slightly hacky way to append the right link mode for windows
25-
let mut st = fs::read_to_string(target).expect("Couldn't update bindings!");
25+
/*let mut st = fs::read_to_string(target).expect("Couldn't update bindings!");
2626
st = st.replace(
2727
"unsafe extern \"C\" {",
2828
"#[cfg_attr(windows, link(name = \"fmod\", kind = \"raw-dylib\"))]\nunsafe extern \"C\" {"
2929
);
30-
fs::write(target, st).expect("Couldn't update bindings!");
30+
fs::write(target, st).expect("Couldn't update bindings!");*/
3131
}

cassette_player/src/cassette_player.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use scamble::dsp::signal::{Signal, SignalConst, SignalMut};
2-
use scamble::dsp::{Dsp, DspType, Parameter, ParameterType};
3-
use scamble::dsp::decode::decode_into;
41
use circular_buffer::CircularBuffer;
2+
use scamble::dsp::decode::decode_into;
3+
use scamble::dsp::signal::{Signal, SignalConst, SignalMut};
4+
use scamble::dsp::{Dsp, DspType, Parameter, ParameterType, ProcessResult};
55

66
#[derive(Copy, Clone)]
77
struct TrailingNote {
@@ -143,6 +143,10 @@ impl Dsp for CassettePlayer {
143143
self.prev_note_frac = 2.;
144144
}
145145

146+
fn should_process(&mut self, _: bool, _: usize) -> ProcessResult {
147+
ProcessResult::Continue
148+
}
149+
146150
fn preferred_out_channels(&self) -> Option<usize> {
147151
Some(2)
148152
}
@@ -154,7 +158,8 @@ impl Dsp for CassettePlayer {
154158

155159
// trigger new notes when parameter changes
156160
if self.note_frac != self.prev_note_frac {
157-
self.trailing_notes.push_back(self.note_at_pos(self.note_frac));
161+
self.trailing_notes
162+
.push_back(self.note_at_pos(self.note_frac));
158163
}
159164
self.prev_note_frac = self.note_frac;
160165

cassette_player/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use crate::cassette_player::CassettePlayer;
55

6-
use scamble::expose_dsp;
6+
use scamble::{expose_dsp, expose_dsp_list};
77

88
pub mod cassette_player;
99

10-
expose_dsp!(CassettePlayer);
10+
expose_dsp_list!(CassettePlayer);

src/dsp/interop.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,9 @@ extern "C" fn should_process_callback<D: Dsp>(
379379

380380
CUR_STATE = ptr::null_mut();
381381

382-
match result{
382+
match result {
383383
Ok(_) => FMOD_OK,
384-
Err(_) => {
385-
FMOD_ERR_PLUGIN
386-
}
384+
Err(_) => FMOD_ERR_PLUGIN
387385
}
388386
}
389387
}

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#![feature(macro_metavar_expr)]
33
#![feature(macro_metavar_expr_concat)]
44

5-
#[cfg(feature = "fmod_bindings")]
5+
/*#[cfg(feature = "fmod_bindings")]
66
pub mod fmod;
77
#[cfg(all(test, feature = "fmod_bindings"))]
8-
pub mod simulate;
8+
pub mod simulate;*/
99

1010
pub mod dsp;
1111
pub mod raw_bindings;

0 commit comments

Comments
 (0)