andrewrk / gbremote

Groove Basin remote control command line app and Node.js module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gbremote

Groove Basin command-line remote control and Node.js module.

This project also serves as an example for writing a Groove Basin client using the Groove Basin Protocol Specification.

Command Line Interface

Usage: gbremote [options] command [args]
Options With Defaults:
  --server http://127.0.0.1:16242/
Commands:
  help
  toggle
  pause
  play
  stop
  next
  prev
  status
  stream
  importurl

Module Synopsis

var gbremote = require('gbremote');
var url = require('url');
var gbr = gbremote.createClient(url.parse("http://127.0.0.1:16242"));
gbr.on('connect', function() {
  gbr.sendMessage("play");
  gbr.close();
});
gbr.connect();

API Documentation

gbremote.createClient(options)

Creates a GrooveBasinRemote instance.

options:

  • protocol: (optional) One of: ws:, wss:, http:, https:. Defaults to http:. It doesn't matter whether you use ws or http, it's just distinguishing between secure and non-secure.
  • hostname: (optional) Defaults to 127.0.0.1.
  • port: (optional) Defaults to 16242.

gbremote.GrooveBasinRemote

gbr.connect()

gbr.close()

gbr.sendMessage(name, args)

gbr.httpRequest()

gbr.token

Event: 'error'

function (err) { }

Event: 'connect'

Event: 'close'

Event: 'message'

function (name, args) { }

About

Groove Basin remote control command line app and Node.js module


Languages

Language:JavaScript 100.0%