public ProgramGroupManager getProgramGroupManager(ProgramGroupManagerData PGMdata)
        {
            ProgramGroupManager outPGM = new ProgramGroupManager();

            foreach (ProgramGroupData PGdata in PGMdata.programGroups)
            {
                if (PGdata.hasHotkey)
                {
                    outPGM.addProgramGroup(new ProgramGroup(PGdata.groupName, PGdata.volAsPercent, PGdata.mods, PGdata.volumeUp, PGdata.volumeDown));
                }
                else
                {
                    outPGM.addProgramGroup(new ProgramGroup(PGdata.groupName, PGdata.volAsPercent));
                }
            }
            for (int programGroupIndex = 0; programGroupIndex < outPGM.getNumOfProgramGroups(); programGroupIndex++)
            {
                foreach (string strSession in PGMdata.programGroups.ElementAt(programGroupIndex).audioSessions)
                {
                    AudioSession aSession = ASM.getAudioSession(strSession);
                    if (aSession == null)
                    {
                        Console.WriteLine(strSession + " is not running, so it will not be loaded into an Program Group");
                        outPGM.programGroups.ElementAt(programGroupIndex).nonLoadedAudioSessions.Add(strSession);
                    }
                    else
                    {
                        outPGM.programGroups.ElementAt(programGroupIndex).addAudioSession(aSession, false);
                    }
                    //outPGM.programGroups.ElementAt(programGroupIndex).audioSessions.Add(strSession);
                }
            }
            return(outPGM);
        }
        public ProgramGroupManager getProgramGroupManager(ProgramGroupManagerData PGMdata)
        {
            ProgramGroupManager outPGM = new ProgramGroupManager();
            foreach (ProgramGroupData PGdata in PGMdata.programGroups)
            {
                if (PGdata.hasHotkey)
                {
                    outPGM.addProgramGroup(new ProgramGroup(PGdata.groupName, PGdata.volAsPercent, PGdata.mods, PGdata.volumeUp, PGdata.volumeDown) );
                }
                else
                {
                    outPGM.addProgramGroup(new ProgramGroup(PGdata.groupName, PGdata.volAsPercent));
                }

            }
            for (int programGroupIndex = 0; programGroupIndex < outPGM.getNumOfProgramGroups(); programGroupIndex++)
            {
                foreach (string strSession in PGMdata.programGroups.ElementAt(programGroupIndex).audioSessions)
                {
                    AudioSession aSession = ASM.getAudioSession(strSession);
                    if (aSession == null)
                    {
                        Console.WriteLine(strSession + " is not running, so it will not be loaded into an Program Group");
                        outPGM.programGroups.ElementAt(programGroupIndex).nonLoadedAudioSessions.Add(strSession);
                    }
                    else
                    {
                        outPGM.programGroups.ElementAt(programGroupIndex).addAudioSession(aSession, false);
                    }
                    //outPGM.programGroups.ElementAt(programGroupIndex).audioSessions.Add(strSession);

                }
            }
            return outPGM;
        }
 /*
     Generates a serializable object for save data storage and persistance
     */
 public ProgramGroupManagerData generateProgramGroupManagerData()
 {
     ProgramGroupManagerData outPGMdata = new ProgramGroupManagerData();
     foreach(ProgramGroup group in programGroups){
         outPGMdata.programGroups.Add(group.generateProgramGroupData());
         outPGMdata.NumOfProgramGroups++;
     }
     return outPGMdata;
 }
        /*
         *  Generates a serializable object for save data storage and persistance
         */
        public ProgramGroupManagerData generateProgramGroupManagerData()
        {
            ProgramGroupManagerData outPGMdata = new ProgramGroupManagerData();

            foreach (ProgramGroup group in programGroups)
            {
                outPGMdata.programGroups.Add(group.generateProgramGroupData());
                outPGMdata.NumOfProgramGroups++;
            }
            return(outPGMdata);
        }