Exemplo n.º 1
0
        private static DefaultDevice UpdateDefaultDevice(RPIDefaultDevice Defaultdevice, ref RPIData RPIdata, ref List <ProgramData> Programs)
        {
            if (GlobalPiData.DefaultDevice.ChangeDevice == false)
            {
                DefaultDevice device = GlobalPCData.defaultDevice;
                device.Volume = Defaultdevice.Volume;
                device.IsMute = Defaultdevice.IsMute;
                Mixer.Mixer.UpdateDefaultDevice(Defaultdevice, RPIdata);
                return(device);
            }
            else
            {
                GlobalPiData.DefaultDevice.ChangeDevice = false;
                Mixer.Mixer.AudioDevices defaultDevices = new Mixer.Mixer.AudioDevices();

                defaultDevices.UpdateAudioDevices();

                for (int i = 0; i < defaultDevices.Devices.Count; i++)
                {
                    if (defaultDevices.Devices[i].Name == GlobalPCData.defaultDevice.Name)
                    {
                        if (i == defaultDevices.Devices.Count - 1)
                        {
                            i = 0;
                        }
                        else
                        {
                            i += 1;
                        }

                        defaultDevices.SetDefaultAudioDevice(defaultDevices.Devices[i].Id);
                        Programs = Mixer.Mixer.GetProgramsFirstTime();
                        return(Mixer.Mixer.GetPCDataDefaultDevice());
                    }
                }
            }
            return(Mixer.Mixer.GetPCDataDefaultDevice());
        }
Exemplo n.º 2
0
 public static void UpdateDefaultDevice(RPIDefaultDevice device, RPIData data)
 {
     SetDefaultMasterVolume(device.Volume);
     SetMasterMute(device.IsMute, ref data);
 }