예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
            ViewModel = new MainWinViewModel(this);
            this.SetViewModel(ViewModel);
            Player.Instance.ChangeDevice(); //init
            _prevvol         = 1.0f;
            _chapterprovider = new ChapterProvider(ChapterMenu);
            _chapterprovider.ChapterClicked += _chapterprovider_ChapterClicked;
            _SongTimer = new DispatcherTimer
            {
                Interval  = TimeSpan.FromMilliseconds(40),
                IsEnabled = false
            };
            _SongTimer.Tick += _SongTimerTick;
            _loaded          = true;

            if (Player.Instance.Is64Bit)
            {
                Title += " (x64)";
            }
            else
            {
                Title += " (x86)";
            }

            var src = Environment.GetCommandLineArgs();

            string[] pars = new string[src.Length - 1];
            Array.Copy(src, 1, pars, 0, src.Length - 1);
            DoLoadAndPlay(pars);

            if (Properties.Settings.Default.SaveVolume)
            {
                var vol = Properties.Settings.Default.LastVolume;
                if (vol > -1)
                {
                    VolSlider.Value = vol;
                }
            }

            if (Properties.Settings.Default.RegisterMultimediaKeys)
            {
                RegisterMultimedaKeys();
            }

            if (Properties.Settings.Default.TrackChangeNotification)
            {
                App.NotifyIcon = new NotificationIcon();
            }

            this.GetViewModel <MainWinViewModel>().View = this;

            FileExplorer.FilteredExtensions = App.Formats.Replace("*", "").Split(';');
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();
            _player = Player.Instance;
            _player.ChangeDevice(); //init
            _tray            = new TrayIcon();
            _prevvol         = 1.0f;
            _chapterprovider = new ChapterProvider(ChapterMenu);
            _chapterprovider.ChapterClicked += _chapterprovider_ChapterClicked;
            _timer                     = new DispatcherTimer();
            _timer.Interval            = TimeSpan.FromMilliseconds(40);
            _timer.IsEnabled           = false;
            _timer.Tick               += _timer_Tick;
            SongDat.NetworkMenu        = NetMenu;
            _loaded                    = true;
            _equalizer                 = new Equalizer();
            _equalizer.EqSliderChange += _equalizer_EqSliderChange;
            _equalizer.LoadSettings();
            BtnChapters.IsEnabled = _chapterprovider.ChaptersEnabled;

            if (_player.Is64Bit)
            {
                Title += " (x64)";
            }
            else
            {
                Title += " (x86)";
            }

            _repeatMode = RepeatMode.None;

            Dispatcher.Invoke(() =>
            {
                var src       = Environment.GetCommandLineArgs();
                string[] pars = new string[src.Length - 1];
                Array.Copy(src, 1, pars, 0, src.Length - 1);
                DoLoadAndPlay(pars);
            });

            if (Properties.Settings.Default.SaveVolume)
            {
                var vol = Properties.Settings.Default.LastVolume;
                if (vol > -1)
                {
                    VolSlider.Value = vol;
                    VolSlider_ValueChanged(this, null);
                }
            }

            if (Properties.Settings.Default.RegisterMultimediaKeys)
            {
                RegisterMultimedaKeys();
            }
        }
예제 #3
0
 private async void getChapterText(string chapterCode)
 {
     Html = await ChapterProvider.GetChapterText(chapterCode);
 }
예제 #4
0
        public async void ChangeChapter(string chapterCode)
        {
            this.chapter = await ChapterProvider.GetChapter(chapterCode);

            updateContent();
        }