diff options
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/src/device.c b/src/device.c index 2f38beb..79b7b50 100644 --- a/src/device.c +++ b/src/device.c @@ -90,11 +90,10 @@ device_finalize (GObject *object) } void -device_populate (Device* self, +device_sink_populate (Device* self, const pa_sink_info* update) { DevicePrivate* priv = DEVICE_GET_PRIVATE(self); - device_mute_update (self, update->mute); mute_menu_item_enable (priv->mute_menuitem, TRUE); slider_menu_item_populate (priv->volume_slider_menuitem, update); SoundState state = device_get_state_from_volume (self); @@ -103,37 +102,11 @@ device_populate (Device* self, sound_service_dbus_update_sound_state (priv->service, priv->current_sound_state); } - -} - -void -device_activate_voip_item (Device* self, gint sink_input_index, gint client_index) -{ - DevicePrivate* priv = DEVICE_GET_PRIVATE (self); - if (voip_input_menu_item_is_interested (priv->voip_input_menu_item, - sink_input_index, - client_index)){ - voip_input_menu_item_enable (priv->voip_input_menu_item, TRUE); - } -} - -void -device_deactivate_voip_source (Device* self, gboolean visible) -{ - DevicePrivate* priv = DEVICE_GET_PRIVATE (self); - visible &= voip_input_menu_item_is_active (priv->voip_input_menu_item); - voip_input_menu_item_deactivate_source (priv->voip_input_menu_item, visible); -} - -void -device_deactivate_voip_client (Device* self) -{ - DevicePrivate* priv = DEVICE_GET_PRIVATE (self); - voip_input_menu_item_deactivate_voip_client (priv->voip_input_menu_item); + device_mute_update (self, update->mute); } void -device_update (Device* self, +device_sink_update (Device* self, const pa_sink_info* update) { DevicePrivate* priv = DEVICE_GET_PRIVATE (self); @@ -223,22 +196,48 @@ device_determine_blocking_state (Device* self) } gint -device_get_index (Device* self) +device_get_sink_index (Device* self) { DevicePrivate* priv = DEVICE_GET_PRIVATE (self); return slider_menu_item_get_sink_index (priv->volume_slider_menuitem); } gboolean -device_is_populated (Device* self) +device_is_sink_populated (Device* self) { DevicePrivate* priv = DEVICE_GET_PRIVATE (self); return dbusmenu_menuitem_property_get_bool (DBUSMENU_MENUITEM (priv->volume_slider_menuitem), DBUSMENU_MENUITEM_PROP_ENABLED); } +void +device_activate_voip_item (Device* self, gint sink_input_index, gint client_index) +{ + DevicePrivate* priv = DEVICE_GET_PRIVATE (self); + if (voip_input_menu_item_is_interested (priv->voip_input_menu_item, + sink_input_index, + client_index)){ + voip_input_menu_item_enable (priv->voip_input_menu_item, TRUE); + } +} + +void +device_deactivate_voip_source (Device* self, gboolean visible) +{ + DevicePrivate* priv = DEVICE_GET_PRIVATE (self); + visible &= voip_input_menu_item_is_active (priv->voip_input_menu_item); + voip_input_menu_item_deactivate_source (priv->voip_input_menu_item, visible); +} + +void +device_deactivate_voip_client (Device* self) +{ + DevicePrivate* priv = DEVICE_GET_PRIVATE (self); + voip_input_menu_item_deactivate_voip_client (priv->voip_input_menu_item); +} + void -device_deactivate (Device* self) +device_sink_deactivated (Device* self) { DevicePrivate* priv = DEVICE_GET_PRIVATE (self); priv->current_sound_state = UNAVAILABLE; |