Developers

So, this looks like fun, eh? Hopefully you have all kinds of ideas on ways you can use and extend Tomahawk. Awesome. We've taken a shot at reading your mind and pointing you in the right directions below...


I want to build a website that can "talk" to Tomahawk...


As demonstrated by many of the currently available Tomahawk-compatible ecosystem (e.g. Playlick, Spiffdar, etc.), it is not only possible - but easy - to build web applications that leverage Tomahawk to automagically handle all the content resolution, and then serve that content back up to that user through your web interface. Pretty cool, eh? You can build a great site *about* music and let the user's bring their own content to your context.

Also, microformats like haudio can be supported right out of the box. Check out some examples below.


I want to write a content resolver....


Tomahawk is compatible with the Playdar Content Resolving Framework (by Richard Jones), which is comprised of a set of content resolvers and an asynchronous cascading resolver pipeline. Think of a "resolver" as an available content source... in the pipeline, the highest weighting are queried first, and the search is quickly passed on to other resolvers in the chain until a match is found. As soon as a query is "solved", the pipeline is aborted and the result is returned as a playable track.

Resolver plugins are loaded into the pipeline with a weight and target time.

The weight is an int between 1-100, and dictates the order in which resolver plugins are queried. The most reliable and fastest resolver has a weight of 100 (ie the one that matches files on your hard disk).

The target time is a millisecond value that the resolver will probably have found results in, if any exist. If a query is still not solved after the target time has elapsed, the query is dispatched to the resolver with the next highest weight.

Results are still valid if reported after the targettime, it's simply used to decide when to hit up the next resolver.
This helps cut down on spam. There's no point in querying the entire internet if you find a result on your hard disk.

Resolvers with equal weights are dispatched to in parallel, and the smallest targettime of resolvers at that weight is used to decide when to dispatch the query to the next resolver(s).

Currently the local-files resolver, the LAN resolver and the Jabber resolver are fully supported and built by default. This allows you to find files on your hard disk, and from other machines running Tomahawk on your home network.

To write additional resolvers that find content from other sources:

  • Read the resolver API documentation that is available here: Playdar Resolver API
  • Any scripting language or other program can be spawned as an external process, which Tomahawk (and/or Playdar) talks to by writing to stdin and reading stdout. You need to parse requests to stdin (JSON objects) and write any results to stdout (also as JSON objects). Tomahawk does the rest for you.

    Example: demo PHP resolver script

  • Check out some of the other Tomahawk resolvers as additional examples (e.g. see what a Javascript resolver looks like) that and give them a try.
  • Also, you should check out some of the original Playdar resolvers that others have already written. In theory, the script resolvers written for Playdar should work with Tomahawk, but most of them have broken over time and need some tweaking. Feel free to jump in to these and get them up and running again!


I want to write a SIP plug-in...


Have ideas of other Session Initiation Protocol plug-ins you'd like to see supported? AIM? Multiuser chat rooms? Documentation is still light at this one, but head on over to the wiki and see what you can find there.


I want the full source code...


Love Qt and/or C++, dive on into our source... the water is fine!


I want to file a bug...


What?! A bug? Can't be! Heh... oh yeah, I guess there *may* be some bugs you find from time to time. In all seriousness, we'd love to hear where they are hiding so we can hunt them down, squash them, and then mount their tiny little heads on our walls as trophies.


I want to tell you about an idea or feature request I had...


Excellent. Take a quick read of what we are thinking already... maybe we are already working on it, or maybe it will help spur some more ideas for you.


I want to join the conversation...


Want to talk to us? You can always find one of us in the #tomahawk IRC channel...