Пример #1
0
def ajax_volume(cmd):
	vol = int(pympc.lastStatus["status"]["volume"])
	if cmd == "down": pympc.genericSingle("setvol", [vol - 5])
	elif cmd == "up": pympc.genericSingle("setvol", [vol + 5])
	elif cmd == "mute":
		global __mutedVolume
		__mutedVolume = vol
		pympc.genericSingle("setvol", [0])
	elif cmd == "unmute": pympc.genericSingle("setvol", [vol])
Пример #2
0
def ajax_pl_addStream():
	pympc.genericSingle("add", [request.form["stream"]])
	return ""
Пример #3
0
def ajax_pl_delete(track):
	pympc.genericSingle("delete", [track])
Пример #4
0
def ajax_toggle(flag):
	val = 1 - int(pympc.lastStatus["status"][flag])
	pympc.genericSingle(flag, [val])
Пример #5
0
def ajax_stats():
	res = pympc.genericSingle("stats")[1]
	res["load"] = repr(os.getloadavg())
	return res
Пример #6
0
def ajax_play(track):
	pympc.genericSingle("play", [track])
Пример #7
0
def ajax_stop():
	pympc.genericSingle("stop")
Пример #8
0
def ajax_prev():
	pympc.genericSingle("previous")
Пример #9
0
def ajax_pause(pause):
	pympc.genericSingle("pause", [pause])
Пример #10
0
def ajax_next():
	pympc.genericSingle("next")
Пример #11
0
def ajax_pl_replace(name):
	pympc.genericSingle("clear")
	pympc.genericSingle("load", [name])
	return ""
Пример #12
0
def ajax_pl_load(name):
	pympc.genericSingle("load", [name])
	return ""
Пример #13
0
def ajax_pl_add(uri):
	pympc.genericSingle("add", [uri])
	return ""
Пример #14
0
def ajax_pl_save():
	pympc.genericSingle("save", [request.form["name"]])
	return ""