예제 #1
0
        private void BtnSkipPrevious_Click(object sender, EventArgs e)
        {
            bool isNotKitkat = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch;

            if (isNotKitkat)
            {
                Jukebox.SkipToPrevious();
            }
            else
            {
                JukeboxKitkat.SkipToPrevious();
            }
        }
예제 #2
0
        private void BtnSkipPrevious_LongClick(object sender, View.LongClickEventArgs e)
        {
            bool isNotKitkat = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch;

            if (isNotKitkat)
            {
                Jukebox.Rewind();
            }
            else
            {
                JukeboxKitkat.Rewind();
            }
        }
예제 #3
0
 private void RetrieveMediaInformation()
 {
     //Syntactic sugar, cause a MediaMetadata and a Mediaplayback event to be fired in the Publisher class.
     //(MusicController class)
     //Or in Catcher class, if its Kitkat.
     if (Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch)
     {
         Jukebox.RetrieveMediaInformation();
     }
     else
     {
         JukeboxKitkat.RetrieveMediaInformation();
     }
 }
예제 #4
0
        private void BtnPlayPause_Click(object sender, EventArgs e)
        {
            bool isNotKitkat = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch;

            switch (playbackState)
            {
            //If the media is paused, then Play.
            case PlaybackStateCode.Paused:
                if (isNotKitkat)
                {
                    Jukebox.Play();
                }
                else
                {
                    JukeboxKitkat.Play();
                }
                break;

            //If the media is playing, then pause.
            case PlaybackStateCode.Playing:
                if (isNotKitkat)
                {
                    Jukebox.Pause();
                }
                else
                {
                    JukeboxKitkat.Pause();
                }

                break;

            default:
                if (isNotKitkat)
                {
                    Jukebox.Stop();
                }
                else
                {
                    JukeboxKitkat.Stop();
                }
                break;
            }
        }
예제 #5
0
 private void SkbSeekSongTime_StopTrackingTouch(object sender, SeekBar.StopTrackingTouchEventArgs e)
 {
     if (Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch)
     {
         //When user stop dragging then seek to the position previously saved in ProgressChangedEvent
         Jukebox.SeekTo(e.SeekBar.Progress);
         if (Build.VERSION.SdkInt > BuildVersionCodes.LollipopMr1)
         {
             skbSeekSongTime.SetProgress(e.SeekBar.Progress, true);
         }
         else
         {
             skbSeekSongTime.Progress = e.SeekBar.Progress;
         }
     }
     else
     {
         JukeboxKitkat.SeekTo(e.SeekBar.Progress);
         skbSeekSongTime.Progress = e.SeekBar.Progress;
     }
 }