This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"app-id": "com.saivert.pwvucontrol", | |
"runtime": "org.gnome.Platform", | |
"runtime-version": "45", | |
"sdk": "org.gnome.Sdk", | |
"sdk-extensions": [ | |
"org.freedesktop.Sdk.Extension.rust-stable", | |
"org.freedesktop.Sdk.Extension.llvm16" | |
], | |
"command": "pwvucontrol", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide ourselves. | |
if node.name().unwrap_or_default() == "pwvucontrol-peak-detect" { | |
return; | |
} | |
// Hide any playback from pavucontrol (mainly volume control notification sound). | |
if node.name().unwrap_or_default() == "pavucontrol" { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct IndexGetter { | |
current_serial: u32, | |
tags: Vec<Tag>, | |
} | |
#[derive(Clone)] | |
struct Tag { | |
pub serial: u32, | |
pub tag: String, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0-or-later | |
use glib::{Properties, closure_local}; | |
use glib::subclass::prelude::*; | |
use gtk::{gio, prelude::*, subclass::prelude::*}; | |
use std::cell::RefCell; | |
use std::cell::OnceCell; | |
mod imp { | |
use super::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn properties() -> &'static [ParamSpec] { | |
static PROPERTIES: Lazy<Vec<ParamSpec>> = | |
Lazy::new(|| { | |
let props = vec![ | |
glib::ParamSpecEnum::builder::<crate::NodeType>("nodetype") | |
.default_value(NodeType::Undefined) | |
.build(), | |
]; | |
let derived_props = PwNodeObject::derived_properties(); | |
[props, derived_props.to_vec()].concat() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use crate::pwnodemodel::PwNodeModel; | |
use crate::pwnodeobject::PwNodeObject; | |
use gtk::{gio, glib, prelude::*, subclass::prelude::*}; | |
use std::cell::{Cell, RefCell}; | |
use wireplumber as wp; | |
mod imp { | |
use glib::Properties; | |
use super::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let listfactory = gtk::SignalListItemFactory::new(); | |
listfactory.connect_setup(|_, item| setup_handler(item, false)); | |
let dropdown = self.outputdevice_dropdown.get(); | |
listfactory.connect_bind(clone!(@weak dropdown => move |_factory, item| { | |
let item: gtk::ListItem = item.downcast_ref().cloned().unwrap(); | |
fn selected_item_handler(dropdown: >k::DropDown, listitem: >k::ListItem) { | |
if let Some (child) = listitem.child() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut v = vec![0u8; 1024]; | |
let mut b = spa::pod::builder::Builder::new(&mut v); | |
unsafe { | |
let mut f: MaybeUninit<spa::sys::spa_pod_frame> = MaybeUninit::zeroed(); | |
b.push_array(&mut f); | |
b.add_id(spa::utils::Id(spa::sys::SPA_AUDIO_CHANNEL_MONO)); | |
b.pop(f.assume_init_mut()); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl WidgetImpl for PwVolumeBox { | |
fn map(&self) { | |
self.parent_map(); | |
// Hack until I have a better way of getting at the scrolled window | |
// ListBox Box Viewport Scrolled window | |
let p = self.obj().parent().unwrap().parent().unwrap().parent().unwrap().parent().unwrap(); | |
let scrolledwindow: gtk::ScrolledWindow = p.downcast().expect("downcast to scrolled window"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
act.connect_activate(clone!(@weak self as widget => move |_action, _param| { | |
let dlg = gtk::AlertDialog::builder().buttons(["Yes", "No"]).message("hi").build(); | |
let c = gio::Cancellable::new(); | |
dlg.choose(Some(widget.obj().as_ref()), Some(&c), |x| { | |
match x { | |
Ok(x) => { wp::info!("got {x}"); }, | |
Err(_) => { wp::log::warning!("Err in dlg result"); } | |
} | |
}); |
NewerOlder