]> git.sesse.net Git - vlc/commitdiff
New dumpmeta lua interface module to dump a file's meta data on stdout/stderr (I...
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 13 Feb 2010 16:48:57 +0000 (17:48 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 13 Feb 2010 16:49:41 +0000 (17:49 +0100)
share/Makefile.am
share/lua/intf/dumpmeta.lua [new file with mode: 0644]

index c55124f3a66b2062f5de77343fd8937c3c316542..e7d70d350051f4429479a694ce2b430432092a04 100644 (file)
@@ -220,6 +220,7 @@ DIST_lua= \
        lua/intf/modules/host.lua \
        lua/intf/telnet.lua \
        lua/intf/dummy.lua \
+       lua/intf/dumpmeta.lua \
        lua/modules/sandbox.lua \
        lua/modules/simplexml.lua
 
diff --git a/share/lua/intf/dumpmeta.lua b/share/lua/intf/dumpmeta.lua
new file mode 100644 (file)
index 0000000..194d446
--- /dev/null
@@ -0,0 +1,39 @@
+--[==========================================================================[
+ rc.lua: remote control module for VLC
+--[==========================================================================[
+ Copyright (C) 2007-2009 the VideoLAN team
+ $Id$
+
+ Authors: Antoine Cellerier <dionoea at videolan dot org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+--]==========================================================================]
+
+--[[ to dump meta data information in the debug output, run:
+       vlc -I lua --lua-intf dumpmeta coolmusic.mp3
+--]]
+
+local meta
+repeat
+    meta = vlc.input.metas()
+until meta
+
+vlc.msg.info("Dumping meta data")
+if meta then
+    for key, value in pairs(meta) do
+        vlc.msg.info(key..": "..value)
+    end
+end
+vlc.misc.quit()