Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
3 changes: 3 additions & 0 deletions data/css/panel-mixer-dim-mute.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.wf-panel .mixer-popover .muted {
opacity: 0.5;
}
3 changes: 0 additions & 3 deletions data/css/panel-wp-mixer-dim-mute.css

This file was deleted.

30 changes: 15 additions & 15 deletions metadata/panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ If full_span is off, both sides of the panel will take the same amount of space,
</option>
</group>
<group>
<_short>Audio mixer (wireplumber)</_short>
<option name="wp_quick_target_choice" type="string">
<_short>Audio mixer</_short>
<option name="mixer_quick_target_choice" type="string">
<_short>Quick action target</_short>
<_long>Which audio control will be the target of the quick actions (scrolling and muting on the widget)</_long>
<default>default_sink</default>
Expand All @@ -360,47 +360,47 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_name>Last changed volume</_name>
</desc>
</option>
<option name="wp_popup_on_change" type="bool">
<option name="mixer_popup_on_change" type="bool">
<_short>Pop up on change</_short>
<_long>Whether to show a popup with the new values upon a change to the quick action target</_long>
<default>true</default>
</option>
<option name="wp_popup_timeout" type="double">
<option name="mixer_popup_timeout" type="double">
<_short>Popup timeout</_short>
<default>2.5</default>
<min>0</min>
</option>
<option name="wp_slider_length" type="int">
<option name="mixer_slider_length" type="int">
<_short>Slider length</_short>
<default>300</default>
<min>1</min>
</option>
<option name="wp_scroll_sensitivity" type="double">
<option name="mixer_scroll_sensitivity" type="double">
<_short>Scroll sensitivity</_short>
<default>1</default>
<min>0</min>
</option>
<option name="wp_invert_scroll" type="bool">
<option name="mixer_invert_scroll" type="bool">
<_short>Invert scroll</_short>
<_long>Inverts which scroll direction raises and lowers volume</_long>
<default>false</default>
</option>
<option name="wp_icons_on_left" type="bool">
<option name="mixer_icons_on_left" type="bool">
<_short>Icons on left</_short>
<_long>Displays the mute and set default icon on the left</_long>
<default>false</default>
</option>
<option name="wp_stack_categories" type="bool">
<option name="mixer_stack_categories" type="bool">
<_short>Stack categories</_short>
<_long>Displays the outputs, inputs and streams stacked on top of each other instead of side by side</_long>
<default>false</default>
</option>
<option name="wp_spacing" type="int">
<option name="mixer_spacing" type="int">
<_short>Spacing between controls</_short>
<default>8</default>
<min>0</min>
</option>
<option name="wp_left_click_action" type="string">
<option name="mixer_left_click_action" type="string">
<_short>Left click action</_short>
<default>show_mixer</default>
<desc>
Expand All @@ -412,7 +412,7 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_name>Show quick action target</_name>
</desc>
</option>
<option name="wp_middle_click_action" type="string">
<option name="mixer_middle_click_action" type="string">
<_short>Middle click action</_short>
<default>mute_quick_target</default>
<desc>
Expand All @@ -428,7 +428,7 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_name>Mute quick action target</_name>
</desc>
</option>
<option name="wp_right_click_action" type="string">
<option name="mixer_right_click_action" type="string">
<_short>Right click action</_short>
<default>show_quick_target</default>
<desc>
Expand All @@ -444,12 +444,12 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_name>Mute quick action target</_name>
</desc>
</option>
<option name="wp_icon_size" type="int">
<option name="mixer_icon_size" type="int">
<_short>Icon size</_short>
<default>0</default>
<min>0</min>
</option>
<option name="wp_popup_icon_size" type="int">
<option name="mixer_popup_icon_size" type="int">
<_short>Size of the icons in the popups</_short>
<default>0</default>
<min>0</min>
Expand Down
6 changes: 3 additions & 3 deletions src/panel/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ endif

