There are no reviews yet. Be the first to send feedback to the community and the maintainers!
Playdar ======= Playdar is a music content resolver, written in Erlang, MIT licensed. It's modular and can be extended using resolver scripts in any language. It has an HTTP API to answer the question "can i play this song?". If yes, you get a localhost URL that will play the song, from whichever souce playdar resolved it to (plugins do the resolving). Read on for build instructions and an "Understanding Playdar" tutorial. More information and binary installers / packages can be found at: http://www.playdar.org/ Building -------- To build all the erlang code: $ make To build the collection scanner (needs taglib, g++): $ make scanner Running ------- $ ./playdarctl start-debug In another terminal you can now do: $ ./playdarctl numfiles $ ./playdarctl scan "/path/to/music" $ ./playdarctl numfiles Then check out http://localhost:60210/ and http://www.playdar.org/demos/ Understanding Playdar ===================== The core playdar daemon is a generic content-resolver engine. It contains a simple http server (Mochiweb), a resolver infrastructure, external module loader (plugins) and configuration management. Playdar core allows you to dispatch queries and check query status, but by itself it can't resolve content. This is all handled by plugins. Clients talk to Playar using the HTTP API. JSON is used for everything. Resolver Queries ---------------- All queries passed to Playdar are simply JSON objects of any shape or size. Playdar checks for a "qid" propery - a GUID for the query, in each object, but nothing else - it's up to the plugins to decode the query objects. If a plugin doesn't recognise a query it simply ignores it. The following examples are similar in syntax to how Playdar is built, but may not necessarily be exactly correct. They serve to illustrate the query mechanics: Music Query Example ------------------- The query object: { "qid" : "XXX123", "artist" : "Big Bad Sun", "track" : "Sweet Melissa" } This is a simple query for a specific song. In this case, the default plugins that ship with Playdar know how to handle it - because we're using Playdar as a music content resolver. The library plugin will search your disk and respond with a result if you have a copy of the song being searched for: A result object: { "sid" : "YYY456", "qid" : "XXX123", "result" : { "url" : "/path/to/sweet_melissa.mp3", "bitrate" : 128, "duration" : 283, "artist" : "Big Bad Sun", "track" : "Sweet Melissa (live)", "score" : 0.89 } } In the the above example, the library plugin reports a result for the query with a score of 0.89 - it found a live version - but close enough. The "sid" propery is a GUID for the result. Resolvers can report multiple result objects for any query. Non-music Example ----------------- Depending on the plugins loaded, Playdar could be used to resolve anything. Here's a fictional example query for an academic essay: { "qid" : "XXX789", "author" : "Jonathan swift", "year" : 1729, "title" : "a modest propsal" } ... and if you have a resolver plugin that could search for essays and academic papers, it might respond like this: { "sid" : "YYY123", "qid" : "XXX789", "result" : { "author" : "Jonathan Swift", "year" : 1729, "title" : "A Modest Proposal", "score" : 1.00, "category" : "humour", "url" : "http://art-bin.com/art/omodest.html" } } In this example, the resolver matched the query to an essay posted on the web instead of the local filesystem. Custom Protocols ---------------- Playdar ships with support for reading content from http:// and file:// URLs. That is to say support for those protocols is implemented by plugins that ship by default. A resolver could provide an url like this: "custom://abc123-modest-blah" and register itself as a handler for custom:// urls. This allows resolver plugins to fetch and stream content in any way they like. You could add support for ftp:// or a custom p2p:// protocol if you wanted. How Clients Fetch Results ------------------------- The actual URL to the resolved content, be it a local filesystem or http URL, is never exposed to clients using the Playdar HTTP API. The "url" propery is stripped out of result objects before they are returned to clients. The "sid" GUID in every result object is used to request the content, like so: http://localhost:60210/sid/<sid> Playdar will then fetch the content using the appropriate protocol handler internally (file, http, p2p, custom, etc), and respond to the client with a well formed HTTP response. This means that clients only need to understand HTTP. The details of how content is fetched by Playdar are hidden from clients. Clients don't need to know where or how you access your music. The Playdar API lets them ask "Can you play this song". The details of where and how you access the song are kept private. To reiterate: clients can't tell whether you are playing a song you have on your local disk, or are streaming over the internet from some other service. How webpages interact with Playdar ---------------------------------- Desktop apps can obviously just use the HTTP API on localhost without any special considerations. Webapps and anything running in the browser is subject to the browser security model, specifically the "same-origin policy". This means that you can't access content in a document loaded from a domain different to the domain your javascript executes in. To solve this problem, playdar uses JSONP callbacks. Instead of requesting http://localhost:60210/api/?method=stat and getting json in response, you inject a script tag into the dom like this: <script language="javascript" src="http://localhost:60210/api/?method=stat&jsonp=my_callback"/> Playdar responds with the json object wrapped in your padding: my_callback(...normal json response...); which then fires the my_callback function - voilia, cross domain RPC.
ketama
C library for consistent hashing, and langauge bindingsirccat
IRC bot that simplifies posting to IRC from shell scriptserlang-spdy
Library implementing the SPDY protocolrelflow
Version-incrementing, appup-generating, relx-coaxing, workflow-assistant for Erlang projects using rebar3.estatsd
Erlang stats aggregation app that periodically flushes data to graphiteplaydar
Abandoned C++ codebase, see playdar-core repo!heatmiser-neohub.py
Python library to talk the direct-lan-api to control a Heatmiser Neohub / Neostats - and home-assistant componenterlang_rebar_example_project
Basic project using rebar, to demonstrate upgrades and packaging etcerlang-reup
Watches for .erl & .hrl changes, recompiles and reloads. You know, for development.erlang-cassandra-cql
cassandra driver in erlang that speaks native cassandra protocolmochiweb-websockets
***OBSOLETE, using my mochiweb repo now ***libf2f
Library for building p2p networks, C++ boost/asiolibportfwd
Set up port fwds and find external IP: C++/CMake wrapper for miniupnpc and nat-pmp libsgreynet
A darknet/mesh network plugin for legacy C++ playdar codebasedoorbird-mdns-vlan-subnet-bridge
Allow ios/android apps to discover and direct connect to doorbirds in a different subnetgocat
IRCCat in Gomusickit
Qt+Webkit container app that exposes phonon/etc APIs to jslogtail
tail -f logfiles in a browser using websockets (erlang)sonos-shipping-forecast
Play the Shipping Forecast from BBC Radio 4, then return Sonos to original state.libmemcached
temporary repo for patching libmemcacheddotvim
my .vimwww.playdar.org
Playdar websitebevy_timewarp
A rollback library that buffers component state. Useful for netcode.captainhook
Batch set github service hooks for all repos in an orgvagrant-chef-basebox
Basic vagrant+chef setupestr-erlang-elixir-binary-string
Adaptor for using Elixir's UTF8 binary string module in Erlangbevy_naia_laminar
bevy plugin for laminar atop naia-socketappupper
deprecated, see relflow:relsandbox
Release sandbox app (various changes, with appups)irccat-cookbook
chef cookbook for irccatdot-janus
My .janus dir, containing vim config and plugins in addition to janus vim distroerlang-countess
rebar3 release playground for blog postqdaapd
An embeddable C++/Qt DAAP server libraryconjist
music network thingradioblink
WIP - Circuit which takes the audio output of a PMR radio and blinks LEDs when it receives a signalsharesight-custom-investment-price-updater
updates vg small cap price to sharesightLove Open Source and this site? Check out how you can help us