]> gitweb.fluxo.info Git - awesompd.git/commitdiff
Playlist add\replace
authorAlexander Yakushev <yakushev.alex@gmail.com>
Thu, 4 Nov 2010 15:29:21 +0000 (17:29 +0200)
committerAlexander Yakushev <yakushev.alex@gmail.com>
Thu, 4 Nov 2010 15:31:38 +0000 (17:31 +0200)
awesompd.lua
release [deleted file]

index 174607715ef00a3976fe8e507fce9c86c1360848..6481dc9c1fe953ddf30958ded4d4684c27271908 100644 (file)
@@ -216,6 +216,14 @@ function awesompd:command_load_playlist(name)
          end
 end
 
+function awesompd:command_replace_playlist(name)
+   return function()
+            self:command("clear")
+            self:command("load " .. name)
+            self:command("play 1", self.update_track)
+         end
+end
+
 function awesompd:command_echo_prompt()
    return function()
             self:run_prompt("Sample text: ",function(s)
@@ -305,8 +313,10 @@ function awesompd:get_playlists_menu()
       local new_menu = {}
       if table.getn(self.playlists_array) > 0 then
         for i = 1, table.getn(self.playlists_array) do
-           new_menu[i] = { self.playlists_array[i], 
-                           self:command_load_playlist(self.playlists_array[i]) }
+           local submenu = {}
+           submenu[1] = { "Add to current", self:command_load_playlist(self.playlists_array[i]) }
+           submenu[2] = { "Replace current", self:command_replace_playlist(self.playlists_array[i]) }
+           new_menu[i] = { self.playlists_array[i], submenu }
         end
         table.insert(new_menu, {"", ""}) -- This is a separator
       end
diff --git a/release b/release
deleted file mode 100755 (executable)
index 6d3edbc..0000000
--- a/release
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-cp -f ~/work/projects/Lua/awesompd/awesompd.lua ~/.config/awesome/awesompd.lua
-cp -f ~/work/projects/Lua/awesompd/utf8.lua ~/.config/awesome/utf8.lua
\ No newline at end of file