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


C# Database.DatabaseTrackInfo类代码示例

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


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

示例1: AssertTitleSort

 protected void AssertTitleSort(string title, string title_sort, byte[] expected)
 {
     DatabaseTrackInfo info = new DatabaseTrackInfo ();
     info.TrackTitle = title;
     info.TrackTitleSort = title_sort;
     Assert.AreEqual (expected, info.TrackTitleSortKey);
 }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:7,代码来源:DatabaseTrackInfoTests.cs

示例2: DefaultTrackPrimarySourceChooser

 protected static PrimarySource DefaultTrackPrimarySourceChooser (DatabaseTrackInfo track)
 {
     if ((track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0) {
         return ServiceManager.SourceManager.VideoLibrary;
     } else {
         return ServiceManager.SourceManager.MusicLibrary;
     }
 }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:8,代码来源:LibraryImportManager.cs

示例3: CopyTrackTo

 public override void CopyTrackTo (DatabaseTrackInfo track, SafeUri uri, BatchUserJob job)
 {
     if (track.PrimarySource == this && track.Uri.Scheme.StartsWith ("http")) {
         foreach (double percent in database.DownloadTrack ((int)track.ExternalId, track.MimeType, uri.AbsolutePath)) {
             job.DetailedProgress = percent;
         }
     }
 }
开发者ID:gclark916,项目名称:banshee,代码行数:8,代码来源:DaapSource.cs

示例4: Bookmark

        public Bookmark(DatabaseTrackInfo track, int position_ms, string type)
        {
            Track = track;
            Position = TimeSpan.FromMilliseconds (position_ms);
            CreatedAt = DateTime.Now;
            Type = type;

            Save ();
        }
开发者ID:kelsieflynn,项目名称:banshee,代码行数:9,代码来源:Bookmark.cs

示例5: DownloadLyrics

        private void DownloadLyrics(DatabaseTrackInfo track)
        {
            string lyrics = null;
            try {
                lyrics = LyricsManager.Instance.DownloadLyrics (track);
            } catch (Exception e) {
                Log.Warning (e);
                return;
            }

            LyricsManager.Instance.SaveLyrics (track, lyrics, true);
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:12,代码来源:LyricsDownloadJob.cs

示例6: PodcastPropertiesDialog

        public PodcastPropertiesDialog (DatabaseTrackInfo track)
        {
            PodcastTrackInfo pi = PodcastTrackInfo.From (track);
            if (pi == null)
            {
                throw new ArgumentNullException ("pi");
            }

            this.pi = pi;

            Title = track.TrackTitle;
            BuildWindow ();
            //IconThemeUtils.SetWindowIcon (this);
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:14,代码来源:PodcastPropertiesDialog.cs

示例7: ContactTrackInfo

        public ContactTrackInfo(DatabaseTrackInfo track, ContactSource source)
            : this()
        {
            if (track == null) {
                throw new ArgumentNullException ("track");
            }
            else if (source == null) {
                throw new ArgumentNullException ("source");
            }

            this.TrackId = track.TrackId;
            this.ExternalId = track.ExternalId;
            this.AlbumTitle = track.AlbumTitle;
            this.ArtistName = track.ArtistName;
            this.TrackNumber = track.TrackNumber;
            this.TrackTitle = track.TrackTitle;
            this.Uri = track.Uri;

            PrimarySource = source;
        }
开发者ID:nloko,项目名称:banshee-telepathy-extension,代码行数:20,代码来源:ContactTrackInfo.cs

示例8: DeleteTrack

        protected override bool DeleteTrack (DatabaseTrackInfo track)
        {
            lock (mtp_device) {
                Track mtp_track = track_map [track.TrackId];
                track_map.Remove (track.TrackId);

                // Remove from device
                mtp_device.Remove (mtp_track);

                // Remove track from album, and remove album from device if it no longer has tracks
                string key = MakeAlbumKey (track.ArtistName, track.AlbumTitle);
                if (album_cache.ContainsKey (key)) {
                    Album album = album_cache[key];
                    album.RemoveTrack (mtp_track);
                    if (album.Count == 0) {
                        album.Remove ();
                        album_cache.Remove (key);
                    }
                }

                return true;
            }
        }
开发者ID:fatman2021,项目名称:gnome-apps,代码行数:23,代码来源:MtpSource.cs

示例9: CopyTrackTo

 public override void CopyTrackTo (DatabaseTrackInfo track, SafeUri uri, BatchUserJob job)
 {
     if (track_map.ContainsKey (track.TrackId)) {
         track_map[track.TrackId].Download (uri.LocalPath, delegate (ulong current, ulong total, IntPtr data) {
             job.DetailedProgress = (double) current / total;
             return 0;
         });
     } else {
         throw new Exception ("Error copying track from MTP device");
     }
 }
开发者ID:fatman2021,项目名称:gnome-apps,代码行数:11,代码来源:MtpSource.cs

示例10: RenameFile

        private bool RenameFile (DatabaseTrackInfo track)
        {
            SafeUri old_uri = track.Uri;
            bool in_library = old_uri.AbsolutePath.StartsWith (musicLibrarySource.BaseDirectoryWithSeparator);

            if (!in_library) {
                return false;
            }

            string new_filename = track.PathPattern.BuildFull (musicLibrarySource.BaseDirectory, track, System.IO.Path.GetExtension (old_uri.ToString ()));
            SafeUri new_uri = new SafeUri (new_filename);

            if (!new_uri.Equals (old_uri) && !Banshee.IO.File.Exists (new_uri)) {
                Banshee.IO.File.Move (old_uri, new_uri);
                Banshee.IO.Utilities.TrimEmptyDirectories (old_uri);
                track.Uri = new_uri;
                return true;
            }

            return false;
        }
开发者ID:petejohanson,项目名称:banshee,代码行数:21,代码来源:SaveTrackMetadataJob.cs

示例11: EditStation

 private void EditStation (DatabaseTrackInfo track)
 {
     StationEditor editor = new StationEditor (track);
     editor.Response += OnStationEditorResponse;
     editor.Show ();
 }
开发者ID:gclark916,项目名称:banshee,代码行数:6,代码来源:InternetRadioSource.cs

示例12: DeleteTrack

        protected virtual bool DeleteTrack (DatabaseTrackInfo track)
        {
            if (!track.Uri.IsLocalPath)
                throw new Exception ("Cannot delete a non-local resource: " + track.Uri.Scheme);

            try {
                Banshee.IO.Utilities.DeleteFileTrimmingParentDirectories (track.Uri);
            } catch (System.IO.FileNotFoundException) {
            } catch (System.IO.DirectoryNotFoundException) {
            }

            return true;
        }
开发者ID:mono-soc-2011,项目名称:banshee,代码行数:13,代码来源:PrimarySource.cs

示例13: UpdateMetadata

 public virtual void UpdateMetadata (DatabaseTrackInfo track)
 {
 }
开发者ID:mono-soc-2011,项目名称:banshee,代码行数:3,代码来源:PrimarySource.cs

示例14: AddTrack

 protected override void AddTrack(DatabaseTrackInfo track)
 {
     AddTrack (track.TrackId);
 }
开发者ID:dufoli,项目名称:banshee,代码行数:4,代码来源:PlaylistSource.cs

示例15: DeleteTrackHook

        public override bool DeleteTrackHook (DatabaseTrackInfo track)
        {
            // Do not allow removing purchased tracks if not in the
            // Amazon Purchased Music source; this should prevent
            // accidental deletion of purchased music that may not
            // have been copied from the device yet.
            //
            // TODO: Provide some feedback when a purchased track is
            // skipped from deletion
            //
            // FIXME: unfortunately this does not work due to
            // the cache models being potentially different
            // even though they will always reference the same tracks
            // amazon_source.TrackModel.IndexOf (track) >= 0
            if (!amazon_source.Active && amazon_source.Count > 0 && track.Uri.LocalPath.StartsWith (amazon_base_dir)) {
                return false;
            }

            return true;
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:20,代码来源:WebOSDevice.cs


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