示例#1
0
文件: main.py 项目: nafur/flmpc
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
文件: main.py 项目: nafur/flmpc
def ajax_pl_addStream():
	pympc.genericSingle("add", [request.form["stream"]])
	return ""
示例#3
0
文件: main.py 项目: nafur/flmpc
def ajax_pl_delete(track):
	pympc.genericSingle("delete", [track])
示例#4
0
文件: main.py 项目: nafur/flmpc
def ajax_toggle(flag):
	val = 1 - int(pympc.lastStatus["status"][flag])
	pympc.genericSingle(flag, [val])
示例#5
0
文件: main.py 项目: nafur/flmpc
def ajax_stats():
	res = pympc.genericSingle("stats")[1]
	res["load"] = repr(os.getloadavg())
	return res
示例#6
0
文件: main.py 项目: nafur/flmpc
def ajax_play(track):
	pympc.genericSingle("play", [track])
示例#7
0
文件: main.py 项目: nafur/flmpc
def ajax_stop():
	pympc.genericSingle("stop")
示例#8
0
文件: main.py 项目: nafur/flmpc
def ajax_prev():
	pympc.genericSingle("previous")
示例#9
0
文件: main.py 项目: nafur/flmpc
def ajax_pause(pause):
	pympc.genericSingle("pause", [pause])
示例#10
0
文件: main.py 项目: nafur/flmpc
def ajax_next():
	pympc.genericSingle("next")
示例#11
0
文件: main.py 项目: nafur/flmpc
def ajax_pl_replace(name):
	pympc.genericSingle("clear")
	pympc.genericSingle("load", [name])
	return ""
示例#12
0
文件: main.py 项目: nafur/flmpc
def ajax_pl_load(name):
	pympc.genericSingle("load", [name])
	return ""
示例#13
0
文件: main.py 项目: nafur/flmpc
def ajax_pl_add(uri):
	pympc.genericSingle("add", [uri])
	return ""
示例#14
0
文件: main.py 项目: nafur/flmpc
def ajax_pl_save():
	pympc.genericSingle("save", [request.form["name"]])
	return ""