if wireplumber.found()
widget_sources += [
'widgets/wp-mixer/wp-mixer.cpp',
'widgets/wp-mixer/wf-wp-control.cpp',
'widgets/wp-mixer/wp-common.cpp',
'widgets/mixer/mixer.cpp',
'widgets/mixer/mixer-control.cpp',
'widgets/mixer/wp-common.cpp',
]
deps += [pipewire, wireplumber]
else
Expand Down
6 changes: 3 additions & 3 deletions src/panel/panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "widgets/volume.hpp"
#endif
#ifdef HAVE_WIREPLUMBER
#include "widgets/wp-mixer/wp-mixer.hpp"
#include "widgets/mixer/mixer.hpp"
#endif
#include "widgets/window-list/window-list.hpp"
#include "widgets/notifications/notification-center.hpp"
Expand Down Expand Up @@ -243,7 +243,7 @@ class WayfirePanel::impl
if (name == "wp-mixer")
{
#ifdef HAVE_WIREPLUMBER
return Widget(new WayfireWpMixer());
return Widget(new WayfireMixer());
#else
std::cerr << "Built without wireplumber support, mixer widget "
" is not available." << std::endl;
Expand Down Expand Up @@ -596,7 +596,7 @@ void WayfirePanelApp::on_activate()
{"panel/battery_icon_size", ".battery image"},
{"panel/network_icon_size", ".network"},
{"panel/volume_icon_size", ".volume"},
{"panel/wp_icon_size", ".wp-mixer"},
{"panel/wp_icon_size", ".mixer"},
{"panel/wp_popup_icon_size", ".mute-toggle, .default-button"},
{"panel/notifications_icon_size", ".notification-center "},
{"panel/tray_icon_size", ".tray-button"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#include <pipewire/keys.h>
#include <gtkmm.h>

#include "wf-wp-control.hpp"
#include "mixer-control.hpp"
#include "icon-select.hpp"

#define ICON(volume) icon_from_range(volume_icons, volume)

WfWpControl::WfWpControl(WpPipewireObject *obj, WayfireWpMixer *parent_widget)
MixerControl::MixerControl(WpPipewireObject *obj, WayfireMixer *parent_widget)
{
object = obj;
parent = parent_widget;
}

WfWpControl::~WfWpControl()
MixerControl::~MixerControl()
{
mute_conn.disconnect();
middle_conn.disconnect();
Expand All @@ -23,7 +23,7 @@ WfWpControl::~WfWpControl()
}
}

void WfWpControl::init()
void MixerControl::init()
{
guint32 id = wp_proxy_get_bound_id(WP_PROXY(object));

Expand Down Expand Up @@ -128,19 +128,19 @@ void WfWpControl::init()
update_icon();
}

void WfWpControl::set_btn_status_no_callbk(bool state)
void MixerControl::set_btn_status_no_callbk(bool state)
{
mute_conn.block(true);
button.set_active(state);
mute_conn.block(false);
}

void WfWpControl::set_scale_target_value(double volume)
void MixerControl::set_scale_target_value(double volume)
{
scale.set_target_value(volume);
}

void WfWpControl::update_icon()
void MixerControl::update_icon()
{
if (button.get_active())
{
Expand All @@ -153,13 +153,13 @@ void WfWpControl::update_icon()
volume_icon.set_from_icon_name(ICON(get_scale_target_value()));
}

double WfWpControl::get_scale_target_value()
double MixerControl::get_scale_target_value()
{
return scale.get_target_value();
}

// attaches elements to the grid at the appropriate place
void WfWpControl::update_icons_pos()
void MixerControl::update_icons_pos()
{
static WfOption<bool> icons_on_left{"panel/wp_icons_on_left"};

Expand All @@ -176,7 +176,7 @@ void WfWpControl::update_icons_pos()
}
}

void WfWpControl::update_gestures()
void MixerControl::update_gestures()
{
// the setting says that it is for quick target, but let’s have all the muting consistent
static WfOption<std::string> str_wp_right_click_action{"panel/wp_right_click_action"};
Expand All @@ -199,7 +199,7 @@ void WfWpControl::update_gestures()
}
}

