Rhythmwebプラグイン
Rhythmwebプラグインは、ブラウザーから「Rhythmbox」を操作できるようにするプラグインです。1.PPAの追加
以下のPPAを追加します。すでにこのPPAを追加している場合は、この手順を飛ばしてください。
- ppa:fossfreedom/rhythmbox-plugins
2.インストール
「Ubuntuソフトウェアセンター」を起動し、「rhythmbox-plugin-rhythmweb」で検索します。「インストール」ボタンをクリックします。
3.プラグインの有効化
「Rhythmbox」を再起動して「プラグインの設定」画面を開くと「Rhythmweb」プラグインが追加されているので、「Rhythmweb」プラグインにチェックを入れます。これでブラウザーからRhythmboxを操作できるようになります。
Rhythmwebプラグインの設定
Rhythmwebプラグインを使用する前に、Rhythmwebプラグインの設定を行うと良いでしょう。Rhythmwebプラグインを選択し右下の「設定」ボタンをクリックすると、以下のように設定画面が表示されます。
Port
Rhythmwebプラグインはブラウザーから操作できるようにするため、ウェブサーバーを起動します。このウェブサーバーがリクエストを受け付けるポート番号を指定します。
ここでは例として、「9000」を指定しました。
Aboutタブについて
「About」タブでは、Rhythmwebプラグインの動作確認が行われた環境が表示されます。設定項目はありません。
ブラウザーからアクセス
ブラウザーからアクセスします。URLは以下のようになります。
- http://サーバーのURL:ポート番号
以下のように、「Rhythmbox」を操作するボタンや曲の一覧が表示されます。
RhythmwebのUI構成
RhythmwebのUI構成です。1.Play/Stop
現在再生している曲の一時停止と再生を切り替えます。2.前の曲
前の曲を再生します。3.次の曲
次の曲を再生します。4.リピート
リピート再生を有効にします。5.シャッフル
曲をシャッフルします。6.Toggle Play-queues
「10.」の表示・非表示を切り替えます。7.ボリュームを上げる
ボリュームを1段階上げます。8.ボリュームを下げる
ボリュームを1段階下げます。9.曲のタイトル
再生中の曲のタイトルが表示されます。10.ミュージックとプレイリスト
「11.」の曲一覧に表示するソースを選択します。11.曲一覧
曲一覧です。曲をダブルクリックすると、その曲を再生します。
Rhythmwebプラグインが動作しない問題(2016/3/13)
現状Rhythmwebプラグインは動作しません。動作するようにするには、最低でも以下の修正が必要になります。
--- /usr/lib/rhythmbox/plugins/rhythmweb/rhythmweb.py
+++ /home/ubuntu/rhythmweb.py
@@ -29,6 +29,7 @@
import socket
from wsgiref.simple_server import WSGIRequestHandler
from wsgiref.simple_server import make_server
+from wsgiref.handlers import format_date_time
from gi.repository import Gio
from gi.repository import Gtk
@@ -366,7 +367,7 @@
else:
#response('204 No Content', [('Content-type','text/plain')])
response('204 No Content', [])
- return bytestring('OK')
+ return [bytestring('OK')]
# generate the playing headline
title = 'Rhythmweb'
@@ -625,8 +627,7 @@
else:
icon = open(fname)
- lastmod = time.gmtime(os.path.getmtime(fname))
- lastmod = time.strftime("%a, %d %b %Y %H:%M:%S +0000", lastmod)
+ lastmod = format_date_time(os.path.getmtime(fname))
response_headers = [('Content-type',content_type),
('Last-Modified', lastmod)]
response('200 OK', response_headers)
@@ -655,8 +656,7 @@
else:
icon = open(fname)
- lastmod = time.gmtime(os.path.getmtime(fname))
- lastmod = time.strftime("%a, %d %b %Y %H:%M:%S +0000", lastmod)
+ lastmod = format_date_time(os.path.getmtime(fname))
response_headers = [('Content-type',content_type),
('Last-Modified', lastmod)]
response('200 OK', response_headers)
@@ -697,8 +697,7 @@
path = resolve_path(path)
if os.path.isfile(path):
- lastmod = time.gmtime(os.path.getmtime(path))
- lastmod = time.strftime("%a, %d %b %Y %H:%M:%S +0000", lastmod)
+ lastmod = format_date_time(os.path.getmtime(path))
response_headers = [('Content-type','text/css'),
('Last-Modified', lastmod)]
response('200 OK', response_headers)





