public Project(TheGhostCore core) { _audioExport = null; _audioImport = null; _fileCopy = null; _audioImportInfo = null; _audioExportInfo = null; _fileCopyInfo = null; _songs = null; _tiers = null; _backgroundAudio = new List<ProjectBackgroundAudio>(); _fileManager = null; _core = core; _theGhostInfo = null; _defaults = new ProjectDefaults(); _storeProjectFiles = false; _projectSettings = new ProjectSettings(this); _projectSettingsGameMods = new ProjectSettingsGameMods(this); }
private void saveConfiguration(ProjectDefaults defaults) { try { Configuration c = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //always back this up. File paths only backed up when load is used //AppState.Backup = chkBackup.Checked; saveSetting(c, "ConfigVersion", "1"); //saveSetting(c, "InputFormat", AppState.InputFormat); saveWindowInfo(this); saveSetting(c, "WindowInfo", _windowInfo); saveSetting(c, "NotesEditorWindowInfo", NotesEditorForm.WindowInfo); saveSetting(c, "WorkingFolder", defaults.WorkingFolder); saveSetting(c, "HammerOnMeasure", defaults.HoPoMeasure.ToString()); saveSetting(c, "GuitarVolume", defaults.GuitarVolume.ToString()); saveSetting(c, "GuitarVolumeMode", defaults.GuitarVolumeMode.ToString()); saveSetting(c, "MinMsBeforeNotesStart", defaults.MinMsBeforeNotesStart.ToString()); saveSetting(c, "SmartModeCrowdImport", defaults.SmartModeCrowdImport.ToString()); saveSetting(c, "ForceMono", defaults.ForceMono.ToString()); saveSetting(c, "ForceDownSample", defaults.ForceDownSample.ToString()); saveSetting(c, "PreviewFadeLength", defaults.PreviewFadeLength.ToString()); saveSetting(c, "PreviewIncludeGuitar", defaults.PreviewIncludeGuitar.ToString()); saveSetting(c, "PreviewIncludeRhythm", defaults.PreviewIncludeRhythm.ToString()); saveSetting(c, "PreviewLength", defaults.PreviewLength.ToString()); saveSetting(c, "PreviewStart", defaults.PreviewStart.ToString()); saveSetting(c, "PreviewVolume", defaults.PreviewVolume.ToString()); saveSetting(c, "AudioSongVolume", defaults.AudioSongVolume.ToString()); saveSetting(c, "AudioGuitarVolume", defaults.AudioGuitarVolume.ToString()); saveSetting(c, "AudioRhythmVolume", defaults.AudioRhythmVolume.ToString()); saveSetting(c, "Singer", defaults.Singer.ToString()); saveSetting(c, "SingerMode", defaults.SingerMode.ToString()); saveSetting(c, "SongVolume", defaults.SongVolume.ToString()); saveSetting(c, "SongVolumeMode", defaults.SongVolumeMode.ToString()); saveSetting(c, "Year", defaults.Year.ToString()); saveSetting(c, "YearMode", defaults.YearMode.ToString()); saveSetting(c, "Gh3SustainClipping", defaults.Gh3SustainClipping.ToString()); saveSetting(c, "ForceNoStarPower", defaults.ForceNoStarPower.ToString()); saveSetting(c, "GameId", _core.Project.GameId.ToString()); saveSetting(c, "LanguageId", _core.Project.LanguageId); saveSetting(c, "AudioExportPlugin", _core.Project.AudioExportInfo.Title); saveSetting(c, "AudioImportPlugin", _core.Project.AudioImportInfo.Title); saveSetting(c, "FileCopyPlugin", _core.Project.FileCopyPluginInfo.Title); string currPrj = _core.Project.Filename; string key; int j = 0; for (int i = 0; i < 10; i++) { key = string.Format("ProjectHistory{0}", i.ToString().PadLeft(2, '0')); if (i == 0 && File.Exists(currPrj)) saveSetting(c, key, currPrj); //always save the current project as the top item else { if (defaults.ProjectHistory.Count > j && defaults.ProjectHistory[j].ToLower() != currPrj.ToLower() && File.Exists(defaults.ProjectHistory[j])) saveSetting(c, key, defaults.ProjectHistory[j]); //always save the current project as the top item else saveSetting(c, key, string.Empty); //always save the current project as the top item j++; } } c.Save(); } catch { //showException("Save Configuration Error", ex); } }
private void loadConfiguration(ProjectDefaults defaults) { try { Configuration c = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); int v = int.Parse(loadSetting(c, "ConfigVersion", "1")); loadWindowInfo(this, loadSetting(c, "WindowInfo")); NotesEditorForm.WindowInfo = loadSetting(c, "NotesEditorWindowInfo"); defaults.WorkingFolder = loadSetting(c, "WorkingFolder"); defaults.HoPoMeasure = float.Parse(loadSetting(c, "HammerOnMeasure")); defaults.GuitarVolume = float.Parse(loadSetting(c, "GuitarVolume")); defaults.GuitarVolumeMode = (DefaultSettingMode)Enum.Parse(typeof(DefaultSettingMode), loadSetting(c, "GuitarVolumeMode")); defaults.MinMsBeforeNotesStart = int.Parse(loadSetting(c, "MinMsBeforeNotesStart")); defaults.SmartModeCrowdImport = (loadSetting(c, "SmartModeCrowdImport") == "True"); defaults.ForceMono = (loadSetting(c, "ForceMono", "False") == "True"); defaults.ForceDownSample = int.Parse(loadSetting(c, "ForceDownSample", "0")); defaults.PreviewFadeLength = int.Parse(loadSetting(c, "PreviewFadeLength")); defaults.PreviewIncludeGuitar = (loadSetting(c, "PreviewIncludeGuitar") == "True"); defaults.PreviewIncludeRhythm = (loadSetting(c, "PreviewIncludeRhythm") == "True"); defaults.PreviewLength = int.Parse(loadSetting(c, "PreviewLength")); defaults.PreviewStart = int.Parse(loadSetting(c, "PreviewStart")); defaults.PreviewVolume = int.Parse(loadSetting(c, "PreviewVolume")); defaults.AudioSongVolume = int.Parse(loadSetting(c, "AudioSongVolume", defaults.AudioSongVolume.ToString())); defaults.AudioGuitarVolume = int.Parse(loadSetting(c, "AudioGuitarVolume", defaults.AudioGuitarVolume.ToString())); defaults.AudioRhythmVolume = int.Parse(loadSetting(c, "AudioRhythmVolume", defaults.AudioRhythmVolume.ToString())); defaults.Singer = (Singer)Enum.Parse(typeof(Singer), loadSetting(c, "Singer")); defaults.SingerMode = (DefaultSettingMode)Enum.Parse(typeof(DefaultSettingMode), loadSetting(c, "SingerMode")); defaults.SongVolume = float.Parse(loadSetting(c, "SongVolume")); defaults.SongVolumeMode = (DefaultSettingMode)Enum.Parse(typeof(DefaultSettingMode), loadSetting(c, "SongVolumeMode")); defaults.Year = loadSetting(c, "Year"); defaults.YearMode = (DefaultSettingModeBlank)Enum.Parse(typeof(DefaultSettingModeBlank), loadSetting(c, "YearMode")); defaults.Gh3SustainClipping = (loadSetting(c, "Gh3SustainClipping") == defaults.Gh3SustainClipping.ToString()); defaults.ForceNoStarPower = (loadSetting(c, "ForceNoStarPower") == "False"); defaults.GameId = (Game)Enum.Parse(typeof(Game), loadSetting(c, "GameId")); defaults.LanguageId = loadSetting(c, "LanguageId"); try { string aiName = loadSetting(c, "AudioExportPlugin", string.Empty); if (_core.PluginManager.AudioExportPlugins.ContainsKey(aiName)) defaults.AudioExportPlugin = _core.PluginManager.AudioExportPlugins[aiName].Title; } catch { } try { string aoName = loadSetting(c, "AudioImportPlugin", string.Empty); if (_core.PluginManager.AudioImportPlugins.ContainsKey(aoName)) defaults.AudioImportPlugin = _core.PluginManager.AudioImportPlugins[aoName].Title; } catch { } try { string exName = loadSetting(c, "FileCopyPlugin", string.Empty); if (_core.PluginManager.FileCopyPlugins.ContainsKey(exName)) defaults.FileCopyPlugin = _core.PluginManager.FileCopyPlugins[exName].Title; } catch { } string prj; for (int i = 0; i < 10; i++) { prj = loadSetting(c, string.Format("ProjectHistory{0}", i.ToString().PadLeft(2, '0'))); if (prj.Length != 0 && File.Exists(prj)) defaults.ProjectHistory.Add(prj); } } catch { //showException("Load Configuration Error", ex); } }
public void SetDefaults(ProjectDefaults defaults) { _defaults = defaults; }
internal ProjectDefaultsProperties(ProjectDefaults defaults) { _defaults = defaults; }