Skip to content

ryanbmilbourne/pianode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pianode

Node.js package to run pianobar (a pandora.com console client) headless, install it and manage all settings.

Table Of Contents

  1. Installation
  2. Events
  3. Status values
  4. Functions
  5. Objects
  6. Error Types
  7. Options
  8. ToDo

Installation

To use this package, just add it to your applications dependencies (package.json) and run npm install. You can also install it for the current directory with npm install https://github.com/philippwiddra/pianode/archive/master.tar.gz

The only thing you have to make sure additionally is that the listed lib dependencies are installed:

  • libao-dev
  • libmad0-dev
  • libfaad-dev
  • libgnutls-dev
  • libjson0-dev
  • libgcrypt11-dev

If your distribution uses apt just run this command, if not find and install the above listed packages in the available package manager. They are available for a lot of other distributions under the same name.

sudo apt-get install libao-dev libmad0-dev libfaad-dev libgnutls-dev libjson0-dev libgcrypt11-dev

All other dependencies (including pianobar itself) will be installed with npm. Pianode won't mess with your local pianobar installation (if you have one), it builds a totally new one and won't touch your configuration files at all, it loads the configuration from inside the pianode packagefiles (pianode/pianobar/config).

Events

Form: 'eventName' (parameterType additionalParameter)

Status Values

  • 'not running'
  • 'error'
  • 'undefined'
  • 'logging in'
  • 'playing'
  • 'paused'
  • 'receiving stations'
  • 'receiving playlist'
  • 'receiving explanation'

Functions

  • start()
    • Starts the pianobar client as child process
  • getStatus()
  • getState()
    • returns (object state)
  • on(event, callback)
    • The callback is called with a specific object as parameter when the given event occurrs

Objects

error

var error = {
  type: 'errorType',
  text: 'errorMessage'
};

see Error Types

song

var song = {
  name: '',
  artist: '',
  album: '',
  playlist: ''
};

station

var station = {
  name: '',
  id: ''
};

time

var time = {
  string: '',
  percent: 0,
  remaining: {
    string: '',
    seconds: 0
  },
  total: {
    string: '',
    seconds: 0
  },
  played: {
    string: '',
    seconds: 0
  }
};

statusChange

var statusChange = {
  status: '',
  prevStatus: ''
};

see Status Values

Error Types

Possible values of error.type:

  • 'Pianobar error'
  • 'Network error'
  • 'Unknown error'

Options

var options = {
  station: 10,
  verbose: true,
  errorLog: true
};

ToDo

Problems:

  • pianobarConfig.js
  • Swap proxys
  • How do upvoted songs appear?
    • in Songlist
    • when playing
  • Windows support with thedmd/pianobar-windows?
    • neccessary to build on target maschine every time or are binarys enough
    • config named pianobar.cfg
    • executable?

Pianobar statusmessage coverage

Status Message
ok /!\ Cannot access audio file: Forbidden.
ok (i) Login...
ok (i) Get stations...
ok (i) Receiving new playlist...
ok (i) Receiving explanation...
    | (i) No history yet.

ok | [?] Select station: | [?] Select song: | [?] What to do with this song? ok | [?] Password: ok | [?] Email: ok | |> Station "QuickMix" (1057370371552570017) ok | |> "Ice Ice Baby" by "Vanilla Ice" on "To The Extreme" @ 90s Pop Radio ok | # -04:24/04:31 | 0) q 90s Pop Radio | 0) Q 90s Pop Radio | 0) 90s Pop Radio | 0) Aerosmith - I Don't Want To Miss A Thing | 0) Aphrodite - Return To Jedda ok | Network error: Read error. ok | Network error: Timeout. ok | Network error: TLS handshake failed. ok | Error: Pandora is not available in your country. Set up a control proxy (see manpage).

Functions:

  • Standalone
    • playPause()
    • play()
    • pause()
    • next()
    • love()
    • ban()
    • volumeUp()
    • volumeDown()
    • volumeReset()
    • tired()
    • selectQuickMix() ???
    • quit()
    • bookmark() ???
    • stationCreateFromSong() ???
  • Emitting events
    • history()
      • how to differ from upcoming?
      • "no history yet" possible!
    • upcoming()
      • how to differ from history?
    • songExplain()
    • songInfo()
  • Requesting input
    • switchStation(identifier)
    • songMove(newStation) ???
    • stationCreate() ???
    • stationDelete() ???
    • stationRename() ???
    • manageStation() ???
    • stationAddMusic() ???
    • stationAddByGenre() ???

About

Node.js package to run pianobar headless

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published