Exemplo n.º 1
0
 public static async Task NetRadioSetPresetAsync(this ISCPConnection connection, short preset)
 {
     await connection.SendCommandAsync(new NetRadioPreset()
     {
         Preset = preset
     });
 }
 public static async Task <NetListInfoExtended> GetNetListExtended(this ISCPConnection connection, short layer, short nbrOfItems = 30, short startIndex = 0, short sequence = 0)
 {
     return(await connection.SendCommandAsync <NetListInfoExtended>(new NetListInfoExtended()
     {
         Sequence = sequence, Layer = layer, NumberOfItems = nbrOfItems, StartIndex = startIndex
     }));
 }
Exemplo n.º 3
0
 public async Task ConnectTest()
 {
     using (var connection = new ISCPConnection())
     {
         await connection.ConnectAsync(IPAddress);
     }
 }
        public static async Task SelectNetListInfoExtended(this ISCPConnection connection, short layer, short index, short sequence = 0)
        {
            await connection.SendCommandAsync(new NetListInfoSelectExtended()
            {
                Sequence = sequence, Layer = layer, Index = index
            });

            connection.MessageProcessingWaitHandle.WaitOne();
        }
Exemplo n.º 5
0
        public static async Task SetNetServiceAsync(this ISCPConnection connection, NetServices service)
        {
            await connection.SendCommandAsync(new NetService()
            {
                Serivce = service
            }, 10000, (om, sm) => sm.Command == "NLS");                                                                        // after sending NSV, NLT + NLS (many) are expected

            connection.MessageProcessingWaitHandle.WaitOne();
        }
Exemplo n.º 6
0
        public static async Task SelectNetListInfoByIndex(this ISCPConnection connection, short index)
        {
            await connection.SendCommandAsync(new NetListInfoSelect()
            {
                IndexNbr = index
            }, 10000);

            connection.MessageProcessingWaitHandle.WaitOne();
        }
Exemplo n.º 7
0
        public async Task SetVolumeExtTest()
        {
            using (var connection = new ISCPConnection())
            {
                await connection.ConnectAsync(IPAddress);

                await connection.PowerOnAsync();

                var vol = await connection.SetVolumeAsync(90);

                Assert.Equal(90, vol.VolumeLevel);
            }
        }
Exemplo n.º 8
0
        public async Task SetVolumeTest()
        {
            using (var connection = new ISCPConnection())
            {
                await connection.ConnectAsync(IPAddress);

                await connection.PowerOnAsync(Zone.Main);

                var vol = await connection.SendCommandAsync <Volume>(new Volume(Zone.Main) { VolumeLevel = 80 });

                Assert.Equal(80, vol.VolumeLevel);
            }
        }
Exemplo n.º 9
0
        public static async Task <string> GetNetTitleNameAsync(this ISCPConnection connection)
        {
            var ntn = await connection.SendCommandAsync <NetTitleName>(new NetTitleName());

            return(ntn.Title);
        }
Exemplo n.º 10
0
 public static async Task <NetArtistName> GetNetArtistNameAsync(this ISCPConnection connection)
 {
     return(await connection.SendCommandAsync <NetArtistName>(new NetArtistName()));
 }
Exemplo n.º 11
0
 public static async Task <NetJacketArt> GetNetJacketArtAsync(this ISCPConnection connection)
 {
     return(await connection.SendCommandAsync <NetJacketArt>(new NetJacketArt()));
 }
Exemplo n.º 12
0
 public static async Task <NetTrackFileInfo> GetNetTrackFileInfoAsync(this ISCPConnection connection)
 {
     return(await connection.SendCommandAsync <NetTrackFileInfo>(new NetTrackFileInfo()));
 }