Class: Volay::Widget::VolumeControl
- Defined in:
- lib/volay/widget/volume_control.rb
Overview
Events class
Instance Attribute Summary
Attributes inherited from Events
Instance Method Summary collapse
-
#on_system_tray_window_show ⇒ Object
When system tray window is showed.
-
#on_toggle_mute_toggled ⇒ Object
When mute toggle image is clicked.
-
#on_volume_adjustement_value_changed(widget) ⇒ Object
When slider have its adjustement value changed.
Methods inherited from Events
Constructor Details
This class inherits a constructor from Volay::Widget::Events
Instance Method Details
#on_system_tray_window_show ⇒ Object
When system tray window is showed
10 11 12 13 14 |
# File 'lib/volay/widget/volume_control.rb', line 10 def on_system_tray_window_show @app.get_object('volume_adjustement') .value = @app.mixer.percent @app.utils.update_status_icon end |
#on_toggle_mute_toggled ⇒ Object
When mute toggle image is clicked
29 30 31 32 33 34 |
# File 'lib/volay/widget/volume_control.rb', line 29 def on_toggle_mute_toggled Thread.new do @app.mixer.toggle unless .active? && @app.mixer.muted? @app.utils.update_status_icon end end |
#on_volume_adjustement_value_changed(widget) ⇒ Object
When slider have its adjustement value changed
19 20 21 22 23 24 |
# File 'lib/volay/widget/volume_control.rb', line 19 def on_volume_adjustement_value_changed() Thread.new do @app.mixer.value = .value @app.utils.update_status_icon end end |