4 Copyright © 2009, 2016 the VideoLAN team
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 -- Parser script from Rockbox FM radio presets
22 -- See http://www.rockbox.org/wiki/FmPresets
24 local MRL_base
= "v4l2c:///dev/radio0:tuner-frequency="
27 if not string.match( vlc
.path
, "%.[fF][mM][rR]$" ) then return false end
28 local line
= vlc
.peek(256)
29 local freq
= tonumber(string.match( line
, "^[^%d]?[^%d]?[^%d]?[^%d]?(%d+):" )) -- handle BOM
30 return freq
and freq
> 80000000 and freq
< 110000000
36 local line
= vlc
.readline()
37 if not line
then break end
38 local freq
, name
= string.match( line
, "(%d+):(.*)" )
40 table.insert( p
, { path
= MRL_base
..freq
, name
= name
} )