Inheritance: Banshee.Library.LibrarySource, IBasicPlaybackController
Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
 public BookPlaylist(string name, AudiobookLibrarySource parent)
     : base(name, parent)
 {
     library = parent;
     IsTemporary = true;
     Save ();
 }
        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;
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 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);
        }
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 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);
        }
        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;
        }
Exemplo n.º 10
0
 public BookPlaylist(string name, AudiobookLibrarySource parent) : base(name, parent)
 {
     library     = parent;
     IsTemporary = true;
     Save();
 }
Exemplo n.º 11
0
 public void SetLibrary(AudiobookLibrarySource library)
 {
     SetModel(library.BooksModel);
     this.library = library;
 }
Exemplo n.º 12
0
        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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 14
0
 public void ResetSource()
 {
     library = null;
 }
Exemplo n.º 15
0
 public void ResetSource()
 {
     library = null;
 }