Coder Social home page Coder Social logo

sunny / anyplayer Goto Github PK

View Code? Open in Web Editor NEW
50.0 5.0 12.0 91 KB

Interact with the currently running music player. Supports iTunes Mac, iTunes Windows, Spotify Mac, Rdio Mac, MPD, Rhythmbox, Amarok and XMMS2.

License: MIT License

Ruby 100.00%
music-console xmms2 amarok rhythmbox mpd music-player music ruby spotify-mac itunes-windows

anyplayer's Introduction

Anyplayer

Gem Version Build Status

Interacts with the currently running music player. Supports iTunes Mac, iTunes Windows, Spotify Mac, Rdio Mac, MPD, Rhythmbox, Amarok and XMMS2.

Install

$ gem install anyplayer

Use it in your terminal

$ anyplayer artist     # artist of the current track
New Order
$ anyplayer track      # name of the current track
Blue Monday
$ anyplayer album
Power, Corruption & Lies
$ anyplayer next       # changes track forward
$ anyplayer prev       #               backward
$ anyplayer playpause  # pauses if it is playing, plays if it's paused
$ anyplayer play
$ anyplayer pause
$ anyplayer voldown    # put the volume somewhat up
$ anyplayer volup      #                         down
$ anyplayer volume     # prints the volume percentage
100
$ anyplayer vote       # votes to go to next song (default number of votes is 5)
$ anyplayer name
iTunes
$ anyplayer launched && echo "a player is running" || echo "nothing running"
a player is running

Or in Ruby

In your Gemfile:

# Interact with the current music player
gem "anyplayer"

In your code:

require "anyplayer"
player = Anyplayer::Selector.new.player

player.launched? # => true
player.name # => Rythmbox
player.artist # => "The Avalanches"
player.track # => "Frontier Psychiatrist"
# …

Or in a browser

With the So Nice Web interface:

So Nice Screenshot

Contribute!

All contributions are welcome! Head to the Github issues to report bugs, questions or code. Also, check out CONTRIBUTING.md.

Here a few useful commands while developping:

$ ruby -Ilib bin/anyplayer  # Use the anyplayer command-line from source
$ bin/rake test             # Launch tests
$ bin/rake install          # Install from source
$ bin/rake console          # Launch console

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.