Esempio n. 1
0
        public static void Save()
        {
            var ini = new IniFile();

            ini.SetInt("General", "Version", SettingsVersion);
            ini.SetBool("UI", "ShowTutorial", ShowTutorial);
            ini.SetInt("UI", "DpiScaling", DpiScaling);
            ini.SetInt("UI", "TimeFormat", TimeFormat);
            ini.SetInt("UI", "FollowMode", FollowMode);
            ini.SetInt("UI", "FollowSync", FollowSync);
            ini.SetBool("UI", "CheckUpdates", CheckUpdates);
            ini.SetBool("UI", "ShowNoteLabels", ShowNoteLabels);
            ini.SetBool("UI", "ShowPianoRollViewRange", ShowPianoRollViewRange);
            ini.SetBool("UI", "TrackPadControls", TrackPadControls);
            ini.SetBool("UI", "ReverseTrackPad", ReverseTrackPad);
            ini.SetInt("Audio", "NumBufferedFrames", NumBufferedAudioFrames);
            ini.SetInt("Audio", "InstrumentStopTime", InstrumentStopTime);
            ini.SetBool("Audio", "SquareSmoothVibrato", SquareSmoothVibrato);
            ini.SetBool("Audio", "NoDragSoungWhenPlaying", NoDragSoungWhenPlaying);
            ini.SetString("MIDI", "Device", MidiDevice);
            ini.SetString("Folders", "LastFileFolder", LastFileFolder);
            ini.SetString("Folders", "LastInstrumentFolder", LastInstrumentFolder);
            ini.SetString("Folders", "LastSampleFolder", LastSampleFolder);
            ini.SetString("Folders", "LastExportFolder", LastExportFolder);
            ini.SetString("FFmpeg", "ExecutablePath", FFmpegExecutablePath);

            Directory.CreateDirectory(GetConfigFilePath());

            ini.Save(GetConfigFileName());
        }
Esempio n. 2
0
        public static void Save()
        {
            var ini = new IniFile();

            ini.SetInt("UI", "DpiScaling", DpiScaling);
            ini.SetInt("UI", "TimeFormat", TimeFormat);
            ini.SetBool("UI", "CheckUpdates", CheckUpdates);
            ini.SetBool("UI", "TrackPadControls", TrackPadControls);
            ini.SetBool("UI", "ReverseTrackPad", ReverseTrackPad);
            ini.SetInt("Audio", "InstrumentStopTime", InstrumentStopTime);
            ini.SetBool("Audio", "SquareSmoothVibrato", SquareSmoothVibrato);
            ini.SetString("MIDI", "Device", MidiDevice);
            ini.SetString("Folders", "LastFileFolder", LastFileFolder);
            ini.SetString("Folders", "LastInstrumentFolder", LastInstrumentFolder);
            ini.SetString("Folders", "LastSampleFolder", LastSampleFolder);

            Directory.CreateDirectory(GetConfigFilePath());

            ini.Save(GetConfigFileName());
        }
Esempio n. 3
0
        public static void Save()
        {
            var ini = new IniFile();

            // General
            ini.SetInt("General", "Version", SettingsVersion);
            ini.SetBool("General", "CheckUpdates", CheckUpdates);
            ini.SetBool("General", "TrackPadControls", TrackPadControls);
            ini.SetBool("General", "ShowTutorial", ShowTutorial);

            // UI
            ini.SetInt("UI", "DpiScaling", DpiScaling);
            ini.SetInt("UI", "TimeFormat", TimeFormat);
            ini.SetInt("UI", "FollowMode", FollowMode);
            ini.SetInt("UI", "FollowSync", FollowSync);
            ini.SetBool("UI", "ShowNoteLabels", ShowNoteLabels);
            ini.SetBool("UI", "ShowScrollBars", ShowScrollBars);
            ini.SetBool("UI", "ShowOscilloscope", ShowOscilloscope);
            ini.SetBool("UI", "ForceCompactSequencer", ForceCompactSequencer);
            ini.SetBool("UI", "ShowPianoRollViewRange", ShowPianoRollViewRange);
            ini.SetInt("UI", "TrackPadMoveSensitity", TrackPadMoveSensitity);
            ini.SetInt("UI", "TrackPadZoomSensitity", TrackPadZoomSensitity);
            ini.SetBool("UI", "ReverseTrackPad", ReverseTrackPad);
            ini.SetBool("UI", "ShowImplicitStopNotes", ShowImplicitStopNotes);

            // Audio
            ini.SetInt("Audio", "NumBufferedFrames", NumBufferedAudioFrames);
            ini.SetInt("Audio", "InstrumentStopTime", InstrumentStopTime);
            ini.SetBool("Audio", "SquareSmoothVibrato", SquareSmoothVibrato);
            ini.SetBool("Audio", "NoDragSoungWhenPlaying", NoDragSoungWhenPlaying);

            // Mixer
            for (int i = 0; i < ExpansionType.Count; i++)
            {
                var section = "Mixer" + ExpansionType.ShortNames[i];
                ini.SetFloat(section, "Volume", ExpansionMixerSettings[i].volume);
                ini.SetFloat(section, "Treble", ExpansionMixerSettings[i].treble);
            }

            // MIDI
            ini.SetString("MIDI", "Device", MidiDevice);

            // Folders
            ini.SetString("Folders", "LastFileFolder", LastFileFolder);
            ini.SetString("Folders", "LastInstrumentFolder", LastInstrumentFolder);
            ini.SetString("Folders", "LastSampleFolder", LastSampleFolder);
            ini.SetString("Folders", "LastExportFolder", LastExportFolder);

            // FFmpeg
            ini.SetString("FFmpeg", "ExecutablePath", FFmpegExecutablePath);

            // QWERTY
            // Stop note.
            {
                if (QwertyKeys[0, 0] >= 0)
                {
                    ini.SetInt("QWERTY", "StopNote", QwertyKeys[0, 0]);
                }
                if (QwertyKeys[0, 1] >= 0)
                {
                    ini.SetInt("QWERTY", "StopNoteAlt", QwertyKeys[0, 1]);
                }
            }

            // Regular notes.
            for (int idx = 1; idx < QwertyKeys.GetLength(0); idx++)
            {
                var octave = (idx - 1) / 12;
                var note   = (idx - 1) % 12;

                var keyName0 = $"Octave{octave}Note{note}";
                var keyName1 = $"Octave{octave}Note{note}Alt";

                if (QwertyKeys[idx, 0] >= 0)
                {
                    ini.SetInt("QWERTY", keyName0, QwertyKeys[idx, 0]);
                }
                if (QwertyKeys[idx, 1] >= 0)
                {
                    ini.SetInt("QWERTY", keyName1, QwertyKeys[idx, 1]);
                }
            }

            Directory.CreateDirectory(GetConfigFilePath());

            ini.Save(GetConfigFileName());
        }