Comments (4)
- 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;
from noson.
You could get as example the source of the CLI tool provided with the noson-app: noson.cpp.
If you need to build a complex application handling callback from upnp subscriptions and multi-threading you could get as example the sources of the GUI backend: sonos.h , player.h.
from noson.
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.
from noson.
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.
from noson.
Related Issues (10)
- "No Sonos zone found" HOT 1
- running nosontest fails HOT 1
- How to handle the changes on the zones HOT 5
- :ConnectZone terminate with 'std::bad_alloc' HOT 2
- GNU license refers to Foobar HOT 1
- Asynchronous API HOT 1
- Correct linker settings HOT 2
- Documentation questions HOT 3
- swap* routines conflict with OpenBSD swap(3) macros HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noson.