This comprises two scripts:
- A PHP script to parse the Jamulus log file and emit it as a JSON response
- A JS script to parse the JSON response and emit an SVG DOM node
This replaces the History Graph that used to be part of the Jamulus server itself.
-
jQuery Timer by Matt Schmidt
- https://github.com/sloat/timer/blob/8ecea1543327a7d09be35fcab677fe930ba4b684/jquery.timer.js jquery.timer.js is needed. Put it in the same place as the other js files. I used this old version but the new version is the same except it's "MIT License" rather than "BSD License" and actually includes a LICENSE.txt file! "In truth, I don't really care what you do with it," says Matt...
-
jQuery (1.6.1) and jQueryUI (1.8.13) themselves These are pulled down from the
http://ajax.googleapis.com/ajax/libs
server, so "should just work".
I have my Apache HTTPD configured to find php files in all the right places... so I tend to leave ".php" off names when invoking them. If the call fails, either edit the js or change your Apache config.
You will need to specify the server-side location of your Jamulus log. This all works only if you are running the webserver (including the PHP) on a box that has access to the Jamulus log. Right up at the top of the script, you'll find:
$jamulus_log = "/opt/Jamulus/log/Jamulus.log";
Change as required.
The script is currently rather flexible (I'm trusting...) and allows the caller to specify the number of days required and the max lines (or the number of lines plus a flag that can be used to have the lines from the start). You may want to remove some of this.
js/history_controller.js
is a jQuery controller that does two main things:
- find all the "interesting" bits of
index.html
- runs the timed updates to the graph.
So if you want to change index.html
, you will need to update the jQuery, too.
One of the most likely bits is the number of days history to show. The reference to that in the html is now linked to the value in the javascript.
You should have the js
and php
directories as subdirectories of the directory index.html
lives in:
.../index.html
.../js/...
.../php/...
index.html
pulls the js files in on that basis and js/history_controller.js
calls the php script on that basis.
If you want to change things, you'll need to update both.