Closed coleged closed 6 years ago
Thanks. The CLI code helps me a lot. My tool will be quite simple. What I'm struggling to understand is how I go about changing the topology - i.e. I want to create zones autonomously - which Class/method(s) should study. I see how to find the players in a zone, but not how I add/remove players.
Join a list of zone to an other zone
SONOS::ZonePtr toZone; // the zone target (coordinator) at which you want to link others zones
std::vector<SONOS::ZonePtr> zones; // list of zones to join to the coordinator
if (toZone && toZone->GetCoordinator())
{
for (std::vector<SONOS::ZonePtr>::const_iterator it = zones.begin(); it != zones.end(); ++it)
{
if ((*it)->GetZoneName() == toZone->GetZoneName())
continue;
for (std::vector<SONOS::ZonePlayerPtr>::iterator itr = (*it)->begin(); itr != (*it)->end(); ++itr)
{
SONOS::Player player(*itr);
player.JoinToGroup(toZone->GetCoordinator()->GetUUID());
}
}
return true;
}
return false;
join a room to a zone
SONOS::ZonePtr toZone; // the zone target (coordinator) at which you want to link the room
SONOS::ZonePlayerPtr room; // the room to join
if (toZone && toZone->GetCoordinator() && room && room->IsValid())
{
SONOS::Player player(room);
return player.JoinToGroup(toZone->GetCoordinator()->GetUUID());
}
else
return false;
unjoin room from a zone
SONOS::ZonePlayerPtr room; // the room to unjoin
if (room && room->IsValid())
{
SONOS::Player player(room);
return player.BecomeStandalone();
}
else
return false;
Thanks for speedy response. I have success. Two days from finding the noson library, I now have a working prototype of my tool. Most of the credit lies with your project as I'm just an old C hacker struggling with the whole object paradigm, frameworks and IDE's.
This looks like what I'm looking for. I have built the lib and run tests on Ubuntu - all seems to be working. Would like to see some documents on how to use the library possibly with a few examples. My goal is to build a server side tool to schedule/shape sound scenes across a Sonos network spanning a large residential building (17 locations at present).