From be4d273fa8778ec87ad4a34502d0f3c75657fbbc Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Mon, 16 Nov 2020 23:26:11 +0100 Subject: change sound_effects to sound-effects --- mumd/Cargo.toml | 4 ++-- mumd/src/audio.rs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'mumd') diff --git a/mumd/Cargo.toml b/mumd/Cargo.toml index e124eb4..15aaed5 100644 --- a/mumd/Cargo.toml +++ b/mumd/Cargo.toml @@ -9,11 +9,11 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["notifications", "sound_effects"] +default = ["notifications", "sound-effects"] notifications = ["libnotify"] -sound_effects = ["hound", "samplerate"] +sound-effects = ["hound", "samplerate"] [dependencies] mumlib = { path = "../mumlib" } diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs index 2e9d1bd..d5617fc 100644 --- a/mumd/src/audio.rs +++ b/mumd/src/audio.rs @@ -1,14 +1,14 @@ pub mod input; pub mod output; -#[cfg(feature = "sound_effects")] +#[cfg(feature = "sound-effects")] use crate::audio::output::SaturatingAdd; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use cpal::{SampleFormat, SampleRate, Stream, StreamConfig}; use log::*; use mumble_protocol::voice::VoicePacketPayload; use opus::Channels; -#[cfg(feature = "sound_effects")] +#[cfg(feature = "sound-effects")] use samplerate::ConverterType; use std::collections::hash_map::Entry; use std::collections::{HashMap, VecDeque}; @@ -16,7 +16,7 @@ use std::sync::{Arc, Mutex}; use tokio::sync::{mpsc, watch}; //TODO? move to mumlib -#[cfg(feature = "sound_effects")] +#[cfg(feature = "sound-effects")] pub const EVENT_SOUNDS: &[(&str, NotificationEvents)] = &[ ("resources/connect.wav", NotificationEvents::ServerConnect), ( @@ -75,10 +75,10 @@ pub struct Audio { client_streams: Arc>>, - #[cfg(feature = "sound_effects")] + #[cfg(feature = "sound-effects")] sounds: HashMap>, - #[cfg(feature = "sound_effects")] + #[cfg(feature = "sound-effects")] play_sounds: Arc>>, } @@ -220,7 +220,7 @@ impl Audio { output_stream.play().unwrap(); - #[cfg(feature = "sound_effects")] + #[cfg(feature = "sound-effects")] let sounds = EVENT_SOUNDS .iter() .map(|(path, event)| { @@ -255,11 +255,11 @@ impl Audio { input_volume_sender, input_channel_receiver: Some(input_receiver), client_streams, - #[cfg(feature = "sound_effects")] + #[cfg(feature = "sound-effects")] sounds, output_volume_sender, user_volumes, - #[cfg(feature = "sound_effects")] + #[cfg(feature = "sound-effects")] play_sounds, } } @@ -343,7 +343,7 @@ impl Audio { } } - #[cfg(feature = "sound_effects")] + #[cfg(feature = "sound-effects")] pub fn play_effect(&self, effect: NotificationEvents) { let samples = self.sounds.get(&effect).unwrap(); @@ -357,6 +357,6 @@ impl Audio { play_sounds.extend(samples.iter().skip(l)); } - #[cfg(not(feature = "sound_effects"))] + #[cfg(not(feature = "sound-effects"))] pub fn play_effect(&self, _: NotificationEvents) {} } -- cgit v1.2.1