Module: Walkman::Commands::Controls

Defined in:
lib/walkman/commands/controls.rb

Class Method Summary collapse

Class Method Details

.next(count = 1) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/walkman/commands/controls.rb', line 19

def self.next(count = 1)
  if current_song = Walkman.player.current_song
    Walkman.player.playlist.feedback(:skip, current_song)
  end

  Walkman.player.next(count)

  if song = Walkman.player.current_song
    "♫ Skipping to #{song.title} by #{song.artist}"
  else
    "No more songs in the queue. Stopping walkman"
  end
end

.playObject



4
5
6
7
8
9
10
11
12
# File 'lib/walkman/commands/controls.rb', line 4

def self.play
  Walkman.player.play

  if song = Walkman.player.current_song
    "♫ Playing #{song.title} by #{song.artist}"
  else
    "♫ We're playing but the queue is empty!"
  end
end

.stopObject



14
15
16
17
# File 'lib/walkman/commands/controls.rb', line 14

def self.stop
  Walkman.player.stop
  "Stopping walkman"
end