Bemix Notes

From SlugWiki
Revision as of 22:19, 15 January 2006 by 18.238.6.93 (Talk) (URL Scheme)

Jump to: navigation, search

Bemix is a web-based media player. It supports multiple soundcards and various networked client types, allowing a group to use a centralized server to control several speakers. Commands are issued through URLs, where the URL portion of the address represents the command to be issued, while the GET portion of the URL passes in parameters to the server.

URL Scheme

All URLs are relative to http://slugwiki.mit.edu:8080/, and all URLs have an output=[html, client]. An example URL is http://slugwiki.mit.edu:8080/play?output=client&playerId=2. All x, y, ... must be properly-encoded URLs.

Players

  • play?playerId=x
  • pause?playerId=x
  • stop?playerId=x
  • loadList?playerId=x&playlistId=y
  • player?playerId=x

Playlist

  • create?name=x
  • delete?playlistId=x
  • add?playlistId=x&song=y
  • remove?playlistId=x&index=y
  • playlist?playlistId=x

Browsing

  • browse?dir=x

General

  • players
  • playlists

Results

Each command returns a data structure through HTTP that defines variable names and values. A (variable name, value) combination is referred to as a field. Every command contains at least one success field, whose value may be either true or false. If any tag is false, it should be assumed that the entire command failed. Each command may optionally return a comment field as well, whose value gives some indication of why an operation may have failed.

In addition, most commands return additional information about the state of a particular aspect of the bemix server.

Client Types

Bemix is capable of dumping data in multiple of formats. Currently on "client" and "html" formats are planned, but XML/RDF formats are possibly in the future. The format of the export is indicated in the URL by the mandatory output parameter.

Client

The "client" output format returns data in a simple newline-delimited list. String values are not delimited by quote characters, and list items are delimited by commas (including a comma after the final element). The format of each line is name=value, where name is the name of the variable being returned, and value is the value of the variable. No whitespace characters are inserted between name, =, and value.

The order in which the fields are returned is not guaranteed, and it should not be assumed that all tags will be present or in any particular order.

The MIME type of the client output is 'text/plain'.

The result of the browse command:

dir0=/P/Porcupine Tree/Coma Divine
dir1=/P/Porcupine Tree/Spiral Circus
dir2=/P/Porcupine Tree/In Absentia
dir3=/P/Porcupine Tree/Insignificance
dir4=/P/Porcupine Tree/Lightbulb Sun
dir5=/P/Porcupine Tree/Metanoia
dir6=/P/Porcupine Tree/On the Sunday of Life
dir7=/P/Porcupine Tree/Recordings
file0=/P/Porcupine Tree/Chloroform (Instrumental Rough Mix).mp3
file1=/P/Porcupine Tree/Disappear (Demo Version 2.0).mp3
file2=/P/Porcupine Tree/Is Not.mp3
file3=/P/Porcupine Tree/2003 Intro Music.mp3
file4=/P/Porcupine Tree/Even Less, Part 2.mp3
file5=/P/Porcupine Tree/London.mp3
success=true

The result of the playlists command:

ids=32,30,31,
success=true

The result of the players command with an invalid playerId:

success=false
comment=playerId not found
success=true