class Spty::Command::PauseCommand
Constants
- ASCRIPT_PLAYER_PAUSE
Public Class Methods
call(options, _)
click to toggle source
# File lib/spty/commands/pause_command.rb, line 8 def self.call(options, _) return unless running? # Get the player state player_state_script = Spty::Command::StateCommand::ASCRIPT_PLAYER_STATE player_state = Spty::AppleScriptRunner.(player_state_script) if player_state.strip == 'playing' Spty::AppleScriptRunner.call(ASCRIPT_PLAYER_PAUSE) end track_info_script = Spty::Command::InfoCommand::ASCRIPT_TRACK_INFO track_info = Spty::AppleScriptRunner.(track_info_script) puts "=> #{track_info.strip} [paused]" end