Skip to content

Commit

Permalink
Version 0.3.0 (RustAudio#180)
Browse files Browse the repository at this point in the history
* See changelog for change details

Co-authored-by: doomy <[email protected]>
  • Loading branch information
piedoom and doomy authored Feb 27, 2022
1 parent c3acb39 commit 8b38c29
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 54 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "vst"
version = "0.2.1"
version = "0.3.0"
edition = "2021"
authors = [
"Marko Mijalkovic <[email protected]>",
"Boscop",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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;

Expand Down Expand Up @@ -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: 
Expand Down
10 changes: 6 additions & 4 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -473,10 +475,10 @@ impl Events {
/// ```
#[inline]
#[allow(clippy::needless_lifetimes)]
pub fn events<'a>(&'a self) -> impl Iterator<Item = ::event::Event<'a>> {
pub fn events<'a>(&'a self) -> impl Iterator<Item = crate::event::Event<'a>> {
self.events_raw()
.iter()
.map(|ptr| unsafe { ::event::Event::from_raw_event(*ptr) })
.map(|ptr| unsafe { crate::event::Event::from_raw_event(*ptr) })
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/cache.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/channels.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use std::{mem, slice};

use api;
use crate::api;

/// A VST event.
#[derive(Copy, Clone)]
Expand Down
17 changes: 9 additions & 8 deletions src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -932,7 +933,7 @@ extern "C" fn callback_wrapper<T: Host>(

#[cfg(test)]
mod tests {
use host::HostBuffer;
use crate::host::HostBuffer;

#[test]
fn host_buffer() {
Expand Down
16 changes: 8 additions & 8 deletions src/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
24 changes: 12 additions & 12 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -968,7 +968,7 @@ impl Host for HostCallback {
mod tests {
use std::ptr;

use plugin;
use crate::plugin;

/// Create a plugin instance.
///
Expand All @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -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};

0 comments on commit 8b38c29

Please sign in to comment.