module Player::Adapters::Spotify

Public Class Methods

being_played?() click to toggle source
# File lib/remme/player/adapters/spotify.rb, line 13
def being_played?
  script = %q{
    echo $(osascript <<EOF
      set state to missing value

      if application "Spotify" is running then
        tell application "Spotify"
          set state to (player state as text)
        end tell
      end if

      return state is equal to "playing"
    EOF)
  }

  `#{script}`.strip == 'true'
end
pause() click to toggle source
# File lib/remme/player/adapters/spotify.rb, line 9
def pause
  `osascript -e 'tell application "Spotify" to pause'`
end
play() click to toggle source
# File lib/remme/player/adapters/spotify.rb, line 5
def play
  `osascript -e 'tell application "Spotify" to play'`
end