예제 #1
0
 public MIDITrackParser(BufferByteReader reader, int ppq, int track, MIDILoaderSettings settings)
 {
     this.settings   = settings;
     this.reader     = reader;
     this.ppq        = ppq;
     this.track      = track;
     tempoMultiplier = ((double)500000 / ppq) / 1000000;
 }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Window_SourceInitialized(this, null);
            Focus();
            Topmost = true;
            Topmost = false;
            BringIntoView();
            Activate();
            Keyboard.Focus(this);

            audioThreads.Maximum = Environment.ProcessorCount;

            loaderSettings = settings.GetMIDILoaderSettings();
            var ls = loaderSettings.Clone();

            audioThresh.Value        = ls.EventVelocityThreshold;
            visibleThresh.Value      = ls.NoteVelocityThreshold;
            audioThreads.Value       = ls.EventPlayerThreads;
            removeOverlaps.IsChecked = loaderSettings.RemoveOverlaps;
        }
예제 #3
0
 public MIDIFile(string path, MIDILoaderSettings settings, CancellationToken cancel)
 {
     loaderSettings = settings;
     this.cancel    = cancel;
     filepath       = path;
 }
예제 #4
0
 public MIDIMemoryFile(string path, MIDILoaderSettings settings, CancellationToken cancel)
     : base(path, settings, cancel)
 {
 }
예제 #5
0
        public Settings()
        {
            if (!Directory.Exists(SettingsFolderPath))
            {
                Directory.CreateDirectory(SettingsFolderPath);
            }

            versionPath = Path.Combine(SettingsFolderPath, "meta.kvs");
            midiPath    = Path.Combine(SettingsFolderPath, "midi.kvs");
            generalPath = Path.Combine(SettingsFolderPath, "general.kvs");

            loadingSettings loading = new loadingSettings();

            bool saveSettings = false;

            if (File.Exists(versionPath))
            {
                loading.version = LoadSetings <versionSettings>(versionPath);
            }
            else
            {
                loading.version = new versionSettings()
                {
                    version = VersionName, enableUpdates = EnableUpdates, installed = Installed
                };
            }
            if (File.Exists(midiPath))
            {
                loading.midi = LoadSetings <MIDILoaderSettings>(midiPath);
            }
            else
            {
                loading.midi = new MIDILoaderSettings();
                saveSettings = true;
            }
            if (File.Exists(generalPath))
            {
                loading.general = LoadSetings <GeneralSettings>(generalPath);
            }
            else
            {
                loading.general = new GeneralSettings();
                saveSettings    = true;
            }

            VersionName   = (string)loading.version.version;
            EnableUpdates = (bool)loading.version.enableUpdates;
            Installed     = (bool)loading.version.installed;

            if (saveSettings)
            {
                SaveSetings(loading.midi, midiPath);
                SaveSetings(loading.general, generalPath);
            }

            loaderSettings = (MIDILoaderSettings)loading.midi;

            General = loading.general;

            PaletteSettings.Reload();
            if (!PaletteSettings.Palettes.ContainsKey(General.PaletteName))
            {
                General.PaletteName = PaletteSettings.Palettes.Keys.First();
            }

            General.PropertyChanged += (s, e) =>
            {
                SaveSetings(General, generalPath);
            };
        }
예제 #6
0
 public void UpdateMIDILoaderSettings(MIDILoaderSettings s)
 {
     SaveSetings(s, midiPath);
 }