コード例 #1
0
ファイル: PlaylistItem.cs プロジェクト: paukr/auremo
        public PlaylistItem(MPDSongResponseBlock block, DataModel dataModel)
        {
            Path = new Path(block.File);
            Position = block.Pos;
            Id = block.Id;

            if (Path.IsStream())
            {
                Artist = null;
                Album = null;
                AudioStream stream = dataModel.StreamsCollection.StreamByPath(Path);

                if (stream != null)
                {
                    Title = stream.Label;
                }
                else
                {
                    Title = block.Name ?? Path.ToString();
                }
            }
            else
            {
                Title = block.Title;
                Album = block.Album;

                if (Settings.Default.UseAlbumArtist)
                {
                    Artist = block.AlbumArtist ?? block.Artist;
                }

                Artist = block.Artist;
            }
        }
コード例 #2
0
        public PlaylistItem(MPDSongResponseBlock block, DataModel dataModel)
        {
            Path     = new Path(block.File);
            Position = block.Pos;
            Id       = block.Id;

            if (Path.IsStream())
            {
                Artist = null;
                Album  = null;
                AudioStream stream = dataModel.StreamsCollection.StreamByPath(Path);

                if (stream != null)
                {
                    Title = stream.Label;
                }
                else
                {
                    Title = block.Name ?? Path.ToString();
                }
            }
            else
            {
                Title = block.Title ?? Path.Filename;
                Album = block.Album;

                if (Settings.Default.UseAlbumArtist)
                {
                    Artist = block.AlbumArtist ?? block.Artist;
                }

                Artist = block.Artist;
            }
        }
コード例 #3
0
ファイル: PlayableFactory.cs プロジェクト: paukr/auremo
        public static Playable CreatePlayable(MPDSongResponseBlock block, DataModel dataModel = null)
        {
            Path path = new Path(block.File);

            if (path.IsStream())
            {
                return CreateAudioStream(path, null, block);
            }
            else if (dataModel == null || !path.IsLocal())
            {
                return CreateLink(path, block);
            }

            return FetchSong(path, block, dataModel.Database);
        }
コード例 #4
0
        public static Playable CreatePlayable(MPDSongResponseBlock block, DataModel dataModel = null)
        {
            Path path = new Path(block.File);

            if (path.IsStream())
            {
                return(CreateAudioStream(path, null, block));
            }
            else if (dataModel != null && path.IsLocal())
            {
                return(FetchSongOrCreateLink(path, block, dataModel.Database));
            }
            else
            {
                return(CreateLink(path, block));
            }
        }