示例#1
0
        internal void CreateProfile(string profileName, string displayDeviceName, string displaySettings, string audioDeviceName)
        {
            validateProfile(profileName, displayDeviceName, displaySettings, audioDeviceName);
            DisplayDevicesManager.DEVMODE devMode = displayDevicesManager.GetDevModeForDisplaySettings(displaySettings);
            Profile newProfile = CreateProfileFromInput(profileName, displayDeviceName, devMode, audioDeviceName);

            profileCollection.AddProfile(newProfile);
            WriteProfileListToDataFile();
        }
示例#2
0
        private Profile CreateProfileFromInput(string profileName, string displayDeviceName, DisplayDevicesManager.DEVMODE displaySettings, string audioDeviceName)
        {
            Profile profile = new Profile
            {
                ProfileName        = profileName,
                DisplayDeviceName  = displayDeviceName,
                DisplayWidth       = displaySettings.dmPelsWidth,
                DisplayHeight      = displaySettings.dmPelsHeight,
                DisplayBits        = displaySettings.dmBitsPerPel,
                DisplayOrientation = displaySettings.dmDisplayOrientation,
                DisplayFrequency   = displaySettings.dmDisplayFrequency,
                AudioDeviceName    = audioDeviceName
            };

            return(profile);
        }