Class: MusicBlender::PlayerMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/music_blender/player_monitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(player) ⇒ PlayerMonitor

Returns a new instance of PlayerMonitor.



6
7
8
# File 'lib/music_blender/player_monitor.rb', line 6

def initialize(player)
  @player = player
end

Instance Attribute Details

#framesObject

Returns the value of attribute frames.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def frames
  @frames
end

#frames_remainingObject

Returns the value of attribute frames_remaining.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def frames_remaining
  @frames_remaining
end

#playerObject

Returns the value of attribute player.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def player
  @player
end

#playingObject

Returns the value of attribute playing.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def playing
  @playing
end

#secondsObject

Returns the value of attribute seconds.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def seconds
  @seconds
end

#seconds_remainingObject

Returns the value of attribute seconds_remaining.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def seconds_remaining
  @seconds_remaining
end

#song_nameObject

Returns the value of attribute song_name.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def song_name
  @song_name
end

#stop_pause_statusObject

Returns the value of attribute stop_pause_status.



3
4
5
# File 'lib/music_blender/player_monitor.rb', line 3

def stop_pause_status
  @stop_pause_status
end

Instance Method Details

#runObject



10
11
12
13
14
15
# File 'lib/music_blender/player_monitor.rb', line 10

def run
  loop do
    process_output_line(stdout.readline) while stdout.ready?
    sleep 0.001
  end
end