class Druzy::Protocol::Renderer

Attributes

current_file[RW]
duration[RW]
mute[RW]
time_position[RW]
volume[RW]
volume_max[RW]
volume_min[RW]

Public Class Methods

new(identifier, protocol, name, icon, duration=Time.at(0).utc, time_position=Time.at(0).utc,volume=100,volume_min=0,volume_max=100,mute=false) click to toggle source
Calls superclass method Druzy::Protocol::Device::new
# File lib/druzy/protocol/device.rb, line 30
def initialize(identifier, protocol, name, icon, duration=Time.at(0).utc, time_position=Time.at(0).utc,volume=100,volume_min=0,volume_max=100,mute=false)
  super(identifier,protocol,name,icon)
  @duration = duration
  @time_position = time_position
  @volume = volume
  @volume_min = volume_min
  @volume_max = volume_max
  @mute = mute
  @current_file = nil
  @play = false
  @pause = false
  @stop = true
  
  add_property_change_listener(Druzy::MVC::PropertyChangeListener.new do |event|
    if event.property_name == "play"
      if event.new_value == true
        stop = false
        pause = false
      end
    elsif event.property_name == "pause"
      if event.new_value == true
        pause = false
        stop = false
      end
    elsif event.property_name == "stop"
      if event.new_value == true
        play = false
        pause = false
      end
    end
  end)
end

Public Instance Methods

current_file=(current_file) click to toggle source
# File lib/druzy/protocol/device.rb, line 93
def current_file=(current_file)
  @current_file, old = current_file, @current_file
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"current_file",old,@current_file))
end
duration=(duration) click to toggle source
# File lib/druzy/protocol/device.rb, line 63
def duration=(duration)
  @duration, old = duration, @duration
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"duration",old,@duration))
end
mute=(mute) click to toggle source
# File lib/druzy/protocol/device.rb, line 88
def mute=(mute)
  @mute, old = mute, @mute
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"mute",old,@mute))
end
pause() click to toggle source
# File lib/druzy/protocol/device.rb, line 116
def pause
end
pause=(pause) click to toggle source
# File lib/druzy/protocol/device.rb, line 103
def pause=(pause)
  @pause, old = pause, @pause
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"pause",old,@pause))
end
play() click to toggle source
# File lib/druzy/protocol/device.rb, line 113
def play
end
play=(play) click to toggle source
# File lib/druzy/protocol/device.rb, line 98
def play=(play)
  @play, old = play, @play
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"play",old,@play))
end
send(file) click to toggle source
# File lib/druzy/protocol/device.rb, line 122
def send(file)
end
stop() click to toggle source
# File lib/druzy/protocol/device.rb, line 119
def stop
end
stop=(stop) click to toggle source
# File lib/druzy/protocol/device.rb, line 108
def stop=(stop)
  @stop, old = stop, @stop
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"stop",old,@stop))
end
time_position=(time_position) click to toggle source
# File lib/druzy/protocol/device.rb, line 68
def time_position=(time_position)
  @time_position, old = time_position, @time_position
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"time_position",old,@time_position))
end
volume=(volume) click to toggle source
# File lib/druzy/protocol/device.rb, line 73
def volume=(volume)
  @volume, old = volume, @volume
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"volume",old,@volume))
end
volume_max=(volume_max) click to toggle source
# File lib/druzy/protocol/device.rb, line 83
def volume_max=(volume_max)
  @volume_max, old = volume_max, @volume_max
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"volume_max",old,@volume_max))
end
volume_min=(volume_min) click to toggle source
# File lib/druzy/protocol/device.rb, line 78
def volume_min=(volume_min)
  @volume_min, old = volume_min, @volume_min
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"volume_min",old,@volume_min))
end