GithubHelp home page GithubHelp logo

cloudruby's Introduction

CloudRuby

A soundcloud player written in Ruby with Ncurses for graphical interface and mpg123 for playback.

Installation

Install mpg123, ruby 1.9.2+, curses and json_pure with a package manager of your distribution.

Then install the required gems.

If you are using RVM:

  gem install curses json_pure httpclient

Without RVM you need to obtain write permissions with sudo:

  sudo gem install curses json_pure httpclient open-uri

Usage

From the terminal start with:

  cloudruby          # query the latest 100 tracks from soundcloud
  cloudruby $search  # query the latest 100 tracks that match the $search keyword

  # play a soundcloud url directly
  cloudruby http://soundcloud.com/crassmix/feint-clockwork-hearts-crass

Shortcuts:

KeyDescription
ESC | q | Q Quit
+ | = Increase volume
- | _ Decrease volume
n | N | Up Next track
p | P | Down Previous track
m | M Toggle mute
d | D Download file
v | V Info dialog
Spacebar Toggle playback

More detailed information can be found in the doc folder.

Download

With 'd' or 'D' you can download a downloadable file from soundcloud. The file will be placed inside your download directory specified with --download_dir argument or inside your ~/.cloudruby.json. If none of these are given, the current working directory is used.

A track is indicated by a [D] in the playlist if it's downloadable.

Screenshots

Screenshot showing curses user interface Screenshot showing customized curses user interface Screenshot showing customized curses user interface

Config

Cloudruby can be customized through ~/.cloudruby.json file.

Example

{
  "download_dir": "~/music",
  "audio-backend": "mpg123",
  "curses": {
    "colors": {
      "default": ["white", "black"],
      "playlist": ["green", "black"],
      "playlist_active": ["red", "black"],
      "progress": ["cyan", "black"],
      "progress_bar": ["blue", "white"],
      "title": ["cyan"],
      "artist": ["magenta"],
      "status": ["red"]
    }
  }
}

Read more about styling here

Maintainer

Contributors

License

see LICENSE.

cloudruby's People

Contributors

kulpae avatar leoj3n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cloudruby's Issues

Broken Pipe

some users get this:

/opt/cloudruby/mpg123player.rb:18:in `write': Broken pipe (Errno::EPIPE)
    from /opt/cloudruby/mpg123player.rb:18:in `puts'
    from /opt/cloudruby/mpg123player.rb:18:in `play'
    from ./cloudruby:33:in `nextTrack'
    from ./cloudruby:20:in `init'
    from ./cloudruby:81:in `<main>'

Mpg123player doesn't switch fast

Going through the playlist too fast causes silence for some time.

Reason: cloudruby tells mpg123 to load the next track everytime the user presses the next key.

Result: mpg123 first loads the track, then after realising then next request, it stops it and loads the next.

Solution: to wait half a second or more before ordering mpg123 to load the track.

Ruby gem

Do you have any plans to package this as a ruby gem?

a way to populate playlist

There is no way to populate the playlist with custom tracks.
(only one track can be put into the playlist)

Proposal:

  • Process stdin lines as track urls
  • Process parameters as track urls
  • Process lines in a playlist file provided as -p parameter

Support reading playlist urls

Extend the cloud module, so that links to soundcloud sets/playlists are recognized and the tracks are played as expected.

Improve navigation

Until now one could navigate only with Up/Down (and aliases).
It'd be nice to be able to use Page-up/down, number, search?

Proposal:

  • P - N to navigate by page,
  • p - n to navigate by track (as is now)
  • /text - highlight all tracks containing text and make p/n traverse through them.
    ESC to cancel
  • :n go to _n_th track

play files?

Hello, I need only play files from my disk. Is possible to write small example how play without network?
gui ncurses etc.

Download tracks

Allow downloading a legaly downloadable track with hotkey.

  • Need to ask what folder to download to (through ncurses input or/and configuration file).

Bad color config example values in README

Any of these:

      "title": ["cyan"],
      "artist": ["magenta"],
      "status": ["red"]

Cause this:

#<NoMethodError: undefined method `to_sym' for -1:Fixnum>
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/ncurses_ui.rb:333:in `ncg'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/ncurses_ui.rb:297:in `add'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/ncurses_ui.rb:288:in `block in init'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/ncurses_ui.rb:287:in `each'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/ncurses_ui.rb:287:in `init'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/ncurses_ui.rb:53:in `run'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/lib/cloudruby.rb:87:in `run'
~/.rvm/gems/ruby-2.2.1/gems/cloudruby-1.2.0/bin/cloudruby:47:in `<top (required)>'
~/.rvm/gems/ruby-2.2.1/bin/cloudruby:23:in `load'
~/.rvm/gems/ruby-2.2.1/bin/cloudruby:23:in `<main>'
~/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
~/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

However the example for the crimson theme in doc/colors.md worked fine.

cloudruby - ncurses (LoadError)

Hey,
I have installed cloudruby from the AUR (Arch User Repository).
But I can't start it anymore...
I get the following message:

/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ncurses (LoadError)
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/cloudruby/ncurses_ui.rb:1:in `<top (required)>'
    from /usr/bin/cloudruby:8:in `require_relative'
    from /usr/bin/cloudruby:8:in `<main>'

playback not working

Hi
Im on updated archlinux, suddenly playback does not work, stays at 00:00, idk if recent pkg update has b0rken something or what. downloads work but not playback. Happens on all 4 updated arch boxxen and on my Free BSD box, maybe the new mpg123 causing it ?

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.