Beispiel #1
0
        public void SetTimeline()
        {
            SystemMediaTransportControlsTimelineProperties timelineProperties = new SystemMediaTransportControlsTimelineProperties();
            int current = Winamp.GetCurrentTrackOutputTime(OutputTimeMode.CurrentPositionMilliseconds);
            int lenght  = Winamp.GetCurrentTrackOutputTime(OutputTimeMode.TrackLenghtMilliseconds);

            timelineProperties.StartTime   = TimeSpan.FromSeconds(0);
            timelineProperties.MinSeekTime = TimeSpan.FromSeconds(0);
            timelineProperties.Position    = TimeSpan.FromMilliseconds(current);
            timelineProperties.MaxSeekTime = TimeSpan.FromSeconds(lenght);
            timelineProperties.EndTime     = TimeSpan.FromMilliseconds(lenght);

            player.IsFastForwardEnabled = true;
            player.IsRewindEnabled      = true;

            player.UpdateTimelineProperties(timelineProperties);
        }
Beispiel #2
0
        private void Player_ButtonPressed(SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs args)
        {
            if (Winamp.Status == Status.Stopped)
            {
                Winamp.Play();
                return;
            }
            switch (args.Button)
            {
            case SystemMediaTransportControlsButton.Pause:
            case SystemMediaTransportControlsButton.Play:
                Winamp.PlayPause();
                break;

            case SystemMediaTransportControlsButton.Next:
                Winamp.NextTrack();
                break;

            case SystemMediaTransportControlsButton.Previous:
                Winamp.PreviousTrack();
                break;
            }
        }
Beispiel #3
0
 /// <summary>
 /// Internal initialisation routine
 /// </summary>
 public void Init(IntPtr hWnd)
 {
     Winamp = new Winamp(hWnd);
     Initialize();
 }