Rust 2021 and clap 3.0
This commit is contained in:
parent
682508405a
commit
8b99fce094
16 changed files with 21 additions and 20 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use super::alsa;
|
||||
use super::parking_lot::Mutex;
|
||||
use super::{Device, DeviceHandles};
|
||||
use {BackendSpecificError, DevicesError};
|
||||
use crate::{BackendSpecificError, DevicesError};
|
||||
|
||||
/// ALSA's implementation for `Devices`.
|
||||
pub struct Devices {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ extern crate parking_lot;
|
|||
|
||||
use self::alsa::poll::Descriptors;
|
||||
use self::parking_lot::Mutex;
|
||||
use crate::traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
use crate::{
|
||||
BackendSpecificError, BufferSize, BuildStreamError, ChannelCount, Data,
|
||||
DefaultStreamConfigError, DeviceNameError, DevicesError, InputCallbackInfo, OutputCallbackInfo,
|
||||
|
|
@ -16,7 +17,6 @@ use std::convert::TryInto;
|
|||
use std::sync::Arc;
|
||||
use std::thread::{self, JoinHandle};
|
||||
use std::vec::IntoIter as VecIntoIter;
|
||||
use traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
|
||||
pub use self::enumerate::{default_input_device, default_output_device, Devices};
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ trait Silence {
|
|||
/// Constraints on the ASIO sample types.
|
||||
trait AsioSample: Clone + Copy + Silence + std::ops::Add<Self, Output = Self> {
|
||||
fn to_cpal_sample<T: Sample>(&self) -> T;
|
||||
fn from_cpal_sample<T: Sample>(&T) -> Self;
|
||||
fn from_cpal_sample<T: Sample>(_: &T) -> Self;
|
||||
}
|
||||
|
||||
// Used to keep track of whether or not the current asio stream buffer requires
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::vec::IntoIter as VecIntoIter;
|
||||
|
||||
use DevicesError;
|
||||
use SupportedStreamConfigRange;
|
||||
use crate::DevicesError;
|
||||
use crate::SupportedStreamConfigRange;
|
||||
|
||||
use super::Device;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use self::coreaudio::sys::{
|
|||
};
|
||||
|
||||
use super::{asbd_from_config, frames_to_duration, host_time_to_stream_instant};
|
||||
use traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
use crate::traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
|
||||
use crate::{
|
||||
BackendSpecificError, BufferSize, BuildStreamError, Data, DefaultStreamConfigError,
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ use self::coreaudio::sys::{
|
|||
AudioObjectPropertyAddress, OSStatus,
|
||||
};
|
||||
use super::Device;
|
||||
use crate::{BackendSpecificError, DevicesError, SupportedStreamConfigRange};
|
||||
use std::mem;
|
||||
use std::ptr::null;
|
||||
use std::vec::IntoIter as VecIntoIter;
|
||||
use {BackendSpecificError, DevicesError, SupportedStreamConfigRange};
|
||||
|
||||
unsafe fn audio_devices() -> Result<Vec<AudioDeviceID>, OSStatus> {
|
||||
let property_address = AudioObjectPropertyAddress {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ use self::coreaudio::sys::{
|
|||
AudioStreamBasicDescription, OSStatus,
|
||||
};
|
||||
|
||||
use DefaultStreamConfigError;
|
||||
use {BuildStreamError, SupportedStreamConfigsError};
|
||||
use crate::DefaultStreamConfigError;
|
||||
use crate::{BuildStreamError, SupportedStreamConfigsError};
|
||||
|
||||
use crate::{BackendSpecificError, SampleFormat, StreamConfig};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ use stdweb::web::set_timeout;
|
|||
use stdweb::web::TypedArray;
|
||||
use stdweb::Reference;
|
||||
|
||||
use crate::traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
use crate::{
|
||||
BufferSize, BuildStreamError, Data, DefaultStreamConfigError, DeviceNameError, DevicesError,
|
||||
InputCallbackInfo, OutputCallbackInfo, PauseStreamError, PlayStreamError, SampleFormat,
|
||||
SampleRate, StreamConfig, StreamError, SupportedBufferSize, SupportedStreamConfig,
|
||||
SupportedStreamConfigRange, SupportedStreamConfigsError,
|
||||
};
|
||||
use traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
|
||||
// The emscripten backend currently works by instantiating an `AudioContext` object per `Stream`.
|
||||
// Creating a stream creates a new `AudioContext`. Destroying a stream destroys it. Creation of a
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use crate::traits::DeviceTrait;
|
||||
use crate::{
|
||||
BackendSpecificError, BuildStreamError, Data, DefaultStreamConfigError, DeviceNameError,
|
||||
InputCallbackInfo, OutputCallbackInfo, SampleFormat, SampleRate, StreamConfig, StreamError,
|
||||
|
|
@ -5,7 +6,6 @@ use crate::{
|
|||
SupportedStreamConfigsError,
|
||||
};
|
||||
use std::hash::{Hash, Hasher};
|
||||
use traits::DeviceTrait;
|
||||
|
||||
use super::stream::Stream;
|
||||
use super::JACK_SAMPLE_FORMAT;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
extern crate jack;
|
||||
|
||||
use crate::traits::HostTrait;
|
||||
use crate::{DevicesError, SampleFormat, SupportedStreamConfigRange};
|
||||
use traits::HostTrait;
|
||||
|
||||
mod device;
|
||||
pub use self::device::Device;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::traits::StreamTrait;
|
||||
use crate::ChannelCount;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use traits::StreamTrait;
|
||||
|
||||
use crate::{
|
||||
BackendSpecificError, Data, InputCallbackInfo, OutputCallbackInfo, PauseStreamError,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use crate::traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
use crate::{
|
||||
BuildStreamError, Data, DefaultStreamConfigError, DeviceNameError, DevicesError,
|
||||
InputCallbackInfo, OutputCallbackInfo, PauseStreamError, PlayStreamError, SampleFormat,
|
||||
StreamConfig, StreamError, SupportedStreamConfig, SupportedStreamConfigRange,
|
||||
SupportedStreamConfigsError,
|
||||
};
|
||||
use traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Devices;
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ pub use self::device::{
|
|||
};
|
||||
pub use self::stream::Stream;
|
||||
use self::winapi::um::winnt::HRESULT;
|
||||
use crate::traits::HostTrait;
|
||||
use crate::BackendSpecificError;
|
||||
use crate::DevicesError;
|
||||
use std::io::Error as IoError;
|
||||
use traits::HostTrait;
|
||||
use BackendSpecificError;
|
||||
use DevicesError;
|
||||
|
||||
mod com;
|
||||
mod device;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use self::js_sys::eval;
|
|||
use self::wasm_bindgen::prelude::*;
|
||||
use self::wasm_bindgen::JsCast;
|
||||
use self::web_sys::{AudioContext, AudioContextOptions};
|
||||
use crate::traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
use crate::{
|
||||
BackendSpecificError, BufferSize, BuildStreamError, Data, DefaultStreamConfigError,
|
||||
DeviceNameError, DevicesError, InputCallbackInfo, OutputCallbackInfo, PauseStreamError,
|
||||
|
|
@ -14,7 +15,6 @@ use crate::{
|
|||
};
|
||||
use std::ops::DerefMut;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
use traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
|
||||
/// Content is false if the iterator is empty.
|
||||
pub struct Devices(bool);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue