コード例 #1
0
ファイル: Playlist.cs プロジェクト: eraser85/XBMCRemoteRT
 public static async void AddSong(Song song)
 {
     JObject songItem = new JObject(new JProperty("songid", song.SongId));
     await Playlist.Add(PlayelistType.Audio, songItem);
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: mrlucas84/XBMCRemoteRT
 public static async Task PlaySong(Song song)
 {
     GlobalVariables.CurrentTracker.SendEvent(EventCategories.Programmatic, EventActions.Play, EventNames.PlaySong, 0);
     JObject songToOpen = new JObject(new JProperty("songid", song.SongId));
     await Player.Open(songToOpen);
 }
コード例 #3
0
        private async void FileItemWrapper_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var file = (File)((FrameworkElement)sender).DataContext;
            if (file.FileType == "directory")
            {
                LoadDirectory(file);
            }
            else
            {
                var fileDetails = await RPCWrappers.Files.GetFileDetails(file.Path, GlobalVariables.CurrentSource.Media);

                switch (fileDetails.Type)
                {
                    case "music":
                        var song = new Song { SongId = fileDetails.Id };
                        await Player.PlaySong(song);
                        break;
                    case "movie":
                        var movie = new Movie { MovieId = fileDetails.Id };
                        Player.PlayMovie(movie);
                        break;
                    case "episode":
                        var episode = new Episode { EpisodeId = fileDetails.Id };
                        Player.PlayEpidose(episode);
                        break;
                }
            }
        }