From 8b38c29bb8f25d81bbc6ccf93b6575a7b17a1401 Mon Sep 17 00:00:00 2001 From: doomy Date: Sat, 26 Feb 2022 21:29:30 -0600 Subject: [PATCH] Version 0.3.0 (#180) * See changelog for change details Co-authored-by: doomy <2640792-_doomy@users.noreply.gitlab.com> --- CHANGELOG.md | 24 ++++++++++++++++++++++++ Cargo.toml | 3 ++- README.md | 6 +++--- src/api.rs | 10 ++++++---- src/buffer.rs | 7 +++---- src/cache.rs | 3 +-- src/channels.rs | 4 ++-- src/event.rs | 2 +- src/host.rs | 17 +++++++++-------- src/interfaces.rs | 16 ++++++++-------- src/lib.rs | 9 +++++---- src/plugin.rs | 24 ++++++++++++------------ src/prelude.rs | 10 +++++----- 13 files changed, 81 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b7ddf93..93f8dcf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.3.0 + +### Fixed + +- `SysExEvent` no longer contains invalid data on 64-bit systems ([#170](https://github.com/RustAudio/vst-rs/pull/171)] +- Function pointers in `AEffect` marked as `extern` ([#141](https://github.com/RustAudio/vst-rs/pull/141)) +- Key character fixes ([#152](https://github.com/RustAudio/vst-rs/pull/152)) +- Doc and deploy actions fixes ([9eb1bef](https://github.com/RustAudio/vst-rs/commit/9eb1bef1826db1581b4162081de05c1090935afb)) +- Various doc fixes ([#177](https://github.com/RustAudio/vst-rs/pull/177)) + +### Added + +- `begin_edit` and `end_edit` now in `Host` trait ([#151](https://github.com/RustAudio/vst-rs/pull/151)) +- Added a `prelude` for commonly used items when constructing a `Plugin` ([#161](https://github.com/RustAudio/vst-rs/pull/161)) +- Various useful implementations for `AtomicFloat` ([#150](https://github.com/RustAudio/vst-rs/pull/150)) + +### Changed + +- **Major breaking change:** New `Plugin` `Send` requirement ([#140](https://github.com/RustAudio/vst-rs/pull/140)) +- No longer require `Plugin` to implement `Default` ([#154](https://github.com/RustAudio/vst-rs/pull/154)) +- `impl_clicke` replaced with `num_enum` ([#168](https://github.com/RustAudio/vst-rs/pull/168)) +- Reworked `SendEventBuffer` to make it useable in `Plugin::process_events` ([#160](https://github.com/RustAudio/vst-rs/pull/160)) +- Updated dependencies and removed development dependency on `time` ([#179](https://github.com/RustAudio/vst-rs/pull/179)) + ## 0.2.1 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index bf188dac..06b23615 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "vst" -version = "0.2.1" +version = "0.3.0" +edition = "2021" authors = [ "Marko Mijalkovic ", "Boscop", diff --git a/README.md b/README.md index a4ee1030..ffc990d6 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ include the crate directly from the official [Github repository](https://github. ```toml # get from crates.io. -vst = "0.2.1" +vst = "0.3" ``` ```toml # get directly from Github. This might be unstable! @@ -46,7 +46,7 @@ A simple plugin that bears no functionality. The provided `Cargo.toml` has a #[macro_use] extern crate vst; -use vst::plugin::{HostCallback, Info, Plugin}; +use vst::prelude::*; struct BasicPlugin; @@ -92,7 +92,7 @@ crate-type = ["cdylib"] #### Packaging on OS X -On OS X VST plugins are packaged inside of loadable bundles. +On OS X VST plugins are packaged inside loadable bundles. To package your VST as a loadable bundle you may use the `osx_vst_bundler.sh` script this library provides.  Example:  diff --git a/src/api.rs b/src/api.rs index b365a1a5..44a1a78a 100644 --- a/src/api.rs +++ b/src/api.rs @@ -4,8 +4,10 @@ use std::os::raw::c_void; use std::sync::Arc; use self::consts::*; -use editor::Editor; -use plugin::{Info, Plugin, PluginParameters}; +use crate::{ + editor::Editor, + plugin::{Info, Plugin, PluginParameters}, +}; /// Constant values #[allow(missing_docs)] // For obvious constants @@ -473,10 +475,10 @@ impl Events { /// ``` #[inline] #[allow(clippy::needless_lifetimes)] - pub fn events<'a>(&'a self) -> impl Iterator> { + pub fn events<'a>(&'a self) -> impl Iterator> { self.events_raw() .iter() - .map(|ptr| unsafe { ::event::Event::from_raw_event(*ptr) }) + .map(|ptr| unsafe { crate::event::Event::from_raw_event(*ptr) }) } } diff --git a/src/buffer.rs b/src/buffer.rs index 7bde57d8..9a32d789 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -293,7 +293,7 @@ impl<'a, 'b, T: Sized> IntoIterator for &'b mut Outputs<'a, T> { } } -use event::{Event, MidiEvent, SysExEvent}; +use crate::event::{Event, MidiEvent, SysExEvent}; /// This is used as a placeholder to pre-allocate space for a fixed number of /// midi events in the re-useable `SendEventBuffer`, because `SysExEvent` is @@ -368,8 +368,7 @@ impl<'a> WriteIntoPlaceholder for Event<'a> { } } -use api; -use host::Host; +use crate::{api, host::Host}; use std::mem; /// This buffer is used for sending midi events through the VST interface. @@ -482,7 +481,7 @@ impl SendEventBuffer { #[cfg(test)] mod tests { - use buffer::AudioBuffer; + use crate::buffer::AudioBuffer; /// Size of buffers used in tests. const SIZE: usize = 1024; diff --git a/src/cache.rs b/src/cache.rs index a6006c19..f6a1fd2e 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,7 +1,6 @@ use std::sync::Arc; -use editor::Editor; -use plugin::{Info, PluginParameters}; +use crate::{editor::Editor, prelude::*}; pub(crate) struct PluginCache { pub info: Info, diff --git a/src/channels.rs b/src/channels.rs index a4e79a25..e72879fd 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -1,8 +1,8 @@ //! Meta data for dealing with input / output channels. Not all hosts use this so it is not //! necessary for plugin functionality. -use api; -use api::consts::{MAX_LABEL, MAX_SHORT_LABEL}; +use crate::api; +use crate::api::consts::{MAX_LABEL, MAX_SHORT_LABEL}; /// Information about an input / output channel. This isn't necessary for a channel to function but /// informs the host how the channel is meant to be used. diff --git a/src/event.rs b/src/event.rs index 5286f83c..580fd54a 100644 --- a/src/event.rs +++ b/src/event.rs @@ -3,7 +3,7 @@ use std::{mem, slice}; -use api; +use crate::api; /// A VST event. #[derive(Copy, Clone)] diff --git a/src/host.rs b/src/host.rs index c367512d..2ed684f6 100644 --- a/src/host.rs +++ b/src/host.rs @@ -14,13 +14,14 @@ use std::path::Path; use std::sync::{Arc, Mutex}; use std::{fmt, ptr, slice}; -use api::consts::*; -use api::{self, AEffect, PluginFlags, PluginMain, Supported, TimeInfo}; -use buffer::AudioBuffer; -use channels::ChannelInfo; -use editor::{Editor, Rect}; -use interfaces; -use plugin::{self, Category, HostCallback, Info, Plugin, PluginParameters}; +use crate::{ + api::{self, consts::*, AEffect, PluginFlags, PluginMain, Supported, TimeInfo}, + buffer::AudioBuffer, + channels::ChannelInfo, + editor::{Editor, Rect}, + interfaces, + plugin::{self, Category, HostCallback, Info, Plugin, PluginParameters}, +}; #[repr(i32)] #[derive(Clone, Copy, Debug, TryFromPrimitive, IntoPrimitive)] @@ -932,7 +933,7 @@ extern "C" fn callback_wrapper( #[cfg(test)] mod tests { - use host::HostBuffer; + use crate::host::HostBuffer; #[test] fn host_buffer() { diff --git a/src/interfaces.rs b/src/interfaces.rs index b3e74895..6b5261e7 100644 --- a/src/interfaces.rs +++ b/src/interfaces.rs @@ -3,15 +3,15 @@ #![doc(hidden)] use std::cell::Cell; -use std::convert::TryFrom; use std::os::raw::{c_char, c_void}; use std::{mem, slice}; -use api::consts::*; -use api::{self, AEffect, TimeInfo}; -use buffer::AudioBuffer; -use editor::{Key, KeyCode, KnobMode, Rect}; -use host::Host; +use crate::{ + api::{self, consts::*, AEffect, TimeInfo}, + buffer::AudioBuffer, + editor::{Key, KeyCode, KnobMode, Rect}, + host::Host, +}; /// Deprecated process function. pub extern "C" fn process_deprecated( @@ -88,7 +88,7 @@ pub extern "C" fn dispatch( ptr: *mut c_void, opt: f32, ) -> isize { - use plugin::{CanDo, OpCode}; + use crate::plugin::{CanDo, OpCode}; // Convert passed in opcode to enum let opcode = OpCode::try_from(opcode); @@ -307,7 +307,7 @@ pub fn host_dispatch( ptr: *mut c_void, opt: f32, ) -> isize { - use host::OpCode; + use crate::host::OpCode; let opcode = OpCode::try_from(opcode); match opcode { diff --git a/src/lib.rs b/src/lib.rs index 7f311874..b0c26de3 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -267,10 +267,11 @@ mod tests { use std::os::raw::c_void; - use api::consts::VST_MAGIC; - use api::AEffect; - use interfaces; - use plugin::{HostCallback, Info, Plugin}; + use crate::{ + api::{consts::VST_MAGIC, AEffect}, + interfaces, + plugin::{HostCallback, Info, Plugin}, + }; struct TestPlugin; diff --git a/src/plugin.rs b/src/plugin.rs index c68995ab..8c9be409 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -6,13 +6,13 @@ use std::os::raw::c_void; use std::ptr; use std::sync::Arc; -use api; -use api::consts::VST_MAGIC; -use api::{AEffect, HostCallbackProc, Supported, TimeInfo}; -use buffer::AudioBuffer; -use channels::ChannelInfo; -use editor::Editor; -use host::{self, Host}; +use crate::{ + api::{self, consts::VST_MAGIC, AEffect, HostCallbackProc, Supported, TimeInfo}, + buffer::AudioBuffer, + channels::ChannelInfo, + editor::Editor, + host::{self, Host}, +}; /// Plugin type. Generally either Effect or Synth. /// @@ -968,7 +968,7 @@ impl Host for HostCallback { mod tests { use std::ptr; - use plugin; + use crate::plugin; /// Create a plugin instance. /// @@ -978,10 +978,10 @@ mod tests { use std::convert::TryFrom; use std::os::raw::c_void; - use main; - use api::AEffect; - use host::{Host, OpCode}; - use plugin::{HostCallback, Info, Plugin}; + use crate::main; + use crate::api::AEffect; + use crate::host::{Host, OpCode}; + use crate::plugin::{HostCallback, Info, Plugin}; $(#[$attr]) * struct TestPlugin { diff --git a/src/prelude.rs b/src/prelude.rs index 3e76ff88..dda5705e 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -1,12 +1,12 @@ //! A collection of commonly used items for implement a Plugin #[doc(no_inline)] -pub use api::{Events, Supported}; +pub use crate::api::{Events, Supported}; #[doc(no_inline)] -pub use buffer::{AudioBuffer, SendEventBuffer}; +pub use crate::buffer::{AudioBuffer, SendEventBuffer}; #[doc(no_inline)] -pub use event::{Event, MidiEvent}; +pub use crate::event::{Event, MidiEvent}; #[doc(no_inline)] -pub use plugin::{CanDo, Category, HostCallback, Info, Plugin, PluginParameters}; +pub use crate::plugin::{CanDo, Category, HostCallback, Info, Plugin, PluginParameters}; #[doc(no_inline)] -pub use util::{AtomicFloat, ParameterTransfer}; +pub use crate::util::{AtomicFloat, ParameterTransfer};