Class: MusicBlender::PlayerMonitor
- Inherits:
-
Object
- Object
- MusicBlender::PlayerMonitor
- Defined in:
- lib/music_blender/player_monitor.rb
Instance Attribute Summary collapse
-
#frames ⇒ Object
Returns the value of attribute frames.
-
#frames_remaining ⇒ Object
Returns the value of attribute frames_remaining.
-
#player ⇒ Object
Returns the value of attribute player.
-
#playing ⇒ Object
Returns the value of attribute playing.
-
#seconds ⇒ Object
Returns the value of attribute seconds.
-
#seconds_remaining ⇒ Object
Returns the value of attribute seconds_remaining.
-
#song_name ⇒ Object
Returns the value of attribute song_name.
-
#stop_pause_status ⇒ Object
Returns the value of attribute stop_pause_status.
Instance Method Summary collapse
-
#initialize(player) ⇒ PlayerMonitor
constructor
A new instance of PlayerMonitor.
- #run ⇒ Object
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
#frames ⇒ Object
Returns the value of attribute frames.
3 4 5 |
# File 'lib/music_blender/player_monitor.rb', line 3 def frames @frames end |
#frames_remaining ⇒ Object
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 |
#player ⇒ Object
Returns the value of attribute player.
3 4 5 |
# File 'lib/music_blender/player_monitor.rb', line 3 def player @player end |
#playing ⇒ Object
Returns the value of attribute playing.
3 4 5 |
# File 'lib/music_blender/player_monitor.rb', line 3 def @playing end |
#seconds ⇒ Object
Returns the value of attribute seconds.
3 4 5 |
# File 'lib/music_blender/player_monitor.rb', line 3 def seconds @seconds end |
#seconds_remaining ⇒ Object
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_name ⇒ Object
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_status ⇒ Object
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
#run ⇒ Object
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 |