Class: Moc::Controller::Status::Live

Inherits:
Object
  • Object
show all
Defined in:
lib/moc/controller/status.rb

Defined Under Namespace

Classes: Song

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ Live

Returns a new instance of Live.



86
87
88
# File 'lib/moc/controller/status.rb', line 86

def initialize (controller)
	@controller = controller
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



84
85
86
# File 'lib/moc/controller/status.rb', line 84

def controller
  @controller
end

Instance Method Details

#==(other) ⇒ Object



90
91
92
# File 'lib/moc/controller/status.rb', line 90

def == (other)
	super || state == other
end

#songObject



104
105
106
107
108
# File 'lib/moc/controller/status.rb', line 104

def song
	return if self == :stop

	Song.new(controller)
end

#stateObject



94
95
96
97
# File 'lib/moc/controller/status.rb', line 94

def state
	controller.send_command :get_state
	controller.get_state
end

#to_symObject



110
111
112
# File 'lib/moc/controller/status.rb', line 110

def to_sym
	state.to_sym
end

#volumeObject



99
100
101
102
# File 'lib/moc/controller/status.rb', line 99

def volume
	controller.send_command :get_mixer
	controller.get_integer.to_i
end