Merge remote-tracking branch 'origin/master' into develop

Conflicts:
	control/control.py
This commit is contained in:
badaix 2016-06-18 13:05:54 +02:00
commit 5e23136a53
6 changed files with 71 additions and 9 deletions

View file

@ -55,6 +55,10 @@ Different streams can by configured with a list of `-s` options, e.g.:
SNAPSERVER_OPTS="-d -s pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2&codec=flac -s file:///home/user/Musik/Some%20wave%20file.wav?name=File" SNAPSERVER_OPTS="-d -s pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2&codec=flac -s file:///home/user/Musik/Some%20wave%20file.wav?name=File"
The pipe stream (`-s pipe`) will per default create the pipe. Sometimes your audio source might insist in creating the pipe itself. So the pipe creation mode can by changed to "not create, but only read mode", using the `mode` option set to `create` or `read`:
SNAPSERVER_OPTS="-d -s pipe:///tmp/snapfifo?name=Radio&mode=read"
Test Test
---- ----
You can test your installation by copying random data into the server's fifo file You can test your installation by copying random data into the server's fifo file
@ -184,7 +188,7 @@ Unordered list of features that should make it into the v1.0
- [X] **Debian packages** prebuild deb packages - [X] **Debian packages** prebuild deb packages
- [X] **Endian** independent code - [X] **Endian** independent code
- [X] **OpenWrt** port Snapclient to OpenWrt - [X] **OpenWrt** port Snapclient to OpenWrt
- [ ] **Hi-Res audio** support (like 192kHz 24bit) - [X] **Hi-Res audio** support (like 192kHz 24bit)
- [ ] **JSON-RPC** Possibility to add, remove, rename streams
- [ ] **Protocol specification** Snapcast binary streaming protocol, JSON-RPC protocol - [ ] **Protocol specification** Snapcast binary streaming protocol, JSON-RPC protocol
- [ ] **CMake** or another build system - [ ] **Ports** Snapclient for Windows, Mac OS X, ...
- [ ] **Ports** Snapclient for Windows, ...

View file

@ -0,0 +1,50 @@
<resources>
<string name="app_name">Snapcast</string>
<string name="ticker_text">Snapclient 開始しました</string>
<string name="notification_title">Snapclient</string>
<string name="notification_text">Snapclient は実行中です...</string>
<string name="notification_info">情報...</string>
<string name="stop">停止</string>
<string name="menu_details">詳細</string>
<string name="menu_delete">削除</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="title_activity_snapcast">Snapcast</string>
<string name="action_about">アプリについて...</string>
<string name="action_settings">設定...</string>
<string name="action_scan">サーバーのスキャン</string>
<string name="action_refresh">クライアント一覧の更新</string>
<string name="action_hide_offline">オフラインのクライアントを非表示</string>
<string name="title_activity_client_settings">クライアント設定</string>
<string name="client_name">名前</string>
<string name="client_mac">MAC</string>
<string name="client_ip">IP</string>
<string name="client_host">ホスト</string>
<string name="client_os">OS</string>
<string name="client_version">バージョン</string>
<string name="client_last_seen">最後の視聴</string>
<string name="client_latency">レイテンシー</string>
<string name="online">オンライン</string>
<string name="action_play_stop">再生/停止</string>
<string name="client_deleted">クライアント %1$s を削除しました</string>
<string name="wrong_sample_rate">ストリームはネイティブのサンプリングレートではありません: %1$s\nネイティブのサンプリングレート: %2$s</string>
<string name="unknown_sample_rate">ネイティブのサンプリングレートではないストリームは同期して再生されないことがあります</string>
<string name="undo_string">元に戻す</string>
<string name="title_activity_about">アプリについて</string>
<string name="about_file">files/about.html</string>
<string name="about">アプリについて</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="client_stream">ストリーム</string>
<string name="first_run_title">警告</string>
<string name="first_run_text">これはテストクライアントです。\n正式利用用途ではありません。</string>
<string name="host">ホスト</string>
<string name="streaming_port">ストリーム ポート</string>
<string name="control_port">コントロール ポート</string>
<string name="server_host">Snapserver ホスト</string>
<string name="auto_start">Snapclient を自動開始</string>
</resources>

View file

@ -35,13 +35,20 @@ def setName(client, name):
requestId = requestId + 1 requestId = requestId + 1
if sys.argv[2] == "setVolume": if sys.argv[2] == "setVolume":
if len(sys.argv) < 4: if len(sys.argv) < 5:
print("usage: control.py <SERVER HOST> setVolume <VOLUME>") print("usage: control.py <SERVER HOST> setVolume <HOSTNAME> [+/-]<VOLUME>")
exit(0) exit(0)
volume = int(sys.argv[3]) volstr = sys.argv[4]
j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1) j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1)
for client in j["result"]["clients"]: for client in j["result"]["clients"]:
setVolume(client["host"]["mac"], volume) if(sys.argv[3] == client['host']['name'] or sys.argv[3] == 'all'):
if(volstr[0] == '+'):
volume = int(client['config']['volume']['percent']) + int(volstr[1:])
elif(volstr[0] == '-'):
volume = int(client['config']['volume']['percent']) - int(volstr[1:])
else:
volume = int(volstr)
setVolume(client['host']['mac'], volume)
elif sys.argv[2] == "setName": elif sys.argv[2] == "setName":
if len(sys.argv) < 5: if len(sys.argv) < 5:
@ -54,7 +61,7 @@ else:
j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1) j = doRequest(json.dumps({'jsonrpc': '2.0', 'method': 'Server.GetStatus', 'id': 1}), 1)
for client in j["result"]["clients"]: for client in j["result"]["clients"]:
print("MAC: " + client["host"]["mac"] + ", conntect: " + str(client['connected']) + ", volume: " + str(client["config"]["volume"]["percent"]) + ", name: " + client["config"]["name"] + ", host: " + client["host"]["name"]) print("MAC: " + client['host']['mac'] + ", connect: " + str(client['connected']) + ", volume: " + str(client['config']['volume']['percent']) + ", name: " + client['host']['name'] + ", host: " + client['host']['ip'])
telnet.close telnet.close

View file

@ -379,8 +379,9 @@ void StreamServer::start()
acceptor_ = make_shared<tcp::acceptor>(*io_service_, tcp::endpoint(tcp::v4(), settings_.port)); acceptor_ = make_shared<tcp::acceptor>(*io_service_, tcp::endpoint(tcp::v4(), settings_.port));
startAccept(); startAccept();
} }
catch (const std::exception&) catch (const std::exception& e)
{ {
logS(kLogNotice) << "StreamServer::start: " << e.what() << endl;
stop(); stop();
throw; throw;
} }