Class: Volay::Widget::VolumeControl

Inherits:
Events
  • Object
show all
Defined in:
lib/volay/widget/volume_control.rb

Overview

Events class

Instance Attribute Summary

Attributes inherited from Events

#app

Instance Method Summary collapse

Methods inherited from Events

#initialize

Constructor Details

This class inherits a constructor from Volay::Widget::Events

Instance Method Details

#on_system_tray_window_showObject

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_toggledObject

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
    @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(widget)
  Thread.new do
    @app.mixer.value = widget.value
    @app.utils.update_status_icon
  end
end