Index: channels/file.py ================================================================== --- channels/file.py +++ channels/file.py @@ -2,13 +2,16 @@ # api: streamtuner2 # title: File browser # description: Displays mp3/oggs or m3u/pls files from local media file directories. # type: channel # category: media -# version: 0.0 +# version: 0.1 # priority: optional # depends: mutagen +# config: +# {name:"file_browser_dir", "type":"text", "value": "~/Music, /media/music", "description":"list of directories to scan for audio files"}, +# {name:"file_browser_ext", "type":"text", "value":"mp3,ogg, m3u,pls,xspf, avi,flv,mpg,mp4", "description":"file type filter"}, # # # Local file browser. # # @@ -18,22 +21,22 @@ # modules import os import re from channels import * -from config import conf +from config import * # ID3 libraries try: from mutagen import File as get_meta except: try: - print("just basic ID3 support") from ID3 import ID3 + __print__(dbg.INFO, "Just basic ID3 support") get_meta = lambda fn: dict([(k.lower(),v) for k,v in ID3(fn).iteritems()]) except: - print("you are out of luck in regards to mp3 browsing") + __print__(dbg.INIT, "You are out of luck in regards to mp3 browsing. No ID3 support.") get_meta = lambda *x: {} # work around mutagens difficult interface def mutagen_postprocess(d): @@ -54,32 +57,25 @@ # file browser / mp3 directory listings class file (ChannelPlugin): # info - api = "streamtuner2" module = "file" title = "file browser" - version = -0.5 listtype = "url/file" - # data - config = [ - {"name":"file_browser_dir", "type":"text", "value":os.environ["HOME"]+"/Music, /media/music", "description":"list of directories to scan for audio files"}, - {"name":"file_browser_ext", "type":"text", "value":"mp3,ogg, m3u,pls,xspf, avi,flv,mpg,mp4", "description":"file type filter"}, - ] streams = {} categories = [] dir = [] ext = [] # display datamap = [ # coltitle width [ datasrc key, type, renderer, attrs ] [cellrenderer2], ... ["", 20, ["state", str, "pixbuf", {}], ], ["Genre", 65, ['genre', str, "t", {"editable":8}], ], - ["File", 160, ["filename", str, "t", {"strikethrough":11, "cell-background":12, "cell-background-set":13}], ], + ["File", 160, ["filename", str, "t", {"strikethrough":10, "cell-background":11, "cell-background-set":12}], ], ["Title", 205, ["title", str, "t", {"editable":8}], ], ["Artist", 125, ["artist", str, "t", {"editable":8}], ], ["Album", 125, ["album", str, "t", {"editable":8}], ], ["Bitrate", 35, ["bitrate", int, "t", {}], ], ["Format", 50, ["format", str, None, {}], ], Index: channels/global_key.py ================================================================== --- channels/global_key.py +++ channels/global_key.py @@ -27,10 +27,11 @@ # register a key class global_key(object): module = "global_key" title = "keyboard shortcut" + meta = plugin_meta() config = [ dict(name="switch_key", type="text", value="XF86Forward", description="global key for switching radio"), dict(name="switch_channel", type="text", value="bookmarks:favourite", description="station list to alternate in"), dict(name="switch_random", type="boolean", value=0, description="pick random channel, instead of next"), Index: channels/history.py ================================================================== --- channels/history.py +++ channels/history.py @@ -4,48 +4,41 @@ # description: List recently played stations under favourites > history. # version: 1.0 # type: category # category: ui # priority: optional +# config: { name: history, type: int, value: 20, description: Number of last played streams to keep in history list., category: limit } +# # # Lists last activated streams in a new [history] tab in the favourites # channel. # # # -from config import conf, __print__, dbg +from config import * from channels import * class history: # plugin info module = "history" title = "History" - - - # configuration settings - config = [ - { - "name": "history", - "type": "int", - "value": "20", - "description": "Number of last played streams to keep in history list.", - "category": "limit" - } - ] + meta = plugin_meta() + # store bm = None # hook up to main tab def __init__(self, parent): + self.config = self.meta["config"] # keep reference to main window self.bm = parent.channels["bookmarks"] # create category Index: channels/jamendo.py ================================================================== --- channels/jamendo.py +++ channels/jamendo.py @@ -5,10 +5,13 @@ # type: channel # version: 2.2 # category: radio # depends: json # priority: default +# config: +# { name: "jamendo_stream_format", type: "select", value: "ogg", select: "ogg=Ogg Vorbis|mp32=MP3, 192vbr|mp31=MP3, 96kbps|flac=Xiph FLAC", description: "Default streaming audio format. Albums and playlists still return Vorbis mostly for best quality." } +# # # Now utilizes the Jamendo /v3.0/ API. # # Radio station lists are fixed for now. Querying the API twice per station # doesn't seem overly sensible. Index: channels/links.py ================================================================== --- channels/links.py +++ channels/links.py @@ -12,10 +12,11 @@ # and some others are listed with homepage links. # # +from config import * from channels import * import copy @@ -24,10 +25,11 @@ # plugin info module = "links" title = "Links" version = 0.1 + meta = plugin_meta() # configuration settings config = [ ] Index: channels/surfmusik.py ================================================================== --- channels/surfmusik.py +++ channels/surfmusik.py @@ -12,11 +12,11 @@ # This plugin comes in German (SurfMusik) and English (SurfMusic) variations. # It provides a vast collection of international stations and genres. # While it's not an open source project, most entries are user contributed. # # They do have a Windows client, hencewhy it's even more important for -# streamtuner2 to support it on other plattforms. +# streamtuner2 to support it on other platforms. # # TV stations don't seem to work mostly. And loading the webtv/ pages would # be somewhat slow (for querying the actual mms:// streams). # # Index: channels/timer.py ================================================================== --- channels/timer.py +++ channels/timer.py @@ -18,11 +18,11 @@ # are stored in the description field, and can thus be edited. However, after editing # times manually, streamtuner2 must be restarted for the changes to take effect. # -from config import __print__, dbg +from config import * from channels import * import kronos from mygtk import mygtk from action import action import copy @@ -34,10 +34,11 @@ class timer: # plugin info module = "timer" title = "Timer" + meta = plugin_meta() # configuration settings config = [ ] Index: channels/xiph.py ================================================================== --- channels/xiph.py +++ channels/xiph.py @@ -1,21 +1,29 @@ -# +# encoding: UTF-8 # api: streamtuner2 # title: Xiph.org # description: ICEcast radio directory. Now utilizes a cached JSON API. # type: channel # category: radio # version: 0.3 # priority: standard # -# # Xiph.org maintains the Ogg streaming standard and Vorbis audio compression # format, amongst others. The ICEcast server is an alternative to SHOUTcast. # # It meanwhile provides a JSOL dump, which is faster to download and process. # So we'll use that over the older yp.xml. (Sadly it also doesn't output # homepage URLs, listeners, etc.) +# +# Xiphs JSON is a horrible mysqldump concatenation, not parseable. Thus it's +# refurbished on api.io for consumption. Which also provides compressed HTTP +# transfers and category slicing. +# +# Xiph won't be updating the directory for another while. The original feature +# request is now further delayed as summer of code project: +# · https://trac.xiph.org/ticket/1958 +# · https://wiki.xiph.org/Summer_of_Code_2015#Stream_directory_API # # @@ -41,11 +49,11 @@ # desc api = "streamtuner2" module = "xiph" title = "Xiph.org" homepage = "http://dir.xiph.org/" - #base_url = "http://api.dir.xiph.org/" + #xml_url = "http://dir.xiph.org/yp.xml" json_url = "http://api.include-once.org/xiph/cache.php" listformat = "url/http" config = [ {"name":"xiph_min_bitrate", "value":64, "type":"int", "description":"minimum bitrate, filter anything below", "category":"filter"} ]