void WfWpControl::handle_config_reload()
void MixerControl::handle_config_reload()
{
remove(label);
remove(scale);
Expand All @@ -212,17 +212,17 @@ void WfWpControl::handle_config_reload()
}

// used to make a copy to the face of the widget
std::unique_ptr<WfWpControl> WfWpControl::copy()
std::unique_ptr<MixerControl> MixerControl::copy()
{
return std::make_unique<WfWpControl>(object, parent);
return std::make_unique<MixerControl>(object, parent);
}

WfWpControlDevice::~WfWpControlDevice()
MixerControlDevice::~MixerControlDevice()
{
def_conn.disconnect();
}

void WfWpControlDevice::init()
void MixerControlDevice::init()
{
add_css_class("wp-mixer-control");
default_btn.add_css_class("default-button");
Expand All @@ -247,10 +247,10 @@ void WfWpControlDevice::init()
WpCommon::get().set_default(object);
});

WfWpControl::init();
MixerControl::init();
}

void WfWpControlDevice::set_def_status_no_callbk(bool state)
void MixerControlDevice::set_def_status_no_callbk(bool state)
{
if (state)
{
Expand All @@ -265,9 +265,9 @@ void WfWpControlDevice::set_def_status_no_callbk(bool state)
def_conn.block(false);
}

void WfWpControlDevice::update_icons_pos()
void MixerControlDevice::update_icons_pos()
{
WfWpControl::update_icons_pos();
MixerControl::update_icons_pos();
static WfOption<bool> icons_on_left{"panel/wp_icons_on_left"};

if (icons_on_left)
Expand All @@ -279,8 +279,8 @@ void WfWpControlDevice::update_icons_pos()
}
}

void WfWpControlDevice::handle_config_reload()
void MixerControlDevice::handle_config_reload()
{
remove(default_btn);
WfWpControl::handle_config_reload();
MixerControl::handle_config_reload();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
#include <gtkmm.h>
#include <mutex>

#include "wp-mixer.hpp"
#include "mixer.hpp"
#include "animated-scale.hpp"

class WayfireWpMixer;
class WayfireMixer;

class WfWpControl : public Gtk::Grid
class MixerControl : public Gtk::Grid
{
// Custom grid to facilitate handling

protected:
WayfireAnimatedScale scale;
Gtk::Image volume_icon;
sigc::connection mute_conn;
WayfireWpMixer *parent;
WayfireMixer *parent;
std::shared_ptr<Gtk::GestureClick> middle_click_mute, right_click_mute;
sigc::connection middle_conn, right_conn;
std::vector<sigc::connection> signals;
Expand All @@ -25,8 +25,8 @@ class WfWpControl : public Gtk::Grid
WfOption<int> slider_length{"panel/wp_slider_length"};

public:
WfWpControl(WpPipewireObject *obj, WayfireWpMixer *parent_widget);
~WfWpControl();
MixerControl(WpPipewireObject *obj, WayfireMixer *parent_widget);
~MixerControl();
virtual void init();

WpPipewireObject *object;
Expand All @@ -41,14 +41,14 @@ class WfWpControl : public Gtk::Grid

virtual void handle_config_reload();

std::unique_ptr<WfWpControl> copy();
std::unique_ptr<MixerControl> copy();
};

// idea: would be neat to have a WfWpControlStream class that presents a dropdown to select which sink a
// idea: would be neat to have a MixerControlStream class that presents a dropdown to select which sink a
// stream goes to

// sinks and sources: a control with a button to set itself as default for it’s category
class WfWpControlDevice : public WfWpControl
class MixerControlDevice : public MixerControl
{
private:

Expand All @@ -57,9 +57,9 @@ class WfWpControlDevice : public WfWpControl
void update_icons_pos();

public:
WfWpControlDevice(WpPipewireObject *obj, WayfireWpMixer *parent_widget) : WfWpControl(obj, parent_widget)
MixerControlDevice(WpPipewireObject *obj, WayfireMixer *parent_widget) : MixerControl(obj, parent_widget)
{}
~WfWpControlDevice();
~MixerControlDevice();
void init();

Gtk::ToggleButton default_btn;
Expand Down
Loading
Loading