/*
     Creates a Program Group with the specified name and adds
     the group to the Collection of Program Groups
     */
 public void createProgramGroup(string groupName)
 {
     ProgramGroup toBeAdded = new ProgramGroup(groupName, 100);
     toBeAdded.updateVolume();
     programGroups.Add(toBeAdded);
     updateNumOfGroups();
 }
Esempio n. 2
0
        private void saveKbButton_Click(object sender, EventArgs e)
        {
            if (programGroupList.SelectedItem != null)
            {
                ProgramGroup targetGroup = Program.PGM.getProgramGroup(programGroupList.SelectedIndex);

                targetGroup.unregisterHotkeys();

                //hotkey data
                List <string> keyModifiers = new List <string>();

                //store the keystroke modifiers
                if (checkBoxCTRL.Checked)
                {
                    keyModifiers.Add(Modifiers.Ctrl.ToString());
                }
                if (checkBoxALT.Checked)
                {
                    keyModifiers.Add(Modifiers.Alt.ToString());
                }
                if (checkBoxWIN.Checked)
                {
                    keyModifiers.Add(Modifiers.Win.ToString());
                }
                targetGroup.setVolumeHotkeyModifiers(keyModifiers);
                targetGroup.registerHotkey(this);
            }
        }
Esempio n. 3
0
        private void programGroupList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (programGroupList.SelectedItem != null)
            {
                this.infoBox.Visible = true;
                programBox.Name      = programGroupList.SelectedItem.ToString();
                programBox.Text      = programGroupList.SelectedItem.ToString();

                programsInGroupList.Items.Clear();

                /*foreach (ProgramGroup group in Program.PGM.programGroups)
                 * {
                 *  group.updateActiveSessions();
                 * }*/
                foreach (AudioSession session in Program.PGM.programGroups.ElementAt(programGroupList.SelectedIndex).loadedAudioSessions)
                {
                    programsInGroupList.Items.Add(session.Process.ProcessName);
                }

                //*****display hotkey Box
                ProgramGroup targetGroup = Program.PGM.getProgramGroup(programGroupList.SelectedIndex);

                //display volume
                this.curVolume.Text = targetGroup.getVolume().ToString() + "%";


                //display currently binded hotkeys
                checkBoxCTRL.Checked = false;
                checkBoxALT.Checked  = false;
                checkBoxWIN.Checked  = false;
                if (targetGroup.hasHotkey)
                {
                    foreach (string modifiers in targetGroup.mods)
                    {
                        switch (modifiers)
                        {
                        case "Ctrl":
                            checkBoxCTRL.Checked = true;
                            break;

                        case "Alt":
                            checkBoxALT.Checked = true;
                            break;

                        case "Win":
                            checkBoxWIN.Checked = true;
                            break;
                        }
                    }
                    this.volUpHotkey.Text   = targetGroup.getVolumeUpHotkey();
                    this.volDownHotkey.Text = targetGroup.getVolumeDownHotkey();
                }
                else
                {
                    this.volUpHotkey.Text   = "None Binded";
                    this.volDownHotkey.Text = "None Binded";
                }
            }
        }
Esempio n. 4
0
 private void updateDisplayedVolume()
 {
     if (programGroupList.SelectedItem != null)
     {
         ProgramGroup targetGroup = Program.PGM.getProgramGroup(programGroupList.SelectedIndex);
         this.curVolume.Text = targetGroup.getVolume().ToString() + "%";
     }
 }
 public KeybindingPrompt(ProgramGroup group, String volUpDown)
 {
     InitializeComponent();
     this.group = group;
     this.volUpDown = volUpDown;
     String messageToUser = "******" + group.getName() + " group's volume " + volUpDown;
     this.message1.Text = messageToUser;
 }
        /*
         *  Creates a Program Group with the specified name and adds
         *  the group to the Collection of Program Groups
         */
        public void createProgramGroup(string groupName)
        {
            ProgramGroup toBeAdded = new ProgramGroup(groupName, 100);

            toBeAdded.updateVolume();
            programGroups.Add(toBeAdded);
            updateNumOfGroups();
        }
        public KeybindingPrompt(ProgramGroup group, String volUpDown)
        {
            InitializeComponent();
            this.group     = group;
            this.volUpDown = volUpDown;
            String messageToUser = "******" + group.getName() + " group's volume " + volUpDown;

            this.message1.Text = messageToUser;
        }
Esempio n. 8
0
 private void setVolumeDown_Click(object sender, EventArgs e)
 {
     if (programGroupList.SelectedIndex != -1)
     {
         ProgramGroup targetGroup = Program.PGM.getProgramGroup(programGroupList.SelectedIndex);
         Form         prompt      = new KeybindingPrompt(targetGroup, "Down");
         prompt.ShowDialog();
         this.volDownHotkey.Text = targetGroup.getVolumeDownHotkey();
         saveKbButton_Click(null, null);
     }
 }
Esempio n. 9
0
 private void addButton_Click(object sender, EventArgs e)
 {
     if (programGroupList.SelectedItem != null &&
         AudioSessionList.SelectedItem != null)
     {
         ProgramGroup targetGroup = Program.PGM.programGroups.ElementAt(
             programGroupList.SelectedIndex);
         targetGroup.addAudioSession(Program.ASM.activeAudioSessions.ElementAt(
                                         AudioSessionList.SelectedIndex), false);
     }
     programGroupList_SelectedIndexChanged(-99, null);
 }
 /*
  *  Prints the Collection of program groups to the
  *  Console
  */
 public void displayProgramGroups()
 {
     Console.Clear();
     Console.WriteLine("======[Program Groups]======");
     // dump all audio sessions
     if (NumOfProgramGroups > 0)
     {
         for (int i = 0; i < programGroups.Count; i++)
         {
             ProgramGroup currentGroup = programGroups.ElementAt(i);
             currentGroup.updateActiveSessions();
             Console.WriteLine(i + ") " + currentGroup.getName() + " - " + currentGroup.getNumOfPrograms() + " Programs");
         }
     }
     else
     {
         Console.WriteLine("You don't have any Program Groups!");
     }
     Console.WriteLine("======[END]======");
 }
 /*
  *  Adds a Program Group to the Collection
  */
 public void addProgramGroup(ProgramGroup toBeAdded)
 {
     toBeAdded.updateVolume();
     programGroups.Add(toBeAdded);
     updateNumOfGroups();
 }
 /*
     Adds a Program Group to the Collection
     */
 public void addProgramGroup(ProgramGroup toBeAdded)
 {
     toBeAdded.updateVolume();
     programGroups.Add(toBeAdded);
     updateNumOfGroups();
 }