[vlc-devel] commit: Rockbox FM radio presets parser script (Antoine Cellerier )
git version control
git at videolan.org
Fri Sep 25 22:22:45 CEST 2009
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Fri Sep 25 22:13:20 2009 +0200| [c568ac6ec05bf63aad2643348c51d2f7d54c20fa] | committer: Antoine Cellerier
Rockbox FM radio presets parser script
See http://www.rockbox.org/wiki/FmPresets
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c568ac6ec05bf63aad2643348c51d2f7d54c20fa
---
share/lua/playlist/rockbox_fm_presets.lua | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/share/lua/playlist/rockbox_fm_presets.lua b/share/lua/playlist/rockbox_fm_presets.lua
new file mode 100644
index 0000000..a780afe
--- /dev/null
+++ b/share/lua/playlist/rockbox_fm_presets.lua
@@ -0,0 +1,27 @@
+-- Parser script from Rockbox FM radio presets
+-- See http://www.rockbox.org/wiki/FmPresets
+
+function probe()
+ if not string.match( vlc.path, ".fmr$" ) then return false end
+ local line = vlc.peek(256)
+ vlc.msg.err(line)
+ local freq = tonumber(string.match( line, "(%d*):" ))
+ if not freq then return false end
+ return freq > 80000000 and freq < 110000000
+end
+
+function parse()
+ vlc.msg.err("test")
+ local p = {}
+ while true do
+ line = vlc.readline()
+ if not line then break end
+ vlc.msg.err(line)
+ for freq, name in string.gmatch( line, "(%d*):(.*)" ) do
+ vlc.msg.info(freq)
+ table.insert( p, { path = "v4l2c:///dev/radio0:tuner-frequency="..freq, name = name } )
+ end
+ end
+vlc.msg.err("test test")
+ return p
+end
More information about the vlc-devel
mailing list