Cleanup
This commit is contained in:
parent
a74c3d2a3d
commit
5556ea70df
3 changed files with 26 additions and 14 deletions
|
@ -6,10 +6,10 @@ use mpd::{Client, Query, Song, State, Term};
|
|||
use std::time::Duration;
|
||||
|
||||
pub trait Noise {
|
||||
fn noise_find(&mut self, query: &Vec<String>, max: Option<u32>, append: bool);
|
||||
fn noise_search(&mut self, query: &Vec<String>, max: Option<u32>);
|
||||
fn noise_crossfade(&mut self, seconds: Option<i64>);
|
||||
fn noise_play(&mut self, track: Option<u32>);
|
||||
fn find(&mut self, query: &Vec<String>, max: Option<u32>, append: bool);
|
||||
fn search(&mut self, query: &Vec<String>, max: Option<u32>);
|
||||
fn crossfade(&mut self, seconds: Option<i64>);
|
||||
fn play(&mut self, track: Option<u32>);
|
||||
fn toggle(&mut self);
|
||||
fn munch(&mut self);
|
||||
fn length(&mut self);
|
||||
|
@ -21,10 +21,11 @@ pub trait Noise {
|
|||
fn shuf(&mut self);
|
||||
fn get_status(&mut self, verbose: bool) -> String;
|
||||
fn list_queue(&mut self, file: bool, _verbose: bool);
|
||||
// fn get_art(&mut self);
|
||||
}
|
||||
|
||||
impl Noise for Client {
|
||||
fn noise_find(&mut self, query: &Vec<String>, max: Option<u32>, append: bool) {
|
||||
fn find(&mut self, query: &Vec<String>, max: Option<u32>, append: bool) {
|
||||
let query = query.join(" ");
|
||||
let max = max.unwrap_or(self.stats().unwrap().songs);
|
||||
|
||||
|
@ -38,7 +39,7 @@ impl Noise for Client {
|
|||
}
|
||||
}
|
||||
|
||||
fn noise_search(&mut self, query: &Vec<String>, max: Option<u32>) {
|
||||
fn search(&mut self, query: &Vec<String>, max: Option<u32>) {
|
||||
let query = query.join(" ");
|
||||
let max = max.unwrap_or(self.stats().unwrap().songs);
|
||||
|
||||
|
@ -48,7 +49,7 @@ impl Noise for Client {
|
|||
.for_each(|x| println!("{}", x.file));
|
||||
}
|
||||
|
||||
fn noise_crossfade(&mut self, seconds: Option<i64>) {
|
||||
fn crossfade(&mut self, seconds: Option<i64>) {
|
||||
if let Some(seconds) = seconds {
|
||||
self.crossfade(seconds).unwrap();
|
||||
} else {
|
||||
|
@ -62,7 +63,7 @@ impl Noise for Client {
|
|||
}
|
||||
}
|
||||
|
||||
fn noise_play(&mut self, track: Option<u32>) {
|
||||
fn play(&mut self, track: Option<u32>) {
|
||||
if let Some(i) = track {
|
||||
self.switch(i).unwrap();
|
||||
} else {
|
||||
|
@ -185,6 +186,11 @@ impl Noise for Client {
|
|||
|
||||
output.join("\n")
|
||||
}
|
||||
|
||||
// fn get_art(&mut self) {
|
||||
// let current_song = self.currentsong().unwrap().unwrap().file;
|
||||
// self.albumart(¤t_song).unwrap();
|
||||
// }
|
||||
}
|
||||
|
||||
fn format_song(song: Song) -> String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue