Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toggle command (mpc like) #82

Open
dan-cristian opened this issue Jan 4, 2017 · 1 comment
Open

Add toggle command (mpc like) #82

dan-cristian opened this issue Jan 4, 2017 · 1 comment

Comments

@dan-cristian
Copy link

mpc like toggle command seems to be unsupported, would be a good addition.
"mpc toggle Toggles Play/Pause, plays if stopped"

@LevitatingBusinessMan
Copy link

Extend the class like this:

class MPD
      # Play if paused, pause if playing
      # @macro returnraise
      def toggle
        case self.status[:state]
        when :play
          send_command :pause
        else
          send_command :play
        end
      end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants