bongo-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bongo-patches] Add `bongo-play-marked' and add context menu item for en


From: Daniel Brockman
Subject: [bongo-patches] Add `bongo-play-marked' and add context menu item for enqueue-playing the marked tracks
Date: Wed, 11 Apr 2007 00:53:52 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

2007-04-11  Daniel Brockman  <address@hidden>

        Add `bongo-play-marked' and add context menu item
        for enqueue-playing the marked tracks.

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2007-04-11 00:53:44.000000000 +0200
+++ new-bongo/bongo.el  2007-04-11 00:53:44.000000000 +0200
@@ -6292,6 +6292,22 @@
          (bongo-play-line beg))
         (t (error "Not a Bongo buffer"))))
 
+(defun bongo-play-marked ()
+  "Start playing the marked tracks.
+In Bongo Library mode, enqueue and play in the nearest playlist.
+In Bongo Playlist mode, this is not implemented, so signal an error."
+  (interactive)
+  (cond ((bongo-library-buffer-p)
+         (let ((position (if (bongo-playing-p)
+                             (bongo-insert-enqueue-marked)
+                           (bongo-append-enqueue-marked))))
+           (with-bongo-playlist-buffer
+             (bongo-play-line position))))
+        ((bongo-playlist-buffer-p)
+         (error "Intra-playlist enqueuing is not yet supported"))
+        (t
+         (error "Not a Bongo buffer"))))
+
 (defun bongo-play (&optional n)
   "Start playing the marked tracks, or the region, or N objects.
 In Bongo Library mode, enqueue and play in the nearest playlist."
@@ -7732,7 +7748,7 @@
          new-faces))
 
 (defun bongo-pop-up-context-menu (event)
-  "Pop up a menu at position EVENT for the object there."
+  "Pop up a context menu at position EVENT for the object there."
   (interactive "@e")
   (let* ((line-move-ignore-invisible nil)
          (posn (event-end event))
@@ -7780,7 +7796,13 @@
                  `(["----" bongo-marking-tracks-separator]
                    ("Marked Tracks"
                     ,@(when (bongo-library-buffer-p)
-                        `([,(format "Enqueue %d Track%s"
+                        `([,(format "Enqueue and Play %d Track%s"
+                                    n-marked-tracks
+                                    (if (= n-marked-tracks 1) "" "s"))
+                           ,(if (bongo-region-active-p)
+                                'bongo-play-marked
+                              'bongo-play)]
+                          [,(format "Enqueue %d Track%s"
                                     n-marked-tracks
                                     (if (= n-marked-tracks 1) "" "s"))
                            ,(if (bongo-region-active-p)
-- 
Daniel Brockman <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]