mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
better imports
This commit is contained in:
+13
-13
@@ -1,27 +1,27 @@
|
|||||||
mod pw;
|
mod pw;
|
||||||
pub mod settings;
|
pub mod settings;
|
||||||
|
|
||||||
|
pub use settings::Settings;
|
||||||
|
|
||||||
use eframe::{CreationContext, Frame, NativeOptions};
|
use eframe::{CreationContext, Frame, NativeOptions};
|
||||||
use egui::{
|
use egui::{
|
||||||
Button, CentralPanel, ComboBox, Context, Label, ScrollArea, Separator, Slider, TextEdit, Ui,
|
Button, CentralPanel, ComboBox, Context, Label, ScrollArea, Separator, Slider, TextEdit, Ui,
|
||||||
Vec2,
|
Vec2,
|
||||||
};
|
};
|
||||||
use egui_material_icons::icons;
|
use egui_material_icons::icons;
|
||||||
|
|
||||||
use metadata::media_file::MediaFileMetadata;
|
use metadata::media_file::MediaFileMetadata;
|
||||||
use rfd::FileDialog;
|
use rfd::FileDialog;
|
||||||
use rodio::{Decoder, OutputStream, OutputStreamBuilder, Sink};
|
use rodio::{Decoder, OutputStream, OutputStreamBuilder, Sink};
|
||||||
pub use settings::Settings;
|
|
||||||
use std::{fs, path::PathBuf};
|
use std::{fs, path::PathBuf};
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Default)]
|
||||||
#[derive(Default)]
|
|
||||||
enum PlayerState {
|
enum PlayerState {
|
||||||
Playing,
|
Playing,
|
||||||
#[default]
|
#[default]
|
||||||
Paused,
|
Paused,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub struct App {
|
pub struct App {
|
||||||
saved_settings: Settings,
|
saved_settings: Settings,
|
||||||
|
|
||||||
@@ -329,15 +329,15 @@ impl App {
|
|||||||
|
|
||||||
if let Some(extension) = path.extension().and_then(|n| n.to_str())
|
if let Some(extension) = path.extension().and_then(|n| n.to_str())
|
||||||
&& music_extensions.contains(&extension.to_lowercase().as_str())
|
&& music_extensions.contains(&extension.to_lowercase().as_str())
|
||||||
&& path
|
&& path
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_string()
|
.to_string()
|
||||||
.to_lowercase()
|
.to_lowercase()
|
||||||
.contains(self.search_query.as_str())
|
.contains(self.search_query.as_str())
|
||||||
{
|
{
|
||||||
music_files.push(path);
|
music_files.push(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui.vertical(|ui| {
|
ui.vertical(|ui| {
|
||||||
let search_entry = TextEdit::singleline(&mut self.search_query);
|
let search_entry = TextEdit::singleline(&mut self.search_query);
|
||||||
|
|||||||
+1
-3
@@ -1,6 +1,4 @@
|
|||||||
use std::collections::HashMap;
|
use std::{collections::HashMap, error::Error, process::Command};
|
||||||
use std::error::Error;
|
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
pub struct AudioDevice {
|
pub struct AudioDevice {
|
||||||
pub nick: String,
|
pub nick: String,
|
||||||
|
|||||||
+6
-3
@@ -1,7 +1,10 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fs;
|
|
||||||
use std::io::{Read, Write};
|
use std::{
|
||||||
use std::path::PathBuf;
|
fs,
|
||||||
|
io::{Read, Write},
|
||||||
|
path::PathBuf,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
use std::fs;
|
|
||||||
|
|
||||||
mod app;
|
mod app;
|
||||||
|
|
||||||
|
use std::fs;
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
let settings = generate_settings();
|
let settings = generate_settings();
|
||||||
app::run(settings)
|
app::run(settings)
|
||||||
|
|||||||
Reference in New Issue
Block a user