pcremote-client-n8x0 -> client sources
[remotepc] / pcremote-server-desktop-60 / players / run-amarok.py
diff --git a/pcremote-server-desktop-60/players/run-amarok.py b/pcremote-server-desktop-60/players/run-amarok.py
new file mode 100755 (executable)
index 0000000..2d8e9bf
--- /dev/null
@@ -0,0 +1,43 @@
+import amarok
+
+if not amarok.isRunning():
+    player = amarok.AmarokPlayer()
+else:
+    print "entrou aqui"
+    amarok.start()
+    player = amarok.AmarokPlayer()
+
+while(1):
+    data = raw_input(">>> ")
+    if data == '#exit' or data == '#quit' or data == '#close':
+        print "Application closed."
+        amarok.shutdown()
+       break
+    elif data == 'next':
+        player.next()
+    elif data == 'prev':
+        player.prev()
+    elif data == 'play':
+        player.play()
+    elif data == 'pause':
+        player.pause()
+    elif data == 'stop':
+        player.stop()
+    elif data == 'mute':
+        player.mute()
+    elif data == 'volume-up':
+        player.volume_up()
+    elif data == 'volume-down':
+        player.volume_down()
+    elif data == 'current_song':
+       print player.current_song()
+    elif data == 'random':
+        player.play_random()
+    elif data == 'play-track':
+        index = input('track: ')
+        player.play_track(index)
+    elif data == 'refresh':
+        player.refresh_playlist()
+    elif data == 'show':
+        player.song_list()
+