示例#1
0
        public MainViewModel()
        {
            VersionString = _programVersion.ToString();

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.github.com/repos/ianespana/ShawzinBot/releases/latest");

            request.UserAgent = "request";
            try
            {
                using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                    using (StreamReader sr = new StreamReader(response.GetResponseStream()))
                        using (JsonReader reader = new JsonTextReader(sr))
                        {
                            JsonSerializer serializer = new JsonSerializer();
                            GitVersion     p          = serializer.Deserialize <GitVersion>(reader);
                            if (!(p.draft || p.prerelease) && p.tag_name != _programVersion.ToString())
                            {
                                VersionString = _programVersion.ToString() + " - Update available!";
                            }
                        }
            }
            catch (WebException ex)
            {
                Console.WriteLine(ex);
            }

            MidiInputs.Add(new MidiInputModel("None"));

            foreach (var device in InputDevice.GetAll())
            {
                MidiInputs.Add(new MidiInputModel(device.Name));
            }

            SelectedMidiInput = MidiInputs[0];

            MidiSpeeds.Add(new MidiSpeedModel("0.25", 0.25));
            MidiSpeeds.Add(new MidiSpeedModel("0.5", 0.5));
            MidiSpeeds.Add(new MidiSpeedModel("0.75", 0.75));
            MidiSpeeds.Add(new MidiSpeedModel("Normal", 1));
            MidiSpeeds.Add(new MidiSpeedModel("1.25", 1.25));
            MidiSpeeds.Add(new MidiSpeedModel("1.5", 1.5));
            MidiSpeeds.Add(new MidiSpeedModel("1.75", 1.75));
            MidiSpeeds.Add(new MidiSpeedModel("2", 2));

            SelectedMidiSpeed = MidiSpeeds[3];

            EnableVibrato       = Properties.Settings.Default.EnableVibrato;
            TransposeNotes      = Properties.Settings.Default.TransposeNotes;
            PlayThroughSpeakers = Properties.Settings.Default.PlayThroughSpeakers;
            PlaybackCurrentTimeWatcher.Instance.PollingInterval = TimeSpan.FromSeconds(1);
        }
示例#2
0
        public MainViewModel()
        {
            MidiInputs.Add(new MidiInputModel("None"));

            foreach (var device in InputDevice.GetAll())
            {
                MidiInputs.Add(new MidiInputModel(device.Name));
            }

            SelectedMidiInput = MidiInputs[0];

            EnableVibrato       = Properties.Settings.Default.EnableVibrato;
            TransposeNotes      = Properties.Settings.Default.TransposeNotes;
            PlayThroughSpeakers = Properties.Settings.Default.PlayThroughSpeakers;
        }
示例#3
0
        public MainViewModel()
        {
            MidiInputs.Add(new MidiInputModel("None"));

            foreach (var device in InputDevice.GetAll())
            {
                MidiInputs.Add(new MidiInputModel(device.Name));
            }

            SelectedMidiInput = MidiInputs[0];

            EnableVibrato       = Properties.Settings.Default.EnableVibrato;
            TransposeNotes      = Properties.Settings.Default.TransposeNotes;
            PlayThroughSpeakers = Properties.Settings.Default.PlayThroughSpeakers;
            PlaybackCurrentTimeWatcher.Instance.PollingInterval = TimeSpan.FromSeconds(1);
        }