Sha256: 2271dda65a0116d72b10d58408f7d5c71b75f4e3dd001784f95f831d29858cd5

Contents?: true

Size: 823 Bytes

Versions: 7

Compression:

Stored size: 823 Bytes

Contents

# Volay module
module Volay
  # Widgets components
  module Widget
    # Events class
    class VolumeControl < Events
      ##
      # When system tray window is showed
      #
      def on_system_tray_window_show
        @app.get_object('volume_adjustement')
          .value = @app.mixer.percent
        @app.utils.update_status_icon
      end

      ##
      # When slider have its adjustement value changed
      #
      def on_volume_adjustement_value_changed(widget)
        Thread.new do
          @app.mixer.value = widget.value
          @app.utils.update_status_icon
        end
      end

      ##
      # When mute toggle image is clicked
      #
      def on_toggle_mute_toggled
        Thread.new do
          @app.mixer.toggle
          @app.utils.update_status_icon
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
volay-0.6.0 lib/volay/widget/volume_control.rb
volay-0.5.0 lib/volay/widget/volume_control.rb
volay-0.4.0 lib/volay/widget/volume_control.rb
volay-0.3.0 lib/volay/widget/volume_control.rb
volay-0.2.0 lib/volay/widget/volume_control.rb
volay-0.1.0 lib/volay/widget/volume_control.rb
volay-0.0.1 lib/volay/widget/volume_control.rb