Пример #1
0
        async private void OnBtnStopClick(object sender, EventArgs e)
        {
            if (playback.Renderer == null || !playback.Renderer.IsRendering)
            {
                return;
            }

            playback.Renderer.Stop();
            await renderTask;

            SetHighlightState(false);
            if (charts.Count == 0 || MusicList.FocusedItem == null || MusicList.FocusedItem.Index < 0)
            {
                BtnEditMeta.Enabled    = GroupUtilities.Enabled =
                    RenderMenu.Enabled = false;

                if (charts.Count == 0)
                {
                    GroupPlayback.Enabled = PlaybackMenu.Enabled = false;
                    ResetState();
                }
            }
            else
            {
                lblPlayingOffset.Text = "--:-- / --:--";
                StatusLabel.Text      = "Ready";
                OnMusicListSelectedIndexChange(sender, e);
                MusicList.Focus();
            }
        }
Пример #2
0
        public override void OnApplicationStart(HmeApplicationStartArgs e)
        {
            _musicList                   = new MusicList(27);
            _musicList.Bounds            = new System.Drawing.Rectangle(64, 40, 640 - 64 * 2, 480 - 150);
            _musicList.SelectionChanged += new EventHandler <EventArgs>(_musicList_SelectionChanged);
            e.Application.Root.Children.Add(_musicList);
            _track        = new Track();
            _track.Bounds = new System.Drawing.Rectangle(64, _musicList.Bounds.Y + _musicList.Bounds.Height, 640 - 64 * 2, 60);
            e.Application.Root.Children.Add(_track);

            _musicList.AddRange(_fileNames);
            _musicList.Focus();

            _application                       = e.Application;
            _application.KeyPress             += new EventHandler <KeyEventArgs>(application_KeyPress);
            _application.ResourceStateChanged += new EventHandler <ResourceStateChangedArgs>(application_ResourceStateChanged);
        }