mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-12-15 10:01:39 +01:00
chore: snake_case all but UI templates
This commit is contained in:
parent
9f0ca6e8bf
commit
391182607d
55 changed files with 1471 additions and 1427 deletions
|
|
@ -1,95 +0,0 @@
|
|||
use adw::{ActionRow, ComboRow, PreferencesGroup};
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::time::SystemTime;
|
||||
|
||||
use crate::components::base::listEntry::ListEntry;
|
||||
use crate::components::output::inputStreamEntry::InputStreamEntry;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, Box, Button, CheckButton, CompositeTemplate, Label, StringList, TemplateChild};
|
||||
use gtk::{prelude::*, ProgressBar, Scale};
|
||||
use ReSet_Lib::audio::audio::Sink;
|
||||
|
||||
use super::sinkBox;
|
||||
use super::sinkEntry::SinkEntry;
|
||||
|
||||
type SinkEntryMap = Arc<RwLock<HashMap<u32, (Arc<ListEntry>, Arc<SinkEntry>, String)>>>;
|
||||
type InputStreamEntryMap = Arc<RwLock<HashMap<u32, (Arc<ListEntry>, Arc<InputStreamEntry>)>>>;
|
||||
type SinkMap = Arc<RwLock<HashMap<String, (u32, u32, String)>>>;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetAudioOutput.ui")]
|
||||
pub struct SinkBox {
|
||||
#[template_child]
|
||||
pub resetSinksRow: TemplateChild<ActionRow>,
|
||||
#[template_child]
|
||||
pub resetCardsRow: TemplateChild<ActionRow>,
|
||||
#[template_child]
|
||||
pub resetSinkDropdown: TemplateChild<ComboRow>,
|
||||
#[template_child]
|
||||
pub resetSinkMute: TemplateChild<Button>,
|
||||
#[template_child]
|
||||
pub resetVolumeSlider: TemplateChild<Scale>,
|
||||
#[template_child]
|
||||
pub resetVolumePercentage: TemplateChild<Label>,
|
||||
#[template_child]
|
||||
pub resetVolumeMeter: TemplateChild<ProgressBar>,
|
||||
#[template_child]
|
||||
pub resetSinks: TemplateChild<Box>,
|
||||
#[template_child]
|
||||
pub resetInputStreamButton: TemplateChild<ActionRow>,
|
||||
#[template_child]
|
||||
pub resetInputStreams: TemplateChild<Box>,
|
||||
#[template_child]
|
||||
pub resetInputCardsBackButton: TemplateChild<ActionRow>,
|
||||
#[template_child]
|
||||
pub resetCards: TemplateChild<PreferencesGroup>,
|
||||
pub resetDefaultCheckButton: Arc<CheckButton>,
|
||||
pub resetDefaultSink: Arc<RefCell<Sink>>,
|
||||
pub resetSinkList: SinkEntryMap,
|
||||
pub resetInputStreamList: InputStreamEntryMap,
|
||||
pub resetModelList: Arc<RwLock<StringList>>,
|
||||
pub resetModelIndex: Arc<RwLock<u32>>,
|
||||
// first u32 is the index of the sink, the second the index in the model list and the third is
|
||||
// the full name
|
||||
pub resetSinkMap: SinkMap,
|
||||
pub volumeTimeStamp: RefCell<Option<SystemTime>>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for SinkBox {
|
||||
const ABSTRACT: bool = false;
|
||||
const NAME: &'static str = "resetAudioOutput";
|
||||
type Type = sinkBox::SinkBox;
|
||||
type ParentType = gtk::Box;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
InputStreamEntry::ensure_type();
|
||||
SinkEntry::ensure_type();
|
||||
ListEntry::ensure_type();
|
||||
klass.bind_template();
|
||||
}
|
||||
|
||||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||
obj.init_template();
|
||||
}
|
||||
}
|
||||
|
||||
impl BoxImpl for SinkBox {}
|
||||
|
||||
impl ObjectImpl for SinkBox {
|
||||
fn constructed(&self) {
|
||||
let obj = self.obj();
|
||||
obj.setupCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
impl ListBoxRowImpl for SinkBox {}
|
||||
|
||||
impl WidgetImpl for SinkBox {}
|
||||
|
||||
impl WindowImpl for SinkBox {}
|
||||
|
||||
impl ApplicationWindowImpl for SinkBox {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue