diff -r b5352888e3c2 -r ba3564c925f3 gmyth-stream/server/main.py --- a/gmyth-stream/server/main.py Mon Apr 09 16:22:37 2007 +0100 +++ b/gmyth-stream/server/main.py Thu Apr 12 15:05:48 2007 +0100 @@ -71,23 +71,35 @@ nextport += 1 ret = media.setup(filename, mux, vcodec, vbitrate, fps, acodec, abitrate, width, height, nextport, options) - if ret == True: + if ret: server.sendOk() else: server.sendNotOk(ret) + return True def do_play(server): - media.play() - server.sendOk("%d" % nextport) + ret = media.play() + if ret: + server.sendOk("%d" % nextport) + else: + server.sendNotOk(ret) + return True - def do_stop(server): media.stop() server.sendOk() return True +def do_list(server, *directory): + file_list = [] + for j in directory: + list_media_files(j, file_list) + + server.sendOk() + return True + def do_quit(server): server.finish = 1 media.stop() @@ -99,6 +111,7 @@ "SETUP": do_setup, "PLAY": do_play, "STOP": do_stop, + "LIST": do_list, "QUIT": do_quit, }