Giter Club home page Giter Club logo

noson's Introduction

build status

About NOSON

This project is intended to create a easy client interface to drive SONOS player. Its development started from November 2015 and today the API supports basic features to browse music index and control playback in any zones.

Building

Linux, BSD, OSX

Configure, make and install

cmake -DCMAKE_BUILD_TYPE=Release $NOSON_PROJECT_DIR
make
sudo make install

Windows

Start by installing VC studio 2012 and CMAKE tool

To build open a command tool CMD.EXE from the project folder and execute the following

mkdir build_vc
cd build_vc
cmake ..
cmake --build .

Running a test

./test/nosontest

Generate the documentation

sudo apt-get install graphviz
cd {SOURCE_PATH}/docs
doxygen doxygen-dev.cfg
firefox doxygen-dev-docs/html/index.html

Sample code

You will find a basic usage in test/src/test.cpp.

Then you can have a look on the app https://github.com/janbar/noson-app.

noson's People

Contributors

gravity981 avatar hermansr avatar janbar avatar klemensn avatar sandsmark avatar setine avatar yasij avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

noson's Issues

documentation seems to be empty

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).

Documentation questions

Hi, so far, love the concept. but I'm having some issues figuring out how to use this library. My goal is a QT C++ implementation to add into a QT frontend I have in my living room that shows a clock, TV metadata, and some other information from around the house. I would love to use noson to add to that the ability to show what's on my speakers when they are playing.

I'm using the noson test.cpp as a jumping off point, and am digging into the source (doxygen and source actually). However, I'm having some trouble identifying how to use the API effectively. I have been able to follow the test.cpp code to list my players and zones in a test UI, but what I'm having trouble with is identifying HOW to use a player object to get status of when something starts to play, get the player metadata and album art, and what is the callback used for and how? More importantly, how does one use the handle to determine context? I can see that a callback is fired in Player::CB_RenderingControl, but I don't know why, or how to determine from the handle that this is what happened.

So, what I'm asking for is a small documented API getting started guide. The doxygen doesn't actually tell me how Discover() works, or how GetPlayer works, or how to use those things to cobble together a useful implementation. Google isn't showing me any existing apps that used the library directly, so I can't find someone else who has figured this out already.

Also, as I dig into the code, would you be willing to accept documentation updates as patches if I can (or have time) to do them? Doxygen can be very powerful if you have a main page with some examples and then each function tells why it's used and other details.

running nosontest fails

hey janbar

I tried to run ./nosontest but sonos.Discover() returns false.
I have a Sonos Play:1 in the same LAN as my dev environment.
Am I'missing something?

greetz

swap* routines conflict with OpenBSD swap(3) macros

https://man.openbsd.org/swap16.3

/usr/ports/pobj/noson-2.12.6/noson-2.12.6/noson/src/private/byteorder.h:57:23: error: redefinition of '__uint16_t' as different kind of symbol
static inline int16_t swap16(int16_t val)
                      ^

I haven't looked as to why noson needs its own routines for this and/or which one should be used, but a simple fix to unbreak the build is prepending #undef swap16 to the function definition in byteorder.h -- same problem for swap32().

Full build failure log, in case that helps: https://gist.github.com/klemensn/cc23726ee6231c0708720905003168c2

Correct linker settings

After installing, the library, I'm currently using gcc -lnosonos mystuff.cpp in the makefile. However whatever I'm trying to compile, I'm getting linker errors. For instance, here's a minimal example:

#include <noson/sonossystem.h>
#include <noson/sonosplayer.h>
#include <noson/contentdirectory.h>
#include <noson/didlparser.h>
#include <noson/imageservice.h>
#include <noson/filestreamer.h>
#ifdef HAVE_PULSEAUDIO
#include <noson/pulsestreamer.h>
#endif

SONOS::System *gSonos = 0;
SONOS::PlayerPtr gPlayer;
int gDebug = 0;

The error message for this example is:

g++ -o binary -lnoson main.cpp
/usr/bin/ld: /tmp/ccv53Urr.o: in function `SONOS::shared_ptr<SONOS::Player>::reset()':
main.cpp:(.text._ZN5SONOS10shared_ptrINS_6PlayerEE5resetEv[_ZN5SONOS10shared_ptrINS_6PlayerEE5resetEv]+0x26): undefined reference to `SONOS::IntrinsicCounter::Decrement()'
/usr/bin/ld: main.cpp:(.text._ZN5SONOS10shared_ptrINS_6PlayerEE5resetEv[_ZN5SONOS10shared_ptrINS_6PlayerEE5resetEv]+0x6d): undefined reference to `SONOS::IntrinsicCounter::~IntrinsicCounter()'
collect2: error: ld returned 1 exit status

What do I need to feed to my linker in order to be able to write noson code?

:ConnectZone terminate with 'std::bad_alloc'

I get this:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

THis occurs when I make a discover and I call l bool System::ConnectZone(const ZonePtr& zone, void* CBHandle, EventCB eventCB) I see that a new Player(zone, m_eventHandler, CBHandle, eventCB) is connected.

What shall I do to prevent it ?
Would it be a good idea in System::ConnectZone to destry an eventual player stored at m_connectedZone.player ?

"No Sonos zone found"

Hi,

Just tried to test this app out and received "No Sonos zone found".

It's a fresh install of 16.04, no VPN or anything, just connected directly to the network the Sonos Play is on.

Are there any logs I can access?

How to handle the changes on the zones

Hi Janbar,
first at all thanks for your work!

I'm trying to handle my sonos via the knx installation of my home.
So far looks like working, my major problem is to handle when the groups/zones are changing.
I tried to supervise the connectedZonePtr->GetZoneName but this is not changing after initialization.
When I got a CB event from the System, I also tried to get again the GetZoneList() and scan, but no one is set as disconnected (for the moment I decided to keep all devices not p grouped in a zone when I start my application).

I have to admit that I know good ansi C (development of embedded systems since 20 years) but the C++ special features are not my specialty, this maybe limits a bit my understanding of your library.

There are my questions:

  1. I do not know how to handle the groups/zones changes, could you give me a hint?
  2. Shall I avoid to perform some calls on the callback context?

Thanks a lot
Daniele

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.