Skip to content

Commit

Permalink
Add port/route dropdown to sinks.
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed Apr 28, 2024
1 parent 900cc26 commit 7127c3e
Show file tree
Hide file tree
Showing 17 changed files with 723 additions and 82 deletions.
1 change: 1 addition & 0 deletions data/resources/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<file preprocess="xml-stripblanks" alias="gtk/sinkbox.ui">ui/sinkbox.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/outputbox.ui">ui/outputbox.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/profile-dropdown.ui">ui/profile-dropdown.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/route-dropdown.ui">ui/route-dropdown.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/devicebox.ui">ui/devicebox.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/profilerow.ui">ui/profilerow.ui</file>
<file>ui/levelbar.css</file>
Expand Down
20 changes: 20 additions & 0 deletions data/resources/ui/route-dropdown.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<interface>
<requires lib="gtk" version="4.0" />
<requires lib="Adw" version="1.0" />
<template class="PwRouteDropDown" parent="GtkWidget">
<property name="layout-manager">
<object class="GtkBinLayout" />
</property>
<child>
<object class="GtkDropDown" id="route_dropdown">
<property name="hexpand">0</property>
<property name="valign">center</property>
<style>
<class name="suffixes" />
</style>
</object>
</child>
</template>
</interface>
9 changes: 9 additions & 0 deletions data/resources/ui/sinkbox.ui
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="onlabel">
<property name="label" translatable="yes">Port:</property>
</object>
</child>
<child>
<object class="PwRouteDropDown" id="route_dropdown">
</object>
</child>
<child>
<object class="GtkToggleButton" id="default_sink_toggle">
<property name="hexpand">0</property>
Expand Down
10 changes: 9 additions & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
mod paramavailability;
mod pwchannelobject;
mod manager;
mod pwdeviceobject;
mod pwprofileobject;
mod pwnodemodel;
mod pwnodeobject;
mod pwrouteobject;
mod routedirection;
mod pwroutefiltermodel;

pub use paramavailability::ParamAvailability;
pub use pwchannelobject::PwChannelObject;
pub use manager::PwvucontrolManager;
pub use pwdeviceobject::PwDeviceObject;
pub use pwprofileobject::{PwProfileObject, ProfileAvailability};
pub use pwprofileobject::PwProfileObject;
pub use pwnodemodel::PwNodeModel;
pub use pwnodeobject::{PwNodeObject, NodeType};
pub use pwrouteobject::PwRouteObject;
pub use routedirection::RouteDirection;
pub use pwroutefiltermodel::PwRouteFilterModel;
18 changes: 18 additions & 0 deletions src/backend/paramavailability.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#[derive(Debug, Copy, Clone, PartialEq, Eq, glib::Enum, Default)]
#[enum_type(name = "ProfileAvailability")]
pub enum ParamAvailability {
#[default]
Unknown,
No,
Yes
}

impl From<u32> for ParamAvailability {
fn from(value: u32) -> Self {
match value {
1 => ParamAvailability::No,
2 => ParamAvailability::Yes,
_ => ParamAvailability::Unknown,
}
}
}
Loading

0 comments on commit 7127c3e

Please sign in to comment.