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