Example #1
0
        internal PlayQueue(DACPServer server, byte[] data)
        {
            var nodes = DACPUtility.GetResponseNodes(data);

            foreach (var itemNode in nodes)
            {
                switch (itemNode.Key)
                {
                case "ceQk":
                    ID = itemNode.Value.GetStringValue();
                    break;

                case "ceQi":
                    StartIndex = itemNode.Value.GetInt32Value();
                    break;

                case "ceQm":
                    ItemCount = itemNode.Value.GetInt32Value();
                    break;

                case "ceQl":
                    Title1 = itemNode.Value.GetStringValue();
                    break;

                case "ceQh":
                    Title2 = itemNode.Value.GetStringValue();
                    break;
                }
            }
        }
Example #2
0
        internal PlayQueueItem(DACPServer server, byte[] data)
        {
            Server = server;

            var nodes = DACPUtility.GetResponseNodes(data);

            foreach (var node in nodes)
            {
                switch (node.Key)
                {
                case "ceQs":
                    byte[] value  = node.Value;
                    byte[] dbID   = { value[0], value[1], value[2], value[3] };
                    byte[] songID = { value[12], value[13], value[14], value[15] };
                    DatabaseID = dbID.GetInt32Value();
                    SongID     = songID.GetInt32Value();
                    break;

                case "ceQn":
                    SongName = node.Value.GetStringValue();
                    break;

                case "ceQr":
                    ArtistName = node.Value.GetStringValue();
                    break;

                case "ceQa":
                    AlbumName = node.Value.GetStringValue();
                    break;

                case "ceQI":
                    // ceQI is a queue index value. The "currently playing" song has an index of 1. The first queued item has
                    // an index of 2. The first "history" item has an index of 0.
                    // This appears to be one off from how the index values are dealt with elsewhere, so I'm subtracting 1
                    // from the ceQI value to get the item's queue index.
                    QueueIndex = node.Value.GetInt32Value() - 1;
                    break;
                }
            }
        }
Example #3
0
 public AirPlaySpeaker(DACPServer server, UInt64 id)
 {
     Server = server;
     ID     = id;
 }
Example #4
0
 public DACPElement(DACPServer server, DACPNodeDictionary nodes)
 {
     Server = server;
     ProcessNodes(nodes);
 }