155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182 | return run(("%s/help.chm" % path).replace("/", '\\'))
else:
return run("yelp %s" % path)
return browser("http://fossil.include-once.org/streamtuner2/doc/tip/help/html/index.html")
# Invokes player/recorder for stream url and format
def run_fmt_url(row={}, audioformat="audio/mpeg", source="pls", assoc={}, append=None, cmd=None, add_default=True):
# look for specific "audio/type" or "urn:service:…" resolvers
if audioformat in handler:
handler[audioformat](row, audioformat, source, assoc)
elif row.get("url", "").startswith("urn:"):
row = resolve_urn(row);
else:
# use default handler for mime type
if not cmd:
cmd = mime_app(audioformat, assoc)
# replace %u, %url or $title placeholders
cmd = interpol(cmd, source, row, add_default=add_default)
if append:
cmd = re.sub('(["\']?\s*)$', " " + append + "\\1", cmd)
run(cmd)
# Start web browser
def browser(url):
run_fmt_url({"url": url, "homepage": url}, "url/http", "srv", conf.play)
# Calls player for stream url and format
def play(row={}, audioformat="audio/mpeg", source="pls"): |
|
|
>
|
<
|
|
|
|
|
|
|
|
| 155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182 | return run(("%s/help.chm" % path).replace("/", '\\'))
else:
return run("yelp %s" % path)
return browser("http://fossil.include-once.org/streamtuner2/doc/tip/help/html/index.html")
# Invokes player/recorder for stream url and format
def run_fmt_url(row={}, audioformat="audio/mpeg", source="pls", assoc={}, append=None, cmd=None, add_default=True):
# look for specific "audio/type"
if audioformat in handler:
return handler[audioformat](row, audioformat, source, assoc)
# or "urn:service:…" resolvers (though this is usally done by genericchannel.row() already)
elif row.get("url", "").startswith("urn:"):
row = resolve_urn(row) or row
# use default handler for mime type
if not cmd:
cmd = mime_app(audioformat, assoc)
# replace %u, %url or $title placeholders
cmd = interpol(cmd, source, row, add_default=add_default)
if append:
cmd = re.sub('(["\']?\s*)$', " " + append + "\\1", cmd)
run(cmd)
# Start web browser
def browser(url):
run_fmt_url({"url": url, "homepage": url}, "url/http", "srv", conf.play)
# Calls player for stream url and format
def play(row={}, audioformat="audio/mpeg", source="pls"): |