Esempio n. 1
0
        private void Form2_Load(object sender, EventArgs e)
        {
            ArrayList a = profile.getButtonData(button);

            switch (a[0])
            {
            case "Program":
                radioProgram.Checked = true;
                programPath.Text     = a[1].ToString();
                break;

            case "Windows":
                if (a[1].Equals(""))
                {
                    radioWindowsMute.Checked = true;
                }
                else
                {
                    radioProgramMute.Checked = true;
                    inputProgram.Text        = a[1].ToString().Split('\\')[1];
                }
                break;

            case "nircmd":
                defaultAudioDevice.Checked = true;
                deviceName.Text            = a[1].ToString().Split('\\')[1];
                break;

            default:
                radioDefault.Checked = true;
                break;
            }
        }
Esempio n. 2
0
        private void buttonCommands(string buttonId)
        {
            ArrayList data = profile.getButtonData(buttonId);

            switch (data[0])
            {
            case "Program":
                Process.Start(data[1].ToString());
                break;

            case "Windows":
                if (data[1].Equals(""))
                {
                    AudioManager.ToggleMasterVolumeMute();
                }
                else
                {
                    //Drop a error when is used sometimes in a row.
                    program = getPid(data[1].ToString().Split('\\')[1]);
                    string status = AudioManager.GetApplicationMute(program).ToString();
                    //Console.WriteLine(status);
                    if (status.Equals("False"))
                    {
                        AudioManager.SetApplicationMute(program, true);
                    }
                    else
                    {
                        AudioManager.SetApplicationMute(program, false);
                    }
                }
                break;

            case "nircmd":
                string audioSource = data[1].ToString().Split('\\')[1];
                NirCmdCall.DoNirCmd("setdefaultsounddevice \"" + audioSource + "\"");
                break;

            default:
                PressKey(Keys.F13, false);
                PressKey(Keys.F13, true);
                break;
            }
        }