mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 08:26:16 +02:00
xxx
git-svn-id: svn://elaine/murooma/trunk@122 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
b0fe090d21
commit
ce1c5fb3ac
5 changed files with 73 additions and 40 deletions
20
client.cpp
20
client.cpp
|
@ -8,7 +8,6 @@
|
|||
#include <zmq.hpp>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <deque>
|
||||
|
@ -16,9 +15,9 @@
|
|||
#include <algorithm>
|
||||
#include <thread>
|
||||
#include <portaudio.h>
|
||||
#include <iterator>
|
||||
|
||||
#include "chunk.h"
|
||||
#include "utils.h"
|
||||
#include "stream.h"
|
||||
#include "zhelpers.hpp"
|
||||
|
||||
|
@ -49,17 +48,6 @@ void player()
|
|||
|
||||
|
||||
|
||||
std::string getMacAddress()
|
||||
{
|
||||
std::ifstream t("/sys/class/net/eth0/address");
|
||||
std::string str((std::istreambuf_iterator<char>(t)),
|
||||
std::istreambuf_iterator<char>());
|
||||
str.erase(std::find_if(str.rbegin(), str.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), str.end());
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void control(Stream* stream)
|
||||
{
|
||||
zmq::context_t context(1);
|
||||
|
@ -74,11 +62,7 @@ void control(Stream* stream)
|
|||
s_send (worker, "ready");
|
||||
while (1) {
|
||||
std::string cmd = s_recv (worker);
|
||||
istringstream iss(cmd);
|
||||
vector<std::string> splitCmd;
|
||||
copy(istream_iterator<string>(iss), istream_iterator<string>(), back_inserter<vector<string> >(splitCmd));
|
||||
for (size_t n=0; n<splitCmd.size(); ++n)
|
||||
std::cout << "cmd: " << splitCmd[n] << "\n";
|
||||
vector<std::string> splitCmd = split(cmd);
|
||||
if (splitCmd.size() > 1)
|
||||
{
|
||||
if (splitCmd[0] == "buffer")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue