mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-25 06:56:15 +02:00
xxxx
git-svn-id: svn://elaine/murooma/trunk@272 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
16ef1ae634
commit
feabfee936
50 changed files with 1996 additions and 1984 deletions
|
@ -22,47 +22,47 @@ namespace po = boost::program_options;
|
|||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int deviceIdx;
|
||||
string ip;
|
||||
int bufferMs;
|
||||
size_t port;
|
||||
bool runAsDaemon;
|
||||
int deviceIdx;
|
||||
string ip;
|
||||
int bufferMs;
|
||||
size_t port;
|
||||
bool runAsDaemon;
|
||||
// string sampleFormat;
|
||||
po::options_description desc("Allowed options");
|
||||
desc.add_options()
|
||||
("help,h", "produce help message")
|
||||
("port,p", po::value<size_t>(&port)->default_value(98765), "port where the server listens on")
|
||||
("ip,i", po::value<string>(&ip)->default_value("192.168.0.2"), "server IP")
|
||||
("soundcard,s", po::value<int>(&deviceIdx)->default_value(-1), "index of the soundcard")
|
||||
po::options_description desc("Allowed options");
|
||||
desc.add_options()
|
||||
("help,h", "produce help message")
|
||||
("port,p", po::value<size_t>(&port)->default_value(98765), "port where the server listens on")
|
||||
("ip,i", po::value<string>(&ip)->default_value("192.168.0.2"), "server IP")
|
||||
("soundcard,s", po::value<int>(&deviceIdx)->default_value(-1), "index of the soundcard")
|
||||
// ("sampleformat,f", po::value<string>(&sampleFormat)->default_value("48000:16:2"), "sample format")
|
||||
("buffer,b", po::value<int>(&bufferMs)->default_value(300), "buffer size [ms]")
|
||||
("daemon,d", po::bool_switch(&runAsDaemon)->default_value(false), "daemonize")
|
||||
;
|
||||
("buffer,b", po::value<int>(&bufferMs)->default_value(300), "buffer size [ms]")
|
||||
("daemon,d", po::bool_switch(&runAsDaemon)->default_value(false), "daemonize")
|
||||
;
|
||||
|
||||
po::variables_map vm;
|
||||
po::store(po::parse_command_line(argc, argv, desc), vm);
|
||||
po::notify(vm);
|
||||
po::variables_map vm;
|
||||
po::store(po::parse_command_line(argc, argv, desc), vm);
|
||||
po::notify(vm);
|
||||
|
||||
if (vm.count("help"))
|
||||
{
|
||||
cout << desc << "\n";
|
||||
return 1;
|
||||
}
|
||||
if (vm.count("help"))
|
||||
{
|
||||
cout << desc << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::clog.rdbuf(new Log("snapclient", LOG_DAEMON));
|
||||
if (runAsDaemon)
|
||||
{
|
||||
daemonize();
|
||||
std::clog << kLogNotice << "daemon started" << std::endl;
|
||||
}
|
||||
std::clog.rdbuf(new Log("snapclient", LOG_DAEMON));
|
||||
if (runAsDaemon)
|
||||
{
|
||||
daemonize();
|
||||
std::clog << kLogNotice << "daemon started" << std::endl;
|
||||
}
|
||||
|
||||
Controller controller;
|
||||
controller.start(ip, port, bufferMs);
|
||||
Controller controller;
|
||||
controller.start(ip, port, bufferMs);
|
||||
|
||||
while(true)
|
||||
usleep(10000);
|
||||
while(true)
|
||||
usleep(10000);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue