Inheritance: Banshee.Library.LibrarySource, IBasicPlaybackController
コード例 #1
0
ファイル: Actions.cs プロジェクト: gclark916/banshee
        public Actions (AudiobookLibrarySource library) : base ("Audiobook")
        {
            this.library = library;

            Add (
                new ActionEntry ("AudiobookBookPopup", null, null, null, null, (o, a) => ShowContextMenu ("/AudiobookBookPopup")),
                new ActionEntry ("AudiobookOpen", null, Catalog.GetString ("Open Book"), null, null, OnOpen),
                new ActionEntry ("AudiobookMerge", null, Catalog.GetString ("Merge Discs..."), null, null, OnMerge),
                new ActionEntry ("AudiobookSwitchToGrid", null, Catalog.GetString ("Go to Audiobooks"), "Escape", null, (o, a) => library.SwitchToGridView ()),
                new ActionEntry ("AudiobookEdit", Stock.Edit,
                    Catalog.GetString ("_Edit Track Information"), "E", null, OnEdit),
                new ActionEntry ("AudiobookResumeSelected", Stock.MediaPlay,
                    Catalog.GetString ("Resume"), null, Catalog.GetString ("Resume playback of this audiobook"), OnResume)
            );

            Add (new ActionEntry ("AudiobookResume", Stock.MediaPlay,
                Catalog.GetString ("Resume"), null, Catalog.GetString ("Resume playback of this audiobook"), OnResume));

            AddUiFromFile ("GlobalUI.xml");

            Register ();

            UpdateActions ();
            library.BooksModel.Selection.Changed += (o, a) => UpdateActions ();
            library.BooksModel.Selection.FocusChanged += (o, a) => UpdateActions ();

            this["AudiobookSwitchToGrid"].Visible = false;
        }
コード例 #2
0
ファイル: BookPlaylist.cs プロジェクト: haugjan/banshee-hacks
 public BookPlaylist(string name, AudiobookLibrarySource parent)
     : base(name, parent)
 {
     library = parent;
     IsTemporary = true;
     Save ();
 }
コード例 #3
0
        public Actions(AudiobookLibrarySource library) : base("Audiobook")
        {
            this.library = library;

            Add(
                new ActionEntry("AudiobookBookPopup", null, null, null, null, (o, a) => ShowContextMenu("/AudiobookBookPopup")),
                new ActionEntry("AudiobookOpen", null, Catalog.GetString("Open Book"), null, null, OnOpen),
                new ActionEntry("AudiobookMerge", null, Catalog.GetString("Merge Discs..."), null, null, OnMerge),
                new ActionEntry("AudiobookSwitchToGrid", null, Catalog.GetString("Go to Audiobooks"), "Escape", null, (o, a) => library.SwitchToGridView()),
                new ActionEntry("AudiobookEdit", Stock.Edit,
                                Catalog.GetString("_Edit Track Information"), "E", null, OnEdit),
                new ActionEntry("AudiobookResumeSelected", Stock.MediaPlay,
                                Catalog.GetString("Resume"), null, Catalog.GetString("Resume playback of this audiobook"), OnResume)
                );

            Add(new ActionEntry("AudiobookResume", Stock.MediaPlay,
                                Catalog.GetString("Resume"), null, Catalog.GetString("Resume playback of this audiobook"), OnResume));

            AddUiFromFile("GlobalUI.xml");

            Register();

            UpdateActions();
            library.BooksModel.Selection.Changed      += (o, a) => UpdateActions();
            library.BooksModel.Selection.FocusChanged += (o, a) => UpdateActions();

            this["AudiobookSwitchToGrid"].Visible = false;
        }
コード例 #4
0
ファイル: AudiobookModel.cs プロジェクト: thoja21/banshee-1
        public AudiobookModel(AudiobookLibrarySource source, DatabaseTrackListModel trackModel, BansheeDbConnection connection, string uuid) : base(source, trackModel, connection, uuid)
        {
            Selection        = new Hyena.Collections.Selection();
            HasSelectAllItem = false;

            ReloadFragmentFormat = String.Format(@"
                FROM CoreAlbums WHERE CoreAlbums.AlbumID IN (SELECT AlbumID FROM CoreTracks WHERE PrimarySourceID = {0})
                ORDER BY CoreAlbums.TitleSortKey, CoreAlbums.ArtistNameSortKey",
                                                 source.DbId);
        }
コード例 #5
0
        public AudiobookModel(AudiobookLibrarySource source, DatabaseTrackListModel trackModel, BansheeDbConnection connection, string uuid)
            : base(source, trackModel, connection, uuid)
        {
            Selection = new Hyena.Collections.Selection ();
            HasSelectAllItem = false;

            ReloadFragmentFormat = String.Format (@"
                FROM CoreAlbums WHERE CoreAlbums.AlbumID IN (SELECT AlbumID FROM CoreTracks WHERE PrimarySourceID = {0})
                ORDER BY CoreAlbums.TitleSortKey, CoreAlbums.ArtistNameSortKey",
                source.DbId);
        }
コード例 #6
0
        public bool SetSource(ISource source)
        {
            if (library != null)
            {
                return(true);
            }

            library = source as AudiobookLibrarySource;
            if (library != null)
            {
                track_list.SetModel(library.TrackModel);
                library.Actions["AudiobookResume"].ConnectProxy(resume_button);
            }

            return(library != null);
        }
コード例 #7
0
ファイル: BookView.cs プロジェクト: thoja21/banshee-1
        public bool SetSource(ISource source)
        {
            if (library != null)
            {
                return(true);
            }

            library = source as AudiobookLibrarySource;
            if (library != null)
            {
                track_list.SetModel(library.TrackModel);
                resume_button.RelatedAction = library.Actions["AudiobookResume"];
            }

            return(library != null);
        }
コード例 #8
0
        public bool SetSource(ISource src)
        {
            if (src != null && src == library)
            {
                return(true);
            }

            library = src as AudiobookLibrarySource;
            if (library == null)
            {
                return(false);
            }

            grid.SetLibrary(library);

            // Not sure why this is needed
            library.BooksModel.Reloaded += delegate {
                grid.QueueDraw();
            };
            return(true);
        }
コード例 #9
0
        public bool SetSource (ISource source)
        {
            if (library != null)
                return true;

            library = source as AudiobookLibrarySource;
            if (library != null) {
                track_list.SetModel (library.TrackModel);
                library.Actions["AudiobookResume"].ConnectProxy (resume_button);
            }

            return library != null;
        }
コード例 #10
0
ファイル: BookPlaylist.cs プロジェクト: thoja21/banshee-1
 public BookPlaylist(string name, AudiobookLibrarySource parent) : base(name, parent)
 {
     library     = parent;
     IsTemporary = true;
     Save();
 }
コード例 #11
0
ファイル: AudiobookGrid.cs プロジェクト: thoja21/banshee-1
 public void SetLibrary(AudiobookLibrarySource library)
 {
     SetModel(library.BooksModel);
     this.library = library;
 }
コード例 #12
0
ファイル: BookView.cs プロジェクト: knocte/banshee
        public bool SetSource(ISource source)
        {
            if (library != null)
                return true;

            library = source as AudiobookLibrarySource;
            if (library != null) {
                track_list.SetModel (library.TrackModel);
                resume_button.RelatedAction = library.Actions["AudiobookResume"];
            }

            return library != null;
        }
コード例 #13
0
        public bool SetSource(ISource src)
        {
            if (src != null && src == library)
                return true;

            library = src as AudiobookLibrarySource;
            if (library == null) {
                return false;
            }

            grid.SetLibrary (library);

            // Not sure why this is needed
            library.BooksModel.Reloaded += delegate {
                grid.QueueDraw ();
            };
            return true;
        }
コード例 #14
0
 public void ResetSource()
 {
     library = null;
 }
コード例 #15
0
 public void ResetSource()
 {
     library = null;
 }