[Toxine-cvs] CVS: toxine/src commands.c,1.79,1.80
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2004-07-19 17:19:30
|
Update of /cvsroot/toxine/toxine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6230 Modified Files: commands.c Log Message: @@Fix some segfaults. Remove syntaxes references of obsolete commands. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- commands.c 18 Jul 2004 20:31:40 -0000 1.79 +++ commands.c 19 Jul 2004 17:19:22 -0000 1.80 @@ -230,17 +230,13 @@ "Quit toxine.", "exit" }, - { "get", OPTIONAL_ARGS, do_get, + { "get", REQUIRE_ARGS, do_get, "Get some internal values.", "get audio volume\n" "get audio mute\n" "get audio driver\n" - "get audio capabilities\n" - "get video capabilities\n" + "get video driver\n" "get video fullscreen\n" - "get video property <property> (see xine_get_video_property)\n" - "get video property_min_max <property> (see xine_get_video_property_min_max)\n" - "get video help" }, { "gettime", NO_ARGS, do_gettime, "Display current time.", @@ -361,15 +357,13 @@ "send XINE_EVENT_INPUT_SELECT event to xine engine", "select" }, - { "set", OPTIONAL_ARGS, do_set, + { "set", REQUIRE_ARGS, do_set, "Set some internal values.", "set video driver <name>\n" "set video fullscreen\n" - "set video property <property> <value> (see xine_set_video_property)\n" "set audio driver <name>\n" "set audio volume <level>\n" "set audio mute\n" - "set audio volume <level>\n" "set interative <[yes | no | 1 | 0 | true | false]>\n" "set mrl <mrl>\n" "set loop <[playlist | mrl]>\n" @@ -1057,13 +1051,13 @@ else if(toxine_is_arg_contain(tox, 2, "mute")) { if(tox->audio.mixer.enable) - pinfo("Audio mute status: %s\n", (tox->audio.mixer.mute)?"muted":"unmuted"); + pinfo("Audio mute status: %s\n", (tox->audio.mixer.mute) ? "muted" : "unmuted"); else pinfo("Audio mixer is disable.\n"); } else if(toxine_is_arg_contain(tox, 2, "driver") || toxine_is_arg_contain(tox, 2, "name")) - pinfo("current audio driver name: %s\n", (tox->audio.name)?tox->audio.name:"not set"); + pinfo("current audio driver name: %s\n", (tox->audio.name) ? tox->audio.name : "not set"); } } @@ -1094,33 +1088,9 @@ pinfo("%s\n", help); } } - - } - - } - else if(nargs >= 3) { - - if(toxine_is_arg_contain(tox, 2, "property")) { - char buffer[1024]; - - memset(&buffer, 0, sizeof(buffer)); - sprintf(buffer, "%s %s", "xine_get_video_property", toxine_get_arg(tox, 3)); - - toxine_command_insert_command_line(tox, buffer); - toxine_handle_command(tox, NULL); - - } - else if(toxine_is_arg_contain(tox, 2, "property_min_max")) { - char buffer[1024]; - - memset(&buffer, 0, sizeof(buffer)); - sprintf(buffer, "%s %s", "xine_get_video_property_min_max", toxine_get_arg(tox, 3)); - - toxine_command_insert_command_line(tox, buffer); - toxine_handle_command(tox, NULL); - } - + else if(toxine_is_arg_contain(tox, 2, "driver") || toxine_is_arg_contain(tox, 2, "name")) + pinfo("current video driver name: %s\n", (tox->video.name) ? tox->video.name : "not set"); } } } @@ -1167,22 +1137,7 @@ else if(toxine_is_arg_contain(tox, 1, "video")) { if(nargs >= 2) { - if(toxine_is_arg_contain(tox, 2, "property")) { - - if(nargs >= 4) { - char buffer[1024]; - - memset(&buffer, 0, sizeof(buffer)); - sprintf(buffer, "%s %s %s", - "xine_set_param", toxine_get_arg(tox, 3), toxine_get_arg(tox, 4)); - - toxine_command_insert_command_line(tox, buffer); - toxine_handle_command(tox, NULL); - - } - - } - else if(toxine_is_arg_contain(tox, 2, "driver")) { + if(toxine_is_arg_contain(tox, 2, "driver")) { if(nargs >= 3) { if(tox->xine_state & XINE_INIT) { @@ -1239,21 +1194,15 @@ tox->audio.mixer.volume_level = atoi(toxine_get_arg(tox, 3)); - sprintf(buffer, "%s %d", - "xine_set_param XINE_PARAM_AUDIO_VOLUME", tox->audio.mixer.volume_level); - + sprintf(buffer, "%s %d", "xine_set_param XINE_PARAM_AUDIO_VOLUME", tox->audio.mixer.volume_level); toxine_command_insert_command_line(tox, buffer); - toxine_handle_command(tox, NULL); } } } - else if(toxine_is_arg_contain(tox, 2, "mute")) { - + else if(toxine_is_arg_contain(tox, 2, "mute")) toxine_command_insert_command_line(tox, "xine_set_param XINE_PARAM_AUDIO_MUTE"); - toxine_handle_command(tox, NULL); - } } } else if(toxine_is_arg_contain(tox, 1, "watchdog")) { @@ -1862,7 +1811,6 @@ while((mrl = toxine_get_arg(tox, i)) != NULL) { - //if(strlen(toxine_atoa(mrl))) { if(strlen(mrl)) { char *expanded_mrl; |