author | Dan |
Sun, 23 Mar 2008 22:03:57 -0400 | |
changeset 4 | cde92f6ec29f |
parent 3 | e7447a6044ec |
child 5 | 9b96265b5918 |
permissions | -rw-r--r-- |
0
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
1 |
<?php |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
2 |
|
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
3 |
/** |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
4 |
* Playlist displayer |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
5 |
* |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
6 |
* Web control interface script for Amarok |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
7 |
* Written by Dan Fuhry - 2008 |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
8 |
* |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
9 |
* This script is in the public domain. Use it for good, not evil. |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
10 |
*/ |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
11 |
|
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
12 |
function amarok_playlist($server) |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
13 |
{ |
4 | 14 |
global $theme, $playlist, $allowcontrol; |
15 |
||
16 |
$iphone = ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || |
|
17 |
strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') || |
|
18 |
strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') || |
|
19 |
isset($_GET['m']) |
|
20 |
); |
|
21 |
$theme_id = ( $iphone ) ? 'iphone' : $theme; |
|
22 |
$smarty = load_theme($theme_id); |
|
0
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
23 |
|
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
24 |
$active = dcop_action('playlist', 'getActiveIndex'); |
4 | 25 |
$smarty->assign('theme', $theme_id); |
0
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
26 |
$smarty->assign('playlist', $playlist); |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
27 |
$smarty->assign('active', $active); |
1 | 28 |
$smarty->assign('scripts', array( |
29 |
'ajax.js', |
|
2
860ba7141641
Should be nearly finished now - includes volume control, length measurement, and seems pretty stable
Dan
parents:
1
diff
changeset
|
30 |
'domutils.js', |
860ba7141641
Should be nearly finished now - includes volume control, length measurement, and seems pretty stable
Dan
parents:
1
diff
changeset
|
31 |
'volume.js' |
1 | 32 |
)); |
3
e7447a6044ec
$allowcontrol = false working and turned on now; switched default port back to 7447 instead of random; added favicon and apple-touch-icon
Dan
parents:
2
diff
changeset
|
33 |
$smarty->assign('allow_control', $allowcontrol); |
0
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
34 |
$smarty->display('playlist.tpl'); |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
35 |
} |
c63de9eb7045
First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff
changeset
|
36 |