Giter Club home page Giter Club logo

Comments (4)

janbar avatar janbar commented on September 28, 2024 1
  • 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.

janbar avatar janbar commented on September 28, 2024

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.

coleged avatar coleged commented on September 28, 2024

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.

coleged avatar coleged commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.