当前位置: 首页>>代码示例>>C#>>正文


C# Collection.TrackInfo类代码示例

本文整理汇总了C#中Banshee.Collection.TrackInfo的典型用法代码示例。如果您正苦于以下问题:C# TrackInfo类的具体用法?C# TrackInfo怎么用?C# TrackInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TrackInfo类属于Banshee.Collection命名空间,在下文中一共展示了TrackInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BansheeToMtpTrack

        public void BansheeToMtpTrack()
        {
            TrackInfo track_info = new TrackInfo ();
            track_info.ArtistName = "Banshee Artist";
            track_info.AlbumTitle = "Banshee Album";
            track_info.TrackTitle = "Banshee Title";
            track_info.Year = 2003;
            track_info.Duration = TimeSpan.FromSeconds (3600 * 1.32);
            track_info.Rating = 2;
            track_info.TrackNumber = 13;

            Track track = new Track ("foo.mp3", 1000);
            MtpTrackInfo.ToMtpTrack (track_info, track);

            Assert.AreEqual ("Banshee Artist", track.Artist);
            Assert.AreEqual ("Banshee Album", track.Album);
            Assert.AreEqual ("Banshee Title", track.Title);
            Assert.AreEqual (1000 * 3600 * 1.32, track.Duration);
            Assert.AreEqual (40, track.Rating);
            Assert.AreEqual (13, track.TrackNumber);
            Assert.AreEqual (2003, track.Year);

            //track.ReleaseDate = "00000101T0000.00";
            //track_info = new MtpTrackInfo (track);
            //Assert.AreEqual (0, track_info.Year);
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:26,代码来源:MtpDapTests.cs

示例2: RadioTrackInfo

 public RadioTrackInfo(TrackInfo parentTrack)
     : this(parentTrack.Uri)
 {
     ArtistName = parentTrack.ArtistName;
     TrackTitle = parentTrack.TrackTitle;
     AlbumTitle = parentTrack.AlbumTitle;
     ParentTrack = parentTrack;
 }
开发者ID:kelsieflynn,项目名称:banshee,代码行数:8,代码来源:RadioTrackInfo.cs

示例3: IsInCache

 public bool IsInCache(TrackInfo track)
 {
     if (track == null) {
         return false;
     }
     string filename = GetLyricsFilename (track.ArtistName, track.TrackTitle);
     return  File.Exists (filename);
 }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:8,代码来源:LyricsCache.cs

示例4: TranscodeContext

 public TranscodeContext (TrackInfo track, SafeUri out_uri, ProfileConfiguration config,
     TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler)
 {
     Track = track;
     OutUri = out_uri;
     Config = config;
     Handler = handler;
     CancelledHandler = cancelledHandler;
     ErrorHandler = errorHandler;
 }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:10,代码来源:TranscoderService.cs

示例5: AppleDeviceTrackInfo

        public AppleDeviceTrackInfo (TrackInfo track)
        {
            CanSaveToDatabase = true;

            if (track is AppleDeviceTrackInfo) {
                IpodTrack = ((AppleDeviceTrackInfo)track).IpodTrack;
                LoadFromIpodTrack ();
            } else {
                UpdateInfo (track);
            }
        }
开发者ID:gclark916,项目名称:banshee,代码行数:11,代码来源:AppleDeviceTrackInfo.cs

示例6: IpodTrackInfo

        public IpodTrackInfo (TrackInfo track)
        {
            CanSaveToDatabase = true;

            if (track is IpodTrackInfo) {
                this.track = ((IpodTrackInfo)track).IpodTrack;
                LoadFromIpodTrack ();
            } else {
                UpdateInfo (track);
            }
        }
开发者ID:petejohanson,项目名称:banshee,代码行数:11,代码来源:IpodTrackInfo.cs

示例7: GetIconIndex

        protected override int GetIconIndex(TrackInfo track)
        {
            ContactTrackInfo ci = ContactTrackInfo.From (track);
            if (track == null || ci == null) {
                return -1;
            }

            if (ci.IsDownloading || ci.IsDownloadPending) {
                return base.PixbufCount + 0;
            }
            else {
                return -1;
            }
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:14,代码来源:ColumnCellContactStatusIndicator.cs

示例8: ProcessEvent

 public void ProcessEvent(PlayerEventArgs args, TrackInfo track, uint pos, uint len)
 {
     switch(args.Event) {
     case PlayerEvent.StateChange:
         StateChange((PlayerEventStateChangeArgs)args, track, pos, len);
         break;
     case PlayerEvent.TrackInfoUpdated:
         UpdateTrack(track, pos, len);
         break;
     case PlayerEvent.Iterate:
         UpdatePosition(pos, len);
         break;
     }
 }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:14,代码来源:LCDParser.cs

示例9: UpdateInfo

        public void UpdateInfo (TrackInfo track)
        {
            if (track is AppleDeviceTrackInfo) {
                throw new ArgumentException ("Shouldn't update an AppleDeviceTrackInfo from an AppleDeviceTrackInfo");
            }

            IsCompilation = track.IsCompilation ;
            AlbumArtist = track.AlbumArtist;
            AlbumTitle = track.AlbumTitle;
            ArtistName = track.ArtistName;
            BitRate = track.BitRate;
            SampleRate = track.SampleRate;
            Bpm = track.Bpm;
            Comment = track.Comment;
            Composer = track.Composer;
            Conductor = track.Conductor;
            Copyright = track.Copyright;
            DateAdded = track.DateAdded;
            DiscCount = track.DiscCount;
            DiscNumber = track.DiscNumber;
            Duration = track.Duration;
            FileSize = track.FileSize;
            Genre = track.Genre;
            Grouping = track.Grouping;
            LastPlayed = track.LastPlayed;
            LastSkipped = track.LastSkipped;
            PlayCount = track.PlayCount;
            Rating = track.Rating;
            ReleaseDate = track.ReleaseDate;
            SkipCount = track.SkipCount;
            TrackCount = track.TrackCount;
            TrackNumber = track.TrackNumber;
            TrackTitle = track.TrackTitle;
            Year = track.Year;
            MediaAttributes = track.MediaAttributes;

            ArtistNameSort = track.ArtistNameSort;
            AlbumTitleSort = track.AlbumTitleSort;
            AlbumArtistSort = track.AlbumArtistSort;
            TrackTitleSort = track.TrackTitleSort;

            var podcast_info = track.ExternalObject as IPodcastInfo;
            if (podcast_info != null) {
                description = podcast_info.Description;
                ReleaseDate = podcast_info.ReleaseDate;
            }

            mimetype = track.MimeType;
        }
开发者ID:gclark916,项目名称:banshee,代码行数:49,代码来源:AppleDeviceTrackInfo.cs

示例10: GetIconIndex

        protected override int GetIconIndex (TrackInfo track)
        {
            PodcastTrackInfo podcast = PodcastTrackInfo.From (track);
            if (track == null) {
                return -1;
            }

            switch (podcast.Activity) {
                case PodcastItemActivity.Downloading:
                case PodcastItemActivity.DownloadPending:
                    return base.PixbufCount + 0;
                default:
                    return podcast.IsDownloaded ? base.PixbufCount + 1 : -1;
            }
        }
开发者ID:allquixotic,项目名称:banshee-gst-sharp-work,代码行数:15,代码来源:ColumnCellPodcastStatusIndicator.cs

示例11: Metadata

        public Metadata(TrackInfo track)
        {
            data_store = new Dictionary<string, object> ();

            if (track == null) {
                // Managed dbus doesn't like null or empty dictionaries
                data_store["mpris:trackid"] = String.Concat (object_path, "Empty");
                return;
            }

            // The trackid must be formatted like a dbus object path
            data_store["mpris:trackid"] = new DBus.ObjectPath (String.Concat (object_path, track.CacheModelId, track.CacheEntryId));
            SetInfo ("mpris:length", (long)track.Duration.TotalMilliseconds * 1000);
            SetInfo ("xesam:url", track.Uri.ToString ());
            SetInfo ("xesam:title", track.TrackTitle);
            SetInfo ("xesam:album", track.AlbumTitle);
            if (!String.IsNullOrEmpty (track.ArtistName)) {
                SetInfo ("xesam:artist", new string [] {track.ArtistName});
            }
            if (!String.IsNullOrEmpty (track.AlbumArtist)) {
                SetInfo ("xesam:albumArtist", new string [] {track.AlbumArtist});
            }
            if (!String.IsNullOrEmpty (track.Genre)) {
                SetInfo ("xesam:genre", new string [] {track.Genre});
            }
            if (!String.IsNullOrEmpty (track.Comment)) {
                SetInfo ("xesam:comment", new string [] {track.Comment});
            }

            if (track.TrackNumber > 0) {
                data_store["xesam:trackNumber"] = track.TrackNumber;
            }

            if (track.ReleaseDate.Ticks > 0) {
                SetInfo ("xesam:contentCreated", track.ReleaseDate.ToString ("s"));
            }

            if (track.Rating > 0) {
                // Scale is 0.0 to 1.0
                SetInfo ("xesam:userRating", (double)track.Rating / 5);
            }

            string artid = track.ArtworkId;
            if (artid != null) {
                SetInfo ("mpris:artUrl", String.Concat ("file://", CoverArtSpec.GetPath (artid)));
            }
        }
开发者ID:knocte,项目名称:banshee,代码行数:47,代码来源:Metadata.cs

示例12: AppleDeviceTrackInfo

        public AppleDeviceTrackInfo (TrackInfo track)
        {
            if (track is AppleDeviceTrackInfo) {
                IpodTrack = ((AppleDeviceTrackInfo)track).IpodTrack;
                LoadFromIpodTrack ();
            } else {
                IsCompilation = track.IsCompilation ;
                AlbumArtist = track.AlbumArtist;
                AlbumTitle = track.AlbumTitle;
                ArtistName = track.ArtistName;
                BitRate = track.BitRate;
                SampleRate = track.SampleRate;
                Bpm = track.Bpm;
                Comment = track.Comment;
                Composer = track.Composer;
                Conductor = track.Conductor;
                Copyright = track.Copyright;
                DateAdded = track.DateAdded;
                DiscCount = track.DiscCount;
                DiscNumber = track.DiscNumber;
                Duration = track.Duration;
                FileSize = track.FileSize;
                Genre = track.Genre;
                Grouping = track.Grouping;
                LastPlayed = track.LastPlayed;
                LastSkipped = track.LastSkipped;
                PlayCount = track.PlayCount;
                Rating = track.Rating;
                ReleaseDate = track.ReleaseDate;
                SkipCount = track.SkipCount;
                TrackCount = track.TrackCount;
                TrackNumber = track.TrackNumber;
                TrackTitle = track.TrackTitle;
                Year = track.Year;
                MediaAttributes = track.MediaAttributes;

                var podcast_info = track.ExternalObject as IPodcastInfo;
                if (podcast_info != null) {
                    //description = podcast_info.Description;
                    ReleaseDate = podcast_info.ReleaseDate;
                }
            }

            CanSaveToDatabase = true;
        }
开发者ID:directhex,项目名称:banshee-hacks,代码行数:45,代码来源:AppleDeviceTrackInfo.cs

示例13: GetIconIndex

        protected override int GetIconIndex (TrackInfo track)
        {
            int i = -1;
            PodcastTrackInfo podcast = PodcastTrackInfo.From (track);
            if (track != null) {
                switch (podcast.Activity) {
                    case PodcastItemActivity.Downloading:
                    case PodcastItemActivity.DownloadPending:
                        i = base.PixbufCount + 0;
                        break;
                    default:
                        i = podcast.IsDownloaded ? base.PixbufCount + 1 : -1;
                        break;
                }
            }

            return i;
        }
开发者ID:petejohanson,项目名称:banshee,代码行数:18,代码来源:ColumnCellPodcastStatusIndicator.cs

示例14: QueuedTrack

            public QueuedTrack (TrackInfo track, DateTime start_time)
            {
                this.artist = track.ArtistName;
                this.album = track.AlbumTitle;
                this.title = track.TrackTitle;
                this.track_number = (int) track.TrackNumber;
                this.duration = (int) track.Duration.TotalSeconds;
                // Idealy would use Hyena's DateTimeUtil, but it is broken since the "unix epoch" it uses is
                // not UTC, so depending on whether jan 1 1970 was in day-light savings and whether the user's
                // current timezone is in DLS, we'll be an hour off.
                this.start_time = (long) (start_time.ToUniversalTime () - epoch).TotalSeconds;
                // TODO
                //this.musicbrainzid = track.MusicBrainzId;

                this.musicbrainzid = "";

                // set trackauth value, otherwise empty string is default
                if (track is ILastfmInfo) {
                    this.track_auth = (track as ILastfmInfo).TrackAuth;
                }
            }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:21,代码来源:Queue.cs

示例15: Merge

        public void Merge (TrackInfo track)
        {
            AddTag (CommonTags.Artist, track.ArtistName);
            AddTag (CommonTags.Album, track.AlbumTitle);
            AddTag (CommonTags.Title, track.TrackTitle);
            AddTag (CommonTags.Genre, track.Genre);

            AddTag (CommonTags.TrackNumber, (uint)track.TrackNumber);
            AddTag (CommonTags.TrackCount, (uint)track.TrackCount);
            AddTag (CommonTags.AlbumDiscNumber, (uint)track.DiscNumber);
            AddTag (CommonTags.AlbumDiscCount, (uint)track.DiscCount);

            AddYear (track.Year);
            AddDate (track.ReleaseDate);

            AddTag (CommonTags.Composer, track.Composer);
            AddTag (CommonTags.Copyright, track.Copyright);
            AddTag (CommonTags.Comment, track.Comment);

            AddTag (CommonTags.MusicBrainzTrackId, track.MusicBrainzId);
            AddTag (CommonTags.MusicBrainzArtistId, track.ArtistMusicBrainzId);
            AddTag (CommonTags.MusicBrainzAlbumId, track.AlbumMusicBrainzId);

        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:24,代码来源:TagList.cs


注:本文中的Banshee.Collection.TrackInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。