Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 0ec8865

Browse files
piedoomdoomy
andauthored
Updated dependencies (#179)
* Updated dependencies * removed time dependency * removed trailing whitespace that was causing cargo fmt to crash * updating doomy's email while we're here Co-authored-by: doomy <2640792-_doomy@users.noreply.gitlab.com>
1 parent 20e1a1b commit 0ec8865

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = [
55
"Marko Mijalkovic <marko.mijalkovic97@gmail.com>",
66
"Boscop",
77
"Alex Zywicki <alexander.zywicki@gmail.com>",
8-
"doomy <alexander@resamplr.com>",
8+
"doomy <notdoomy@protonmail.com>",
99
"Ms2ger",
1010
"Rob Saunders",
1111
"David Lu",
@@ -34,12 +34,11 @@ log = "0.4"
3434
num-traits = "0.2"
3535
libc = "0.2"
3636
bitflags = "1"
37-
libloading = "0.5"
37+
libloading = "0.7"
3838
num_enum = "0.5.2"
3939

4040
[dev-dependencies]
41-
time = "0.1"
42-
rand = "0.7"
41+
rand = "0.8"
4342

4443
[[example]]
4544
name = "dimension_expander"

examples/dimension_expander.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#[macro_use]
44
extern crate vst;
5-
extern crate time;
65

76
use vst::buffer::AudioBuffer;
87
use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters};
@@ -11,6 +10,7 @@ use vst::util::AtomicFloat;
1110
use std::collections::VecDeque;
1211
use std::f64::consts::PI;
1312
use std::sync::Arc;
13+
use std::time::{SystemTime, UNIX_EPOCH};
1414

1515
/// Calculate the length in samples for a delay. Size ranges from 0.0 to 1.0.
1616
fn delay(index: usize, mut size: f32) -> isize {
@@ -153,7 +153,7 @@ impl Plugin for DimensionExpander {
153153
let mut right_processed = 0.0;
154154

155155
// Recalculate time per sample
156-
let time_s = time::precise_time_ns() as f64 / 1_000_000_000.0;
156+
let time_s = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs_f64();
157157

158158
// Use buffer index to offset volume LFO
159159
for (n, buffer) in self.buffers.iter_mut().enumerate() {

examples/gain_effect.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// author: doomy <alexander@resamplr.com>
1+
// author: doomy <notdoomy@protonmail.com>
22

33
#[macro_use]
44
extern crate vst;
5-
extern crate time;
65

76
use vst::buffer::AudioBuffer;
87
use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters};

src/host.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -412,22 +412,24 @@ impl<T: Host> PluginLoader<T> {
412412
/// `/Library/Audio/Plug-Ins/VST/iZotope Ozone 5.vst/Contents/MacOS/PluginHooksVST`
413413
pub fn load(path: &Path, host: Arc<Mutex<T>>) -> Result<PluginLoader<T>, PluginLoadError> {
414414
// Try loading the library at the given path
415-
let lib = match Library::new(path) {
416-
Ok(l) => l,
417-
Err(_) => return Err(PluginLoadError::InvalidPath),
418-
};
415+
unsafe {
416+
let lib = match Library::new(path) {
417+
Ok(l) => l,
418+
Err(_) => return Err(PluginLoadError::InvalidPath),
419+
};
419420

420-
Ok(PluginLoader {
421-
main: unsafe {
422-
// Search the library for the VSTAPI entry point
423-
match lib.get(b"VSTPluginMain") {
424-
Ok(s) => *s,
425-
_ => return Err(PluginLoadError::NotAPlugin),
426-
}
427-
},
428-
lib: Arc::new(lib),
429-
host,
430-
})
421+
Ok(PluginLoader {
422+
main:
423+
// Search the library for the VSTAPI entry point
424+
match lib.get(b"VSTPluginMain") {
425+
Ok(s) => *s,
426+
_ => return Err(PluginLoadError::NotAPlugin),
427+
}
428+
,
429+
lib: Arc::new(lib),
430+
host,
431+
})
432+
}
431433
}
432434

433435
/// Call the VST entry point and retrieve a (possibly null) pointer.

src/util/parameter_transfer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ mod tests {
142142
thread::spawn(move || {
143143
let mut values = vec![0f32; PARAMETERS];
144144
for _ in 0..UPDATES {
145-
let p: usize = t_rng.gen_range(0, PARAMETERS);
146-
let v: f32 = t_rng.gen_range(0.0, 1.0);
145+
let p: usize = t_rng.gen_range(0..PARAMETERS);
146+
let v: f32 = t_rng.gen_range(0.0..1.0);
147147
values[p] = v;
148148
t_transfer.set_parameter(p, v);
149149
}

0 commit comments

Comments
 (0)