toxine-cvs Mailing List for toxine (Page 9)
Brought to you by:
f1rmb
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(19) |
Jul
(81) |
Aug
(18) |
Sep
(38) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(24) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(23) |
May
(36) |
Jun
(7) |
Jul
(29) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-24 16:29:02
|
Update of /cvsroot/toxine/toxine/doc/man/en In directory usw-pr-cvs1:/tmp/cvs-serv9603/doc/man/en Modified Files: toxine.1 Log Message: Mediamark implementation is done. Index: toxine.1 =================================================================== RCS file: /cvsroot/toxine/toxine/doc/man/en/toxine.1,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- toxine.1 16 Jul 2002 09:15:28 -0000 1.9 +++ toxine.1 24 Jul 2002 16:28:59 -0000 1.10 @@ -1,7 +1,7 @@ .\" -*-Nroff-*- .\"" .\"" -.TH TOXINE 1x 2002-07-16 "toxine" +.TH TOXINE 1x 2002-07-24 "toxine" .SH NAME toxine \- a text program, using xine library. .SH SYNOPSIS @@ -98,1097 +98,6 @@ Display this help text. .br [...1075 lines suppressed...] -\ \ config dump -.br -.br -.TP -.BR xine_usec_sleep -.br -.BR action: -.br -Sleep some u seconds -.br - -.BR syntax: -.br -\ \ xine_usec_sleep <u seconds> -.br -.br -.br .SH "SEE ALSO" .BR xine (1). .SH AUTHOR |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-24 16:29:02
|
Update of /cvsroot/toxine/toxine In directory usw-pr-cvs1:/tmp/cvs-serv9603 Modified Files: configure.in Log Message: Mediamark implementation is done. Index: configure.in =================================================================== RCS file: /cvsroot/toxine/toxine/configure.in,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- configure.in 14 Jul 2002 18:53:43 -0000 1.17 +++ configure.in 24 Jul 2002 16:28:59 -0000 1.18 @@ -282,7 +282,7 @@ AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686") dnl add x86 specific CFLAGS - GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer -malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops -finline-functions" + GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer -malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3" dnl enable x86 specific parts of the code |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-24 09:06:57
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv24358 Modified Files: commands.c common.h loader.c main.c parse.c playlist.c utils.c xine_commands.c Log Message: Few cleanups. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- commands.c 24 Jul 2002 08:15:33 -0000 1.24 +++ commands.c 24 Jul 2002 09:06:53 -0000 1.25 @@ -593,9 +593,8 @@ */ void toxine_audio_out_init(toxine_t *tox) { - if(!tox->audio.name) { + if(!tox->audio.name) perr("no audio driver sets, no audio output.\n"); - } if(!tox->audio.driver && tox->audio.name) { tox->audio.driver = xine_load_audio_output_plugin(tox->config, tox->audio.name); @@ -612,9 +611,8 @@ void toxine_command_help(commands_t *command, toxine_t *tox) { if(command) { - if(command->help) { + if(command->help) phelp("Help of '%s' command:\n%s\n", command->command, command->help); - } else pinfo("There is no help text for command '%s'\n", command->command); } @@ -626,9 +624,8 @@ void toxine_command_syntax(commands_t *command, toxine_t *tox) { if(command) { - if(command->syntax) { + if(command->syntax) phelp("Syntax of '%s' command:\n%s\n", command->command, command->syntax); - } else pinfo("There is no syntax definition for command '%s'\n", command->command); } @@ -759,45 +756,44 @@ action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGHUP, &action, NULL) != 0) { + if(sigaction(SIGHUP, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGHUP) failed: %s\n", strerror(errno)); - } + action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGUSR1, &action, NULL) != 0) { + if(sigaction(SIGUSR1, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGUSR1) failed: %s\n", strerror(errno)); - } + action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGUSR2, &action, NULL) != 0) { + if(sigaction(SIGUSR2, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGUSR2) failed: %s\n", strerror(errno)); - } + action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGINT, &action, NULL) != 0) { + if(sigaction(SIGINT, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGINT) failed: %s\n", strerror(errno)); - } + action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGTERM, &action, NULL) != 0) { + if(sigaction(SIGTERM, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGTERM) failed: %s\n", strerror(errno)); - } + action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGQUIT, &action, NULL) != 0) { + if(sigaction(SIGQUIT, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGQUIT) failed: %s\n", strerror(errno)); - } + action.sa_handler = toxine_signals_handler; sigemptyset(&(action.sa_mask)); action.sa_flags = 0; - if(sigaction(SIGALRM, &action, NULL) != 0) { + if(sigaction(SIGALRM, &action, NULL) != 0) fprintf(stderr, "sigaction(SIGALRM) failed: %s\n", strerror(errno)); - } toxine_load_vo_plugins(tox); @@ -897,39 +893,36 @@ if(nargs) { if(toxine_is_arg_contain(tox, 1, "audio")) { if(nargs >= 2) { - if(toxine_is_arg_contain(tox, 2, "capabilities")) { + + if(toxine_is_arg_contain(tox, 2, "capabilities")) _xine_get_audio_capabilities(NULL, tox, NULL); - } else if(toxine_is_arg_contain(tox, 2, "volume")) { - if(tox->audio.mixer.enable) { + if(tox->audio.mixer.enable) toxine_draw_bar("Current audio volume", 0, 100, tox->audio.mixer.volume_level); - } - else { + else pinfo("Audio mixer is disable.\n"); - } } else if(toxine_is_arg_contain(tox, 2, "mute")) { - if(tox->audio.mixer.enable) { + + if(tox->audio.mixer.enable) pinfo("Audio mute status: %s\n", (tox->audio.mixer.mute)?"muted":"unmuted"); - } - else { + else pinfo("Audio mixer is disable.\n"); - } + } - else if(toxine_is_arg_contain(tox, 2, "driver") || toxine_is_arg_contain(tox, 2, "name")) { + 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"); - } + } } else if(toxine_is_arg_contain(tox, 1, "video")) { if(nargs == 2) { - if(toxine_is_arg_contain(tox, 2, "capabilities")) { + if(toxine_is_arg_contain(tox, 2, "capabilities")) _NAPI_xine_get_video_capabilities(NULL, tox, NULL); - } else if(toxine_is_arg_contain(tox, 2, "fullscreen")) { int fullscreen; CHECK_XINE(tox); @@ -994,9 +987,8 @@ if(nargs) { if(nargs >= 2) { - if(toxine_is_arg_contain(tox, 1, "mrl")) { + if(toxine_is_arg_contain(tox, 1, "mrl")) toxine_set_current_mrl(tox, (toxine_get_arg(tox, 2))); - } if(toxine_is_arg_contain(tox, 1, "loop")) { char *lmode = (char *) toxine_get_arg(tox, 2); int i, mode = -1; @@ -1007,13 +999,13 @@ break; } } + if(mode >= 0) { tox->loop_mode = mode; pinfo("Loop mode is set to: '%s' [%d]\n", loop_modes[i].name, loop_modes[i].mode); } - else { + else perr("Loop mode '%s' isn't valid\n", lmode); - } } else if(toxine_is_arg_contain(tox, 1, "interactive")) { @@ -1051,10 +1043,10 @@ pinfo("new selected video driver: %s\n", tox->video.name); } - else { + else pinfo("current video driver name: %s\n", - (tox->video.name)?tox->video.name:"unset"); - } + (tox->video.name) ? tox->video.name : "unset"); + } else if(toxine_is_arg_contain(tox, 2, "fullscreen")) { CHECK_XINE(tox); @@ -1080,10 +1072,10 @@ tox->audio.name = strdup(toxine_get_arg(tox, 3)); pinfo("new selected audio driver: %s\n", tox->audio.name); } - else { + else pinfo("current video driver name: %s\n", - (tox->audio.name)?tox->audio.name:"unset"); - } + (tox->audio.name) ? tox->audio.name : "unset"); + } else if(toxine_is_arg_contain(tox, 2, "volume")) { if(nargs >= 3) { @@ -1506,7 +1498,9 @@ pinfo("Playlist (* is current):\n"); for(i = 0; i < tox->playlist.num; i++) { + poutalign(); + if(tox->playlist.cur == i) pout("*%4d: '%s' ", i, tox->playlist.mmk[i]->mrl); else @@ -1515,7 +1509,9 @@ pout("[%d .. %d]\n", tox->playlist.mmk[i]->start, tox->playlist.mmk[i]->end); } + pinfo(".\n"); + } else pinfo("Empty playlist.\n"); @@ -1681,18 +1677,16 @@ toxine_set_current_mrl_from_cur(tox); } } - else if(toxine_is_arg_contain(tox, 1, "save")) { + else if(toxine_is_arg_contain(tox, 1, "save")) playlist_save(tox, ((char *) toxine_get_arg(tox, 2))); - } else if(toxine_is_arg_contain(tox, 1, "loop")) { - if(toxine_is_arg_contain(tox, 2, "status")) { + if(toxine_is_arg_contain(tox, 2, "status")) pinfo("Playlist loop mode: %s [%s]\n", ((tox->playlist.loop) ? "ON" : "OFF"), loop_modes[tox->loop_mode].name); - } - else { + else tox->playlist.loop = (toxine_get_bool_value((toxine_get_arg(tox, 2)))) ? 1 : 0; - } + } } } @@ -1800,20 +1794,24 @@ pinfo("Mediamark list (* is current):\n"); for(i = 0; i < tox->playlist.num; i++) { + poutalign(); - if(tox->playlist.cur == i) { + + if(tox->playlist.cur == i) pout("*%4d - id: '%s'\n", i, tox->playlist.mmk[i]->ident); - } - else { + else pout(" %4d - id:'%s'\n", i, tox->playlist.mmk[i]->ident); - } + poutalign(); pout(" mrl: '%s'\n", tox->playlist.mmk[i]->mrl); poutalign(); pout(" start @ %d, end @ %d.\n", tox->playlist.mmk[i]->start, tox->playlist.mmk[i]->end); + } + pinfo(".\n"); + } else pinfo("Empty playlist.\n"); @@ -1831,13 +1829,12 @@ tox->playlist.cur = 0; toxine_set_current_mrl_from_cur(tox); } + } - else if(toxine_is_arg_contain(tox, 1, "save")) { + else if(toxine_is_arg_contain(tox, 1, "save")) playlist_save(tox, ((char *) toxine_get_arg(tox, 2))); - } else if(toxine_is_arg_contain(tox, 1, "delete")) { - // mediamark delete [#|id] - // mediamark delete [all|*] + if(toxine_is_arg_contain(tox, 2, "all") || toxine_is_arg_contain(tox, 2, "*")) { if(tox->playlist.num) { @@ -1891,6 +1888,7 @@ i++; } } + } else if(toxine_is_arg_contain(tox, 1, "add")) { //mediamark add // add mediamark from current playback/time @@ -1942,36 +1940,28 @@ switch(question_counter) { case 0: - if(*line) { + if(*line) xine_strdupa(mmk.ident, (toxine_atoa(line))); - } - else { + else xine_strdupa(mmk.ident, tox->playlist.mmk[entry]->ident); - } break; case 1: - if(*line) { + if(*line) xine_strdupa(mmk.mrl, (toxine_atoa(line))); - } - else { + else xine_strdupa(mmk.mrl, tox->playlist.mmk[entry]->mrl); - } break; case 2: - if(*line) { + if(*line) mmk.start = atoi(line); - } - else { + else mmk.start = tox->playlist.mmk[entry]->start; - } break; case 3: - if(*line) { + if(*line) mmk.end = atoi(line); - } - else { + else mmk.end = tox->playlist.mmk[entry]->end; - } break; } @@ -1999,15 +1989,12 @@ pout("Canceled.\n"); } } - else { + else pinfo("Nothing has been changed for this mediamark.\n"); - } } - else { + else perr("Entry %d is out of bound\n", entry); - } - } else if(toxine_is_arg_contain(tox, 1, "select")) { @@ -2036,12 +2023,11 @@ } else if(toxine_is_arg_contain(tox, 1, "loop")) { - if(toxine_is_arg_contain(tox, 2, "status")) { + if(toxine_is_arg_contain(tox, 2, "status")) pinfo("Mediamark loop mode: %s\n", ((tox->playlist.loop) ? "ON" : "OFF")); - } - else { + else tox->playlist.loop = (toxine_get_bool_value((toxine_get_arg(tox, 2)))) ? 1 : 0; - } + } } } Index: common.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/common.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- common.h 24 Jul 2002 08:15:33 -0000 1.10 +++ common.h 24 Jul 2002 09:06:53 -0000 1.11 @@ -33,12 +33,12 @@ #include "vo_plugin.h" -#define _FREE(x) { \ - if(x) { \ - free(x); \ - x = NULL; \ - } \ - } +#define _FREE(x) do { \ + if(x) { \ + free(x); \ + x = NULL; \ + } \ + } while(0) #define INFO_PREFIX " (I) " #define HELP_PREFIX " (?) " Index: loader.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/loader.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- loader.c 13 May 2002 20:46:41 -0000 1.1.1.1 +++ loader.c 24 Jul 2002 09:06:53 -0000 1.2 @@ -94,9 +94,8 @@ { char **vonames = tox->video.plugins[tox->video.plugins_num]->get_names(); - for(j = 0; vonames[j] != NULL; j++) { + for(j = 0; vonames[j] != NULL; j++) sprintf(buffer, "%s%s ", buffer, vonames[j]); - } } sprintf(buffer, "%s).\n", buffer); Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- main.c 23 Jul 2002 15:36:42 -0000 1.11 +++ main.c 24 Jul 2002 09:06:53 -0000 1.12 @@ -168,12 +168,14 @@ case 's': /* use a script file */ if(optarg != NULL) { + if(tox->script.filename == NULL) { tox->script.filename = strdup(optarg); tox->script.in_use = 1; } else fprintf(stderr, "script filename already set: '%s'\n", tox->script.filename); + } else { fprintf(stderr, "script filename is required to -S/--script option\n"); @@ -192,9 +194,9 @@ { char *ofile = (optarg) ? optarg : "toxine.out"; - if((tox->msg_fd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, 0644)) < 0) { + if((tox->msg_fd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, 0644)) < 0) fprintf(stderr, "Cannot open %s: %s\n", ofile, strerror(errno)); - } + } break; Index: parse.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/parse.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- parse.c 13 May 2002 20:46:38 -0000 1.1.1.1 +++ parse.c 24 Jul 2002 09:06:53 -0000 1.2 @@ -139,9 +139,8 @@ */ static void toxine_parse_handle_multicommands(toxine_t *tox) { - if(tox->command.remain) { + if(tox->command.remain) perr("Ooch, Unexpected state, remain isn't empty\n"); - } else { tox->command.remain = strdup(tox->command.line); toxine_parse_destock_remain(tox); @@ -249,6 +248,7 @@ } } else { + if(tox->command.command) tox->command.command = (char *) realloc(tox->command.command, strlen(tox->command.line) + 1); else Index: playlist.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- playlist.c 24 Jul 2002 08:15:33 -0000 1.5 +++ playlist.c 24 Jul 2002 09:06:53 -0000 1.6 @@ -79,9 +79,10 @@ struct stat pstat; if(filename) { - if(((stat(filename, &pstat)) > -1) && (S_ISREG(pstat.st_mode))) { + + if(((stat(filename, &pstat)) > -1) && (S_ISREG(pstat.st_mode))) return 1; - } + } return 0; } @@ -662,9 +663,8 @@ found = 1; } - if(found) { + if(found) pinfo("Playlist file (%s) is valid (%s).\n", filename, playlist->type); - } else { perr("Playlist file (%s) isn't valid.\n", filename); _FREE(playlist); Index: utils.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- utils.c 24 Jul 2002 08:15:33 -0000 1.8 +++ utils.c 24 Jul 2002 09:06:53 -0000 1.9 @@ -111,13 +111,11 @@ if(val < min) _val = (int) min; - if(title) { + if(title) pinfo("%s: (%%%.2f) %d > [%d] < %d\n", title, (((_val + -_min) / _max) * 100.0), min, val, max); - } - else { + else pinfo("- (%%%.2f) %d > [%d] < %d\n", (((_val + -_min) / _max) * 100.0), min, val, max); - } rl_get_screen_size(&screen_rows, &screen_cols); @@ -126,12 +124,12 @@ pinfo("|"); for(i = 0; i <= (screen_cols - 20); i++) { - if(i == (int) percent) { + + if(i == (int) percent) pout("*"); - } - else { + else pout("-"); - } + } pout("|\n"); pinfo(".\n"); @@ -332,12 +330,9 @@ } else { - if(tox->playlist.loop) { - if(tox->loop_mode == PLAYLIST_LOOP) { - tox->playlist.cur = 0; - - toxine_set_current_mrl_from_cur(tox); - } + if(tox->playlist.loop && (tox->loop_mode == PLAYLIST_LOOP)) { + tox->playlist.cur = 0; + toxine_set_current_mrl_from_cur(tox); } } @@ -381,9 +376,9 @@ if (errno != EINTR) return -1; } - else { + else return WEXITSTATUS(status); - } + } while(1); return -1; Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- xine_commands.c 23 Jul 2002 15:36:42 -0000 1.12 +++ xine_commands.c 24 Jul 2002 09:06:53 -0000 1.13 @@ -190,9 +190,10 @@ if(entry->enum_values) { int i; pinfo(" entry->enum_values: "); - for(i = 0; entry->enum_values[i]; i++) { + + for(i = 0; entry->enum_values[i]; i++) pout("'%s' ", entry->enum_values[i]); - } + pinfo("\n"); } break; @@ -216,9 +217,10 @@ if(entry->enum_values) { int i; pinfo(" entry->enum_values: "); - for(i = 0; entry->enum_values[i]; i++) { + + for(i = 0; entry->enum_values[i]; i++) pout("'%s' ", entry->enum_values[i]); - } + pinfo("\n"); } else { @@ -419,12 +421,10 @@ tox->current_mrl = strdup(mrl); } - else if(toxine_is_arg_contain(tox, 1, "start")) { + else if(toxine_is_arg_contain(tox, 1, "start")) start = atoi((toxine_get_arg(tox, 2))); - } - else if(toxine_is_arg_contain(tox, 1, "time")) { + else if(toxine_is_arg_contain(tox, 1, "time")) time = atoi((toxine_get_arg(tox, 2))); - } else { perr("Unhandled argument '%s'\n", (toxine_get_arg(tox, 1))); return; @@ -448,12 +448,11 @@ */ if(toxine_is_arg_contain(tox, 1,"mrl")) { mrl = (char *)toxine_get_arg(tox, 2); - if(toxine_is_arg_contain(tox, 3, "start")) { + + if(toxine_is_arg_contain(tox, 3, "start")) start = atoi((toxine_get_arg(tox, 4))); - } - else if(toxine_is_arg_contain(tox, 3, "time")) { + else if(toxine_is_arg_contain(tox, 3, "time")) time = atoi((toxine_get_arg(tox, 4))); - } else { perr("Unhandled argument '%s'\n", toxine_get_arg(tox, 3)); return; @@ -477,8 +476,10 @@ tox->current_mrl = strdup(mrl); pinfo("xine_play(%s, %d, %d)\n", mrl, start, time); + if(!xine_play(tox->xine, mrl, start, time)) perr("xine_play() failed.\n"); + pinfo(".\n"); if(expanded_mrl) @@ -654,15 +655,12 @@ else if(nargs >= 2) { value = atoi(toxine_get_arg(tox, 2)); - if(toxine_is_arg_contain(tox, 1, "AO_PROP_MIXER_VOL")) { + if(toxine_is_arg_contain(tox, 1, "AO_PROP_MIXER_VOL")) property = AO_PROP_MIXER_VOL; - } - else if(toxine_is_arg_contain(tox, 1, "AO_PROP_PCM_VOL")) { + else if(toxine_is_arg_contain(tox, 1, "AO_PROP_PCM_VOL")) property = AO_PROP_PCM_VOL; - } - else if(toxine_is_arg_contain(tox, 1, "AO_PROP_MUTE_VOL")) { + else if(toxine_is_arg_contain(tox, 1, "AO_PROP_MUTE_VOL")) property = AO_PROP_MUTE_VOL; - } if((property == AO_PROP_MIXER_VOL) || (property == AO_PROP_PCM_VOL)) { if(value < 0) @@ -718,21 +716,18 @@ CHECK_XINE(tox); nargs = toxine_is_args(tox); if(nargs) { - if(toxine_is_arg_contain(tox, 1, "volume")) { + + if(toxine_is_arg_contain(tox, 1, "volume")) property = tox->audio.mixer.volume_mixer; - } - else if(toxine_is_arg_contain(tox, 1, "mute")) { + else if(toxine_is_arg_contain(tox, 1, "mute")) property = AO_PROP_MUTE_VOL; - } - else if(toxine_is_arg_contain(tox, 1, "AO_PROP_MIXER_VOL")) { + else if(toxine_is_arg_contain(tox, 1, "AO_PROP_MIXER_VOL")) property = AO_PROP_MIXER_VOL; - } - else if(toxine_is_arg_contain(tox, 1, "AO_PROP_PCM_VOL")) { + else if(toxine_is_arg_contain(tox, 1, "AO_PROP_PCM_VOL")) property = AO_PROP_PCM_VOL; - } - else if(toxine_is_arg_contain(tox, 1, "AO_PROP_MUTE_VOL")) { + else if(toxine_is_arg_contain(tox, 1, "AO_PROP_MUTE_VOL")) property = AO_PROP_MUTE_VOL; - } + if(property >= 0) { pinfo("xine_get_audio_property(%d):\n", property); retval = xine_get_audio_property(tox->xine, property); @@ -806,9 +801,9 @@ } } } - else { + else perr("video driver not initialized\n"); - } + } } @@ -845,16 +840,15 @@ pinfo("property value is %d.\n", retval); pinfo(".\n"); } - else { + else perr("current video driver don't support the '%s' property\n", video_props[i].name); - } } } } - else { + else perr("video driver not initialized\n"); - } + } } @@ -891,16 +885,15 @@ pinfo("property min value is %d, max value is %d.\n", min, max); pinfo(".\n"); } - else { + else perr("current video driver don't support the '%s' property\n", video_props[i].name); - } } } } - else { + else perr("video driver not initialized\n"); - } + } } @@ -1071,10 +1064,12 @@ pinfo("Available identifier of browsable input plugins are:\n"); while(inpp[i] != NULL) { + if(strlen(buffer)) sprintf(buffer, "%s, %s", buffer, inpp[i]); else sprintf(buffer, "%s", inpp[i]); + i++; } sprintf(buffer, "%s.\n", buffer); @@ -1105,10 +1100,12 @@ pinfo("Available identifier of autoplay featured input plugins are:\n"); while(inpp[i] != NULL) { + if(strlen(buffer)) sprintf(buffer, "%s, %s", buffer, inpp[i]); else sprintf(buffer, "%s", inpp[i]); + i++; } sprintf(buffer, "%s.\n", buffer); @@ -1162,9 +1159,10 @@ ap = xine_get_autoplay_mrls(tox->xine, pname, &mrls); if(ap) { - for(i = 0; i < mrls; i++) { + + for(i = 0; i < mrls; i++) pinfo("%s\n", ap[i]); - } + pinfo(".\n"); } else @@ -1249,6 +1247,7 @@ } else pinfo("there is no available mrls from %s plugin.\n", pname); + } } } @@ -1286,10 +1285,12 @@ pinfo("Available video output plugins for '%s' visual are:\n", visual_name); memset(&buffer, 0, sizeof(buffer)); while(vop[v] != NULL) { + if(strlen(buffer)) sprintf(buffer, "%s, %s", buffer, vop[v]); else sprintf(buffer, "%s", vop[v]); + v++; } sprintf(buffer, "%s.\n", buffer); @@ -1298,11 +1299,13 @@ while(v) free(vop[--v]); + free(vop); } else pinfo("there is no video output plugin installed for visual '%s'.\n", visual_name); + } } @@ -1316,11 +1319,13 @@ v = 0; pinfo("Available video output plugins for '%s' visual are:\n", visual_types[i].name); memset(&buffer, 0, sizeof(buffer)); + while(vop[v] != NULL) { if(strlen(buffer)) sprintf(buffer, "%s, %s", buffer, vop[v]); else sprintf(buffer, "%s", vop[v]); + v++; } sprintf(buffer, "%s.\n", buffer); @@ -1329,6 +1334,7 @@ while(v) free(vop[--v]); + free(vop); } else @@ -1354,10 +1360,12 @@ pinfo("Available audio output plugins are:\n"); memset(&buffer, 0, sizeof(buffer)); while(aop[i] != NULL) { + if(strlen(buffer)) sprintf(buffer, "%s, %s", buffer, aop[i]); else sprintf(buffer, "%s", aop[i]); + i++; } sprintf(buffer, "%s.\n", buffer); @@ -1366,6 +1374,7 @@ while(i) free(aop[--i]); + free(aop); } else @@ -1402,12 +1411,12 @@ pinfo(".\n"); } else { - if(alias_event == 0) { + + if(alias_event == 0) pinfo("there is no event type named '%s'.\n", event_name); - } - else { + else pinfo("there is no event type # %d.\n", alias_event); - } + } } } @@ -1448,9 +1457,9 @@ pinfo(".\n"); } - else { + else perr("filename %s don't exist or isn't a regular file.\n", filename); - } + } else if(toxine_is_arg_contain(tox, 1, "lookup")) { char *key = (char *) toxine_get_arg(tox, 2); @@ -1458,11 +1467,11 @@ pinfo("config->lookup_entry(config, %s)\n", key); entry = tox->config->lookup_entry(tox->config, key); + if(entry) _dump_config_entry(entry); - else { + else pinfo("config key '%s' not found\n", key); - } } } |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-24 09:06:57
|
Update of /cvsroot/toxine/toxine/src/plugins In directory usw-pr-cvs1:/tmp/cvs-serv24358/plugins Modified Files: vo_aa.c vo_dxr3.c vo_none.c vo_x11.c Log Message: Few cleanups. Index: vo_aa.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_aa.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- vo_aa.c 12 Jul 2002 13:40:36 -0000 1.5 +++ vo_aa.c 24 Jul 2002 09:06:53 -0000 1.6 @@ -76,9 +76,8 @@ pthread_detach(pthread_self()); - while(tox->running) { + while(tox->running) usleep(16666); - } pthread_exit(NULL); } Index: vo_dxr3.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_dxr3.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- vo_dxr3.c 9 Jul 2002 20:33:10 -0000 1.8 +++ vo_dxr3.c 24 Jul 2002 09:06:53 -0000 1.9 @@ -86,9 +86,8 @@ pthread_detach(pthread_self()); - while(tox->running) { + while(tox->running) usleep(16666); - } pthread_exit(NULL); } Index: vo_none.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_none.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- vo_none.c 12 Jul 2002 13:40:36 -0000 1.1 +++ vo_none.c 24 Jul 2002 09:06:53 -0000 1.2 @@ -51,9 +51,8 @@ pthread_detach(pthread_self()); - while(tox->running) { + while(tox->running) usleep(16666); - } pthread_exit(NULL); } Index: vo_x11.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_x11.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- vo_x11.c 19 Jul 2002 22:38:46 -0000 1.12 +++ vo_x11.c 24 Jul 2002 09:06:53 -0000 1.13 @@ -312,7 +312,7 @@ update_cursor_visibility(tox); } - sleep(1); + xine_usec_sleep(1000000); } pthread_exit(NULL); @@ -537,11 +537,10 @@ /* * completion event */ - if(XShmQueryExtension(private->display) == True) { + if(XShmQueryExtension(private->display) == True) private->completion_event = XShmGetEventBase(private->display) + ShmCompletion; - } else { + else private->completion_event = -1; - } private->x11_drawable[private->fullscreen].video_width = 720; private->x11_drawable[private->fullscreen].video_height = 576; @@ -872,11 +871,11 @@ if (xevent->count == 0) { - if(xev->xany.window == private->x11_drawable[private->fullscreen].video_window) { + if(xev->xany.window == private->x11_drawable[private->fullscreen].video_window) tox->video.driver->gui_data_exchange (tox->video.driver, GUI_DATA_EX_EXPOSE_EVENT, xev); - } + } } break; |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-24 08:15:36
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv24598 Modified Files: commands.c common.h playlist.c playlist.h utils.c utils.h Log Message: add 'mediamark edit'. More bugfixes. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- commands.c 23 Jul 2002 15:36:42 -0000 1.23 +++ commands.c 24 Jul 2002 08:15:33 -0000 1.24 @@ -1132,24 +1132,10 @@ * leave toxine. */ static void do_quit(commands_t *command, toxine_t *tox, void *data) { - char *line; - char *prompt = "Do you really want to quit toxine ? [yes|no]: "; if(tox->interactive) { - if((line = readline(prompt)) == NULL) { - perr("%s(%d): readline() failed: %s\n", __FUNCTION__, __LINE__, - strerror(errno)); - exit(1); - } - - if (*line) { - line = toxine_atoa(line); - if(!strncasecmp(line, "yes", strlen(line))) { - _FREE(line); - tox->running = 0; - } - _FREE(line); - } + if((toxine_confirm("Do you really want to quit toxine ? [yes|no]: "))) + tox->running = 0; } else { tox->running = 0; @@ -1521,12 +1507,11 @@ pinfo("Playlist (* is current):\n"); for(i = 0; i < tox->playlist.num; i++) { poutalign(); - if(tox->playlist.cur == i) { + if(tox->playlist.cur == i) pout("*%4d: '%s' ", i, tox->playlist.mmk[i]->mrl); - } - else { + else pout(" %4d: '%s' ", i, tox->playlist.mmk[i]->mrl); - } + pout("[%d .. %d]\n", tox->playlist.mmk[i]->start, tox->playlist.mmk[i]->end); } @@ -1797,9 +1782,9 @@ mediamark add [mrl <mrl> | id <id>] start <time> end <time> - mediamark edit [#|mrl|id] // can change id/start/end + mediamark edit [#|id] // can change id/start/end - mediamark select id; + mediamark select [#|id]; mediamark loop [#|mrl|id] @@ -1851,8 +1836,7 @@ playlist_save(tox, ((char *) toxine_get_arg(tox, 2))); } else if(toxine_is_arg_contain(tox, 1, "delete")) { - //mediamark delete [#|id] -#warning "implement id" + // mediamark delete [#|id] // mediamark delete [all|*] if(toxine_is_arg_contain(tox, 2, "all") || toxine_is_arg_contain(tox, 2, "*")) { if(tox->playlist.num) { @@ -1874,7 +1858,10 @@ int i = 2; while((argument = (char *) (toxine_get_arg(tox, i)))) { - int entry = atoi(argument); + int entry; + + if((entry = playlist_get_entry_from_id(tox, argument)) < 0) + entry = atoi(toxine_get_arg(tox, 2)); if(tox->playlist.num && (entry < tox->playlist.num)) { int j; @@ -1918,16 +1905,119 @@ #warning "implement add" } else if(toxine_is_arg_contain(tox, 1, "edit")) { - //mediamark edit [#|mrl|id] // can change id/start/end -#warning "implement edit" + int entry; + + if((entry = playlist_get_entry_from_id(tox, (char *) toxine_get_arg(tox, 2))) < 0) + entry = atoi(toxine_get_arg(tox, 2)); + + if(entry < tox->playlist.num) { + char *line; + mediamark_t mmk; + int question_counter = 0; + int changed = 0; + char *questions[] = { + " Identificator (emtpy to keep original)?: ", + " Mrl (emtpy to keep original)?: ", + " Start time in secs (empty to keep original)?: ", + " End time in secs (empty to keep original, -1 to stream end)?: ", + NULL + }; + + pinfo("Editing :\n"); + pinfo(" %4d - id: '%s'\n", entry, tox->playlist.mmk[entry]->ident); + pinfo(" mrl: '%s'\n", tox->playlist.mmk[entry]->mrl); + pinfo(" start @ %d, end @ %d.\n", + tox->playlist.mmk[entry]->start, tox->playlist.mmk[entry]->end); + + while(questions[question_counter] != NULL) { + + if((line = readline(questions[question_counter])) == NULL) { + perr("%s(%d): readline() failed: %s\n", __FUNCTION__, __LINE__, + strerror(errno)); + exit(1); + } + + if(*line) + changed++; + + switch(question_counter) { + case 0: + if(*line) { + xine_strdupa(mmk.ident, (toxine_atoa(line))); + } + else { + xine_strdupa(mmk.ident, tox->playlist.mmk[entry]->ident); + } + break; + case 1: + if(*line) { + xine_strdupa(mmk.mrl, (toxine_atoa(line))); + } + else { + xine_strdupa(mmk.mrl, tox->playlist.mmk[entry]->mrl); + } + break; + case 2: + if(*line) { + mmk.start = atoi(line); + } + else { + mmk.start = tox->playlist.mmk[entry]->start; + } + break; + case 3: + if(*line) { + mmk.end = atoi(line); + } + else { + mmk.end = tox->playlist.mmk[entry]->end; + } + break; + } + + question_counter++; + } + + /* Summary */ + if(changed) { + int confirm; + + pinfo("New mediamark:\n"); + pinfo(" %4d - id: '%s'\n", entry, mmk.ident); + pinfo(" mrl: '%s'\n", mmk.mrl); + pinfo(" start @ %d, end @ %d.\n", mmk.start, mmk.end); + + confirm = (tox->interactive) ? (toxine_confirm("Replace mediamark ? [yes|no]: ")) : 1; + + if(confirm) { + playlist_replace_entry(&tox->playlist.mmk[entry], + mmk.mrl, mmk.ident, mmk.start, mmk.end); + pinfo("Mediamark updated.\n"); + } + else { + poutalign(); + pout("Canceled.\n"); + } + } + else { + pinfo("Nothing has been changed for this mediamark.\n"); + } + + } + else { + perr("Entry %d is out of bound\n", entry); + } + + } else if(toxine_is_arg_contain(tox, 1, "select")) { //mediamark select [id|#]; -#warning "implement id" - // Implement id - int entry = atoi(toxine_get_arg(tox, 2)); + int entry; int old_cur = tox->playlist.cur; + if((entry = playlist_get_entry_from_id(tox, (char *) toxine_get_arg(tox, 2))) < 0) + entry = atoi(toxine_get_arg(tox, 2)); + if(entry < tox->playlist.num) { tox->playlist.cur = entry; toxine_set_current_mrl_from_cur(tox); @@ -1952,9 +2042,6 @@ else { tox->playlist.loop = (toxine_get_bool_value((toxine_get_arg(tox, 2)))) ? 1 : 0; } - } - } - } Index: common.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/common.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- common.h 23 Jul 2002 15:36:42 -0000 1.9 +++ common.h 24 Jul 2002 08:15:33 -0000 1.10 @@ -49,39 +49,38 @@ #define PLAYLIST_LOOP 0 #define PLAYLIST_MRL_LOOP 1 -#define poutalign() { \ +#define poutalign() do { \ fprintf(stdout, "%s", EMPTY_PREFIX); \ fflush(stdout); \ - } -#define pout(FMT,ARGS...) { \ + } while(0) +#define pout(FMT,ARGS...) do { \ fprintf(stdout, FMT, ##ARGS); \ fflush(stdout); \ - } + } while(0) -#define perr(FMT,ARGS...) { \ +#define perr(FMT,ARGS...) do { \ fprintf(stdout, "%s", ERROR_PREFIX); \ fprintf(stdout, FMT, ##ARGS); \ fflush(stdout); \ - } -#define pinfo(FMT,ARGS...) { \ + } while(0) +#define pinfo(FMT,ARGS...) do { \ fprintf(stdout, "%s", INFO_PREFIX); \ fprintf(stdout, FMT, ##ARGS); \ fflush(stdout); \ - } + } while(0) -#define phelp(FMT,ARGS...) { \ +#define phelp(FMT,ARGS...) do { \ fprintf(stdout, "%s", HELP_PREFIX); \ fprintf(stdout, FMT, ##ARGS); \ fflush(stdout); \ - } + } while(0) - -#define CHECK_XINE(x) { \ +#define CHECK_XINE(x) do { \ if(x->xine == NULL) { \ perr("The xine engine isn't initialized. Do it first.\n"); \ return; \ } \ - } + } while(0) #ifndef NAME_MAX #define _NAME_MAX 256 Index: playlist.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- playlist.c 19 Jul 2002 21:03:54 -0000 1.4 +++ playlist.c 24 Jul 2002 08:15:33 -0000 1.5 @@ -597,6 +597,18 @@ /* * Public */ +int playlist_get_entry_from_id(toxine_t *tox, char *ident) { + if(tox && ident && tox->playlist.num) { + int i; + + for(i = 0; i < tox->playlist.num; i++) { + if(!strcasecmp(ident, tox->playlist.mmk[i]->ident)) + return i; + } + } + return -1; +} + void playlist_add_entry(toxine_t *tox, char *mrl, char *ident, int start, int end) { if(!tox->playlist.num) tox->playlist.mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); @@ -609,6 +621,15 @@ if(_playlist_store_mmk(&tox->playlist.mmk[tox->playlist.num], mrl, ident, start, end)) tox->playlist.num++; +} + +void playlist_replace_entry(mediamark_t **mmk, char *mrl, char *ident, int start, int end) { + _FREE((*mmk)->mrl); + _FREE((*mmk)->ident); + (*mmk)->start = 0; + (*mmk)->end = -1; + + (void) _playlist_store_mmk(mmk, mrl, ident, start, end); } void playlist_free_entry(toxine_t *tox, int offset) { Index: playlist.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- playlist.h 18 Jul 2002 22:19:30 -0000 1.2 +++ playlist.h 24 Jul 2002 08:15:33 -0000 1.3 @@ -23,7 +23,9 @@ #include "common.h" void playlist_add_entry(toxine_t *tox, char *mrl, char *ident, int start, int end); +void playlist_replace_entry(mediamark_t **mmk, char *mrl, char *ident, int start, int end); void playlist_free_entry(toxine_t *tox, int offset); +int playlist_get_entry_from_id(toxine_t *tox, char *ident); void playlist_load(toxine_t *tox, char *filename); void playlist_save(toxine_t *tox, char *filename); Index: utils.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- utils.c 23 Jul 2002 15:36:42 -0000 1.7 +++ utils.c 24 Jul 2002 08:15:33 -0000 1.8 @@ -41,6 +41,60 @@ extern prompt_state_t prompt_state[]; +/* + * cleanup the str string, take care about ' + */ +char *toxine_atoa(char *str) { + char *pbuf; + + pbuf = str; + + while(*pbuf != '\0') pbuf++; + + if(pbuf > str) + pbuf--; + + while((pbuf > str) && (*pbuf == '\r' || *pbuf == '\n' || + (*pbuf == '"' && *(pbuf - 1) != '\\'))) { + *pbuf = '\0'; + pbuf--; + } + + while((pbuf > str) && (*pbuf == ' ')) { + *pbuf = '\0'; + pbuf--; + } + + pbuf = str; + while(*pbuf == '=' || *pbuf == '"' || *pbuf == ' ' || *pbuf == '\t') pbuf++; + + return pbuf; +} + +int toxine_confirm(char *message) { + char *line; + char prompt[strlen(HELP_PREFIX) + strlen(message) + 1]; + + sprintf(prompt, "%s%s", HELP_PREFIX, message); + if((line = readline(prompt)) == NULL) { + perr("%s(%d): readline() failed: %s\n", __FUNCTION__, __LINE__, + strerror(errno)); + exit(1); + } + + if (*line) { + line = toxine_atoa(line); + + if(!strncasecmp(line, "yes", strlen(line))) { + _FREE(line); + return 1; + } + + _FREE(line); + } + return 0; +} + void toxine_draw_bar(char *title, int min, int max, int val) { float _val = (int) val; float _min = (int) min; @@ -125,35 +179,6 @@ } return 0; -} - -/* - * cleanup the str string, take care about ' - */ -char *toxine_atoa(char *str) { - char *pbuf; - - pbuf = str; - - while(*pbuf != '\0') pbuf++; - - if(pbuf > str) - pbuf--; - - while((pbuf > str) && (*pbuf == '\r' || *pbuf == '\n')) { - *pbuf = '\0'; - pbuf--; - } - - while((pbuf > str) && (*pbuf == ' ')) { - *pbuf = '\0'; - pbuf--; - } - - pbuf = str; - while(*pbuf == '=' || *pbuf == '"' || *pbuf == ' ' || *pbuf == '\t') pbuf++; - - return pbuf; } /* Index: utils.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- utils.h 23 Jul 2002 15:36:42 -0000 1.4 +++ utils.h 24 Jul 2002 08:15:33 -0000 1.5 @@ -23,6 +23,7 @@ #include "common.h" char *toxine_atoa(char *str); +int toxine_confirm(char *message); void toxine_update_prompt(toxine_t *tox); int toxine_system(int dont_run_as_root, char *command); int toxine_get_bool_value(const char *val); |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-23 15:36:46
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv21296 Modified Files: commands.c common.h main.c utils.c utils.h xine_commands.c xine_commands.h Log Message: More mediamark commands (fully uncomplete). Few bugfixes, adds. New loop mode (by mrl). Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- commands.c 19 Jul 2002 22:38:46 -0000 1.22 +++ commands.c 23 Jul 2002 15:36:42 -0000 1.23 @@ -83,9 +83,9 @@ char *name; int status; } status_struct[] = { - { "PLAY" , XINE_PLAY }, - { "STOP" , XINE_STOP }, - { "QUIT" , XINE_QUIT }, + { "PLAY", XINE_PLAY }, + { "STOP", XINE_STOP }, + { "QUIT", XINE_QUIT }, { "PAUSE", -1 }, { "SLOW_4", -2 }, { "SLOW_2", -3 }, @@ -97,6 +97,15 @@ { NULL , 0 } }; +static struct loop_modes_s { + char *name; + int mode; +} loop_modes[] = { + { "playlist", PLAYLIST_LOOP }, + { "mrl", PLAYLIST_MRL_LOOP }, + { NULL, -1 } +}; + prompt_state_t prompt_state[] = { { XINE_STOP , "STOP" }, { XINE_PLAY , "PLAY" }, @@ -153,7 +162,8 @@ "set audio mute\n" "set audio volume <level>\n" "set interative [yes | no | 1 | 0 | true | false]\n" - "set mrl <mrl>" + "set mrl <mrl>\n" + "set loop [playlist | mrl]" }, { "get", OPTIONAL_ARGS, do_get, "Get some internal values.", @@ -301,6 +311,10 @@ "mediamark", "NOTHING YET" }, + { "mmk", REQUIRE_ARGS, do_mediamk, + "mediamark alias", + "(see mediamark)" + }, { "version", NO_ARGS, do_version, "Display some version informations", "version" @@ -316,7 +330,7 @@ * Callback called on XINE_EVENT_PLAYBACK_FINISHED event */ static void finished_cb(toxine_t *tox) { - + if(tox->ignore_finished) return; @@ -324,12 +338,25 @@ __playloop: if (tox->playlist.cur < tox->playlist.num) { + + if(tox->playlist.loop && (tox->loop_mode == PLAYLIST_MRL_LOOP)) + tox->playlist.cur--; + + __playmrloop: toxine_set_current_mrl_from_cur(tox); _xine_play(NULL, tox, (void *)NO_ARGS); } else { - if((tox->playlist.loop == PLAYLIST_LOOP) && tox->playlist.num) { - tox->playlist.cur = 0; + if(tox->playlist.loop && tox->playlist.num) { + + if(tox->loop_mode == PLAYLIST_MRL_LOOP) { + tox->playlist.cur--; + goto __playmrloop; + } + else if(tox->loop_mode == PLAYLIST_LOOP) { + tox->playlist.cur = 0; + } + goto __playloop; } else @@ -876,7 +903,7 @@ else if(toxine_is_arg_contain(tox, 2, "volume")) { if(tox->audio.mixer.enable) { - pinfo("Current audio volume: %d\n", tox->audio.mixer.volume_level); + toxine_draw_bar("Current audio volume", 0, 100, tox->audio.mixer.volume_level); } else { pinfo("Audio mixer is disable.\n"); @@ -970,6 +997,25 @@ if(toxine_is_arg_contain(tox, 1, "mrl")) { toxine_set_current_mrl(tox, (toxine_get_arg(tox, 2))); } + if(toxine_is_arg_contain(tox, 1, "loop")) { + char *lmode = (char *) toxine_get_arg(tox, 2); + int i, mode = -1; + + for(i = 0; loop_modes[i].name != NULL; i++) { + if(!strncasecmp(lmode, loop_modes[i].name, strlen(lmode))) { + mode = loop_modes[i].mode; + break; + } + } + if(mode >= 0) { + tox->loop_mode = mode; + pinfo("Loop mode is set to: '%s' [%d]\n", loop_modes[i].name, loop_modes[i].mode); + } + else { + perr("Loop mode '%s' isn't valid\n", lmode); + } + + } else if(toxine_is_arg_contain(tox, 1, "interactive")) { tox->interactive = toxine_get_bool_value((toxine_get_arg(tox, 2))); } @@ -1598,7 +1644,7 @@ tox->playlist.num = 0; tox->playlist.cur = -1; - tox->playlist.loop = PLAYLIST_NOLOOP; + tox->playlist.loop = 0; toxine_set_current_mrl_from_cur(tox); } @@ -1627,7 +1673,7 @@ tox->playlist.mmk[tox->playlist.num + 1] = NULL; if(!tox->playlist.num) - tox->playlist.loop = PLAYLIST_NOLOOP; + tox->playlist.loop = 0; if(tox->playlist.num && (tox->playlist.cur == -1)) { tox->playlist.cur = 0; @@ -1643,7 +1689,7 @@ playlist_load(tox, ((char *) toxine_get_arg(tox, 2))); - tox->playlist.loop = PLAYLIST_NOLOOP; + tox->playlist.loop = 0; if(tox->playlist.num) { tox->playlist.cur = 0; @@ -1656,19 +1702,11 @@ else if(toxine_is_arg_contain(tox, 1, "loop")) { if(toxine_is_arg_contain(tox, 2, "status")) { - pinfo("Playlist loop mode: %s\n", ((tox->playlist.loop) ? "ON" : "OFF")); + pinfo("Playlist loop mode: %s [%s]\n", + ((tox->playlist.loop) ? "ON" : "OFF"), loop_modes[tox->loop_mode].name); } else { - int loop = toxine_get_bool_value((toxine_get_arg(tox, 2))); - - switch(loop) { - case 0: - tox->playlist.loop = PLAYLIST_NOLOOP; - break; - case 1: - tox->playlist.loop = PLAYLIST_LOOP; - break; - } + tox->playlist.loop = (toxine_get_bool_value((toxine_get_arg(tox, 2)))) ? 1 : 0; } } } @@ -1705,10 +1743,11 @@ pinfo(" interactive mode: '%s'\n", (tox->interactive) ? "YES" : "NO"); pinfo(" mrl: '%s'\n", (tox->current_mrl) ? tox->current_mrl : "not set"); pinfo(" ignore finished: '%d'\n", tox->ignore_finished); - pinfo(" Playlist:\n"); + pinfo(" Playlist/Mediamark:\n"); pinfo(" number of entries: '%d'\n", tox->playlist.num); pinfo(" current: '%d'\n", tox->playlist.cur); - pinfo(" loop: '%s'\n", (tox->playlist.loop == PLAYLIST_LOOP) ? "YES" : "NO"); + pinfo(" loop: '%s' [%s]\n", + (tox->playlist.loop) ? "YES" : "NO", loop_modes[tox->loop_mode].name); pinfo(" Script:\n"); pinfo(" in use: '%s'\n", (tox->script.in_use) ? "YES" : "NO"); pinfo(" file: '%s'\n", (tox->script.filename) ? tox->script.filename : "not set"); @@ -1719,33 +1758,9 @@ else if(nargs >= 2) { if(toxine_is_arg_contain(tox, 1, "current")) { if(toxine_is_arg_contain(tox, 2, "position")) { - float position; - int range, pos, i; - int screen_rows, screen_cols; - CHECK_XINE(tox); - - position = (int) xine_get_current_position(tox->xine); - pinfo("Current position: (%%%.2f) %d/65535\n", - ((position / 65535) * 100.0), (int) position); - - rl_get_screen_size(&screen_rows, &screen_cols); - - range = 65535 / (screen_cols - 20); - pos = position / range; - - pinfo("|"); - for(i = 0; i <= (screen_cols - 20); i++) { - if(i == pos) { - pout("*"); - } - else { - pout("-"); - } - } - pout("|\n"); - pinfo(".\n"); - + toxine_draw_bar("Current position", + 0, 65535, (xine_get_current_position(tox->xine))); } else if(toxine_is_arg_contain(tox, 2, "time")) { int seconds; @@ -1762,30 +1777,184 @@ } static void do_mediamk(commands_t *command, toxine_t *tox, void *data) { + int nargs; + /* - mediamark show - mediamarl load - mediamark save - mediamark delete [#|mrl|id] - mediamark delete all + *mediamark show + *mediamarl load <filename> + *mediamark save <filename> + *mediamark loop [loop mode] + + mediamark delete # + mediamark delete [all|*] + + mediamark add // add mediamark from current playback/time + // set id/start/end + + mediamark add mrl <mrl> (id will be == mrl) + mediamark add mrl <mrl> id <id> (start = 0, end == -1) + mediamark add [mrl <mrl> | id <id>] [start <time> | end <time] + + mediamark add [mrl <mrl> | id <id>] start <time> end <time> + + mediamark edit [#|mrl|id] // can change id/start/end + + mediamark select id; + + mediamark loop [#|mrl|id] - mediamark add // add mediamark from current playback/time - // set id/start/end + */ + + nargs = toxine_is_args(tox); + + if(nargs == 1) { + if(toxine_is_arg_contain(tox, 1, "show")) { - mediamark add mrl <mrl> (id will be == mrl) - mediamark add mrl <mrl> id <id> (start = 0, end == -1) - mediamark add [mrl <mrl> | id <id>] [start <time> | end <time] + if(tox->playlist.num) { + int i; + + pinfo("Mediamark list (* is current):\n"); + for(i = 0; i < tox->playlist.num; i++) { + poutalign(); + if(tox->playlist.cur == i) { + pout("*%4d - id: '%s'\n", i, tox->playlist.mmk[i]->ident); + } + else { + pout(" %4d - id:'%s'\n", i, tox->playlist.mmk[i]->ident); + } + poutalign(); + pout(" mrl: '%s'\n", tox->playlist.mmk[i]->mrl); + poutalign(); + pout(" start @ %d, end @ %d.\n", + tox->playlist.mmk[i]->start, tox->playlist.mmk[i]->end); + } + pinfo(".\n"); + } + else + pinfo("Empty playlist.\n"); + } - mediamark add [mrl <mrl> | id <id>] start <time> end <time> + } + else if(nargs >= 2) { - mediamark edit [#|mrl|id] // can change id/start/end + if(toxine_is_arg_contain(tox, 1, "load")) { + playlist_load(tox, ((char *) toxine_get_arg(tox, 2))); + + tox->playlist.loop = 0; + + if(tox->playlist.num) { + tox->playlist.cur = 0; + toxine_set_current_mrl_from_cur(tox); + } + } + else if(toxine_is_arg_contain(tox, 1, "save")) { + playlist_save(tox, ((char *) toxine_get_arg(tox, 2))); + } + else if(toxine_is_arg_contain(tox, 1, "delete")) { + //mediamark delete [#|id] +#warning "implement id" + // mediamark delete [all|*] + if(toxine_is_arg_contain(tox, 2, "all") || toxine_is_arg_contain(tox, 2, "*")) { + if(tox->playlist.num) { + + for(; tox->playlist.num > 0;) + playlist_free_entry(tox, (tox->playlist.num - 1)); + + _FREE(tox->playlist.mmk); + + tox->playlist.num = 0; + tox->playlist.cur = -1; + tox->playlist.loop = 0; + + toxine_set_current_mrl_from_cur(tox); + } + } + else { + char *argument; + int i = 2; + + while((argument = (char *) (toxine_get_arg(tox, i)))) { + int entry = atoi(argument); + + if(tox->playlist.num && (entry < tox->playlist.num)) { + int j; + + if(tox->playlist.cur >= entry) + tox->playlist.cur = -1; + + playlist_free_entry(tox, entry); + + for(j = entry; j < tox->playlist.num; j++) + tox->playlist.mmk[j] = tox->playlist.mmk[j + 1]; - mediamark select id; + tox->playlist.mmk = (mediamark_t **) + realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 2)); + + tox->playlist.mmk[tox->playlist.num + 1] = NULL; + + if(!tox->playlist.num) + tox->playlist.loop = 0; + + if(tox->playlist.num && (tox->playlist.cur == -1)) { + tox->playlist.cur = 0; + toxine_set_current_mrl_from_cur(tox); + } + } - mediamark loop - mediamark loop [#|mrl|id] + i++; + } + } + } + else if(toxine_is_arg_contain(tox, 1, "add")) { + //mediamark add // add mediamark from current playback/time + // set id/start/end + // + //mediamark add mrl <mrl> (id will be == mrl) + // mediamark add mrl <mrl> id <id> (start = 0, end == -1) + // mediamark add [mrl <mrl> | id <id>] [start <time> | end <time] + // + // mediamark add [mrl <mrl> | id <id>] start <time> end <time> + // +#warning "implement add" + } + else if(toxine_is_arg_contain(tox, 1, "edit")) { + //mediamark edit [#|mrl|id] // can change id/start/end +#warning "implement edit" + } + else if(toxine_is_arg_contain(tox, 1, "select")) { + //mediamark select [id|#]; +#warning "implement id" + // Implement id + int entry = atoi(toxine_get_arg(tox, 2)); + int old_cur = tox->playlist.cur; + + if(entry < tox->playlist.num) { + tox->playlist.cur = entry; + toxine_set_current_mrl_from_cur(tox); + } + + /* + * If xine engine is in PLAY status, and new selected entry is != than old one, + * start playback with new selected stream + */ + if(tox->xine && (old_cur != tox->playlist.cur)) { + int status = xine_get_status(tox->xine); + + if(status == XINE_PLAY) + _xine_play(NULL, tox, (void *)NO_ARGS); + } + } + else if(toxine_is_arg_contain(tox, 1, "loop")) { + + if(toxine_is_arg_contain(tox, 2, "status")) { + pinfo("Mediamark loop mode: %s\n", ((tox->playlist.loop) ? "ON" : "OFF")); + } + else { + tox->playlist.loop = (toxine_get_bool_value((toxine_get_arg(tox, 2)))) ? 1 : 0; + } + + } + + } - */ - pinfo("Function not implemented (yet)\n"); - pinfo(".\n"); } Index: common.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/common.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- common.h 19 Jul 2002 22:38:46 -0000 1.8 +++ common.h 23 Jul 2002 15:36:42 -0000 1.9 @@ -33,22 +33,21 @@ #include "vo_plugin.h" -#define _FREE(x) { \ - if(x) { \ - free(x); \ - x = NULL; \ - } \ - } - - -#define INFO_PREFIX " (I) " -#define HELP_PREFIX " (?) " -#define ERROR_PREFIX " (!) " -#define EMPTY_PREFIX " " -#define PROMPT "toxine{%s}> " +#define _FREE(x) { \ + if(x) { \ + free(x); \ + x = NULL; \ + } \ + } + +#define INFO_PREFIX " (I) " +#define HELP_PREFIX " (?) " +#define ERROR_PREFIX " (!) " +#define EMPTY_PREFIX " " +#define PROMPT "toxine{%s}> " -#define PLAYLIST_NOLOOP 0 -#define PLAYLIST_LOOP 1 +#define PLAYLIST_LOOP 0 +#define PLAYLIST_MRL_LOOP 1 #define poutalign() { \ fprintf(stdout, "%s", EMPTY_PREFIX); \ @@ -77,35 +76,35 @@ } -#define CHECK_XINE(x) { \ - if(x->xine == NULL) { \ - perr("The xine engine isn't initialized. Do it first.\n"); \ - return; \ - } \ - } +#define CHECK_XINE(x) { \ + if(x->xine == NULL) { \ + perr("The xine engine isn't initialized. Do it first.\n"); \ + return; \ + } \ + } #ifndef NAME_MAX -#define _NAME_MAX 256 +#define _NAME_MAX 256 #else -#define _NAME_MAX NAME_MAX +#define _NAME_MAX NAME_MAX #endif #ifndef PATH_MAX -#define _PATH_MAX 768 +#define _PATH_MAX 768 #else -#define _PATH_MAX PATH_MAX +#define _PATH_MAX PATH_MAX #endif typedef struct { - int xine_state; - char *state; + int xine_state; + char *state; } prompt_state_t; typedef struct { - char *ident; - char *mrl; - int start; /* 0..x (secs) */ - int end; /* -1 == <till the end> else (secs) */ + char *ident; + char *mrl; + int start; /* 0..x (secs) */ + int end; /* -1 == <till the end> else (secs) */ } mediamark_t; struct toxine_s { @@ -119,6 +118,8 @@ int ignore_finished; int msg_fd; + + int loop_mode; struct { vo_driver_t *driver; @@ -162,27 +163,27 @@ char *args[256]; } command; - char *current_mrl; + char *current_mrl; struct { - mediamark_t **mmk; + mediamark_t **mmk; - int num; /* number of entries in playlist */ - int cur; /* current entry in playlist */ - int loop; - pthread_t end_thread; - int thread_num; + int num; /* number of entries in playlist */ + int cur; /* current entry in playlist */ + int loop; + pthread_t end_thread; + int thread_num; } playlist; - char prompt[32]; - int interactive; - + char prompt[32]; + int interactive; + struct { - int in_use; - char *filename; - FILE *fd; - char buf[256]; - char *ln; + int in_use; + char *filename; + FILE *fd; + char buf[256]; + char *ln; } script; }; @@ -190,11 +191,11 @@ typedef void (*cmd_func_t)(commands_t *, toxine_t *, void *); struct commands_s { - char *command; - int argtype; - cmd_func_t function; - char *help; - char *syntax; + char *command; + int argtype; + cmd_func_t function; + char *help; + char *syntax; }; #endif Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- main.c 19 Jul 2002 22:38:46 -0000 1.10 +++ main.c 23 Jul 2002 15:36:42 -0000 1.11 @@ -103,7 +103,6 @@ int i; if(tox) { - void *v; if(tox->msg_fd >= 0) close(tox->msg_fd); @@ -158,7 +157,7 @@ tox->command.execute = 0; tox->msg_fd = -1; tox->playlist.cur = -1; - tox->playlist.loop = PLAYLIST_NOLOOP; + tox->playlist.loop = 0; /* * parse command line @@ -267,6 +266,7 @@ tox->running = 1; tox->playlist.mmk = NULL; tox->playlist.thread_num = 0;; + tox->loop_mode = PLAYLIST_LOOP; for(i = 0; i < 256; i++) tox->command.args[i] = (char *) xine_xmalloc(sizeof(char *) * 2048); Index: utils.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- utils.c 19 Jul 2002 21:03:54 -0000 1.6 +++ utils.c 23 Jul 2002 15:36:42 -0000 1.7 @@ -30,6 +30,7 @@ #include <sys/stat.h> #include <sys/wait.h> +#include "readline.h" #include "tilde.h" extern char **environ; @@ -40,6 +41,48 @@ extern prompt_state_t prompt_state[]; +void toxine_draw_bar(char *title, int min, int max, int val) { + float _val = (int) val; + float _min = (int) min; + float _max = (int) max; + float range, percent; + int i, screen_rows, screen_cols; + + if(max <= min) + _max = (int) (min + 1); + if(min >= max) + _min = (int) (max - 1); + if(val > max) + _val = (int) max; + if(val < min) + _val = (int) min; + + if(title) { + pinfo("%s: (%%%.2f) %d > [%d] < %d\n", title, + (((_val + -_min) / _max) * 100.0), min, val, max); + } + else { + pinfo("- (%%%.2f) %d > [%d] < %d\n", (((_val + -_min) / _max) * 100.0), min, val, max); + } + + rl_get_screen_size(&screen_rows, &screen_cols); + + range = (_max + -_min) / (screen_cols - 20); + percent = (_val + -_min) / range; + + pinfo("|"); + for(i = 0; i <= (screen_cols - 20); i++) { + if(i == (int) percent) { + pout("*"); + } + else { + pout("-"); + } + } + pout("|\n"); + pinfo(".\n"); +} + /* * Update the prompt, reflect the current xine_engine state. */ @@ -225,12 +268,23 @@ char *toxine_get_next_mrl(toxine_t *tox) { if(tox) { - if(tox->playlist.cur >= (tox->playlist.num - 1)) - return NULL; + if(tox->playlist.cur >= (tox->playlist.num - 1)) { + + if(tox->playlist.loop) { + + if(tox->loop_mode == PLAYLIST_LOOP) + return tox->playlist.mmk[0]->mrl; + else if(tox->loop_mode == PLAYLIST_MRL_LOOP) + return tox->playlist.mmk[tox->playlist.cur]->mrl; + + } + else + return NULL; + } return tox->playlist.mmk[tox->playlist.cur + 1]->mrl; } - + return NULL; } @@ -241,8 +295,26 @@ if(tox) { if(tox->playlist.cur < (tox->playlist.num - 1)) { - tox->playlist.cur++; + + if(tox->playlist.loop) { + if(tox->loop_mode == PLAYLIST_LOOP) + tox->playlist.cur++; + } + else + tox->playlist.cur++; + toxine_set_current_mrl_from_cur(tox); + } + else { + + if(tox->playlist.loop) { + if(tox->loop_mode == PLAYLIST_LOOP) { + tox->playlist.cur = 0; + + toxine_set_current_mrl_from_cur(tox); + } + } + } } } Index: utils.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- utils.h 8 Jul 2002 12:54:48 -0000 1.3 +++ utils.h 23 Jul 2002 15:36:42 -0000 1.4 @@ -35,5 +35,6 @@ char *toxine_get_next_mrl(toxine_t *tox); void toxine_branched(toxine_t *tox); int toxine_mkdir_safe(char *path); +void toxine_draw_bar(char *title, int min, int max, int val); #endif Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- xine_commands.c 19 Jul 2002 22:38:46 -0000 1.11 +++ xine_commands.c 23 Jul 2002 15:36:42 -0000 1.12 @@ -112,6 +112,8 @@ { "VO_PROP_ZOOM_FACTOR", VO_PROP_ZOOM_FACTOR, 0 }, { "VO_PROP_PAN_SCAN", VO_PROP_PAN_SCAN, 0 }, { "VO_PROP_TVMODE", VO_PROP_TVMODE, 0 }, + { "VO_PROP_MAX_NUM_FRAMES", VO_PROP_MAX_NUM_FRAMES, 0 }, + { "VO_PROP_VO_TYPE", VO_PROP_VO_TYPE, 0 }, { NULL, 0, 0 } }; Index: xine_commands.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- xine_commands.h 17 Jul 2002 22:08:37 -0000 1.5 +++ xine_commands.h 23 Jul 2002 15:36:42 -0000 1.6 @@ -165,7 +165,7 @@ " [VO_PROP_INTERLACED | VO_PROP_ASPECT_RATIO | VO_PROP_HUE |\n" \ " VO_PROP_SATURATION | VO_PROP_CONTRAST | VO_PROP_BRIGHTNESS |\n" \ " VO_PROP_COLORKEY | VO_PROP_AUTOPAINT_COLORKEY | VO_PROP_ZOOM_FACTOR |\n" \ - " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]" \ + " VO_PROP_PAN_SCAN | VO_PROP_TVMODE | VO_PROP_MAX_NUM_FRAMES | VO_PROP_VO_TYPE]" \ }, \ { "xine_get_video_property", REQUIRE_ARGS, _NAPI_xine_get_video_property, \ "Get a video property", \ @@ -174,7 +174,7 @@ " [VO_PROP_INTERLACED | VO_PROP_ASPECT_RATIO | VO_PROP_HUE |\n" \ " VO_PROP_SATURATION | VO_PROP_CONTRAST | VO_PROP_BRIGHTNESS |\n" \ " VO_PROP_COLORKEY | VO_PROP_AUTOPAINT_COLORKEY | VO_PROP_ZOOM_FACTOR |\n" \ - " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]" \ + " VO_PROP_PAN_SCAN | VO_PROP_TVMODE | VO_PROP_MAX_NUM_FRAMES | VO_PROP_VO_TYPE]" \ }, \ { "xine_get_video_property_min_max", REQUIRE_ARGS, _NAPI_xine_get_video_property_min_max, \ "Get a video property min and max values", \ @@ -183,7 +183,7 @@ " [VO_PROP_INTERLACED | VO_PROP_ASPECT_RATIO | VO_PROP_HUE |\n" \ " VO_PROP_SATURATION | VO_PROP_CONTRAST | VO_PROP_BRIGHTNESS |\n" \ " VO_PROP_COLORKEY | VO_PROP_AUTOPAINT_COLORKEY | VO_PROP_ZOOM_FACTOR |\n" \ - " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]" \ + " VO_PROP_PAN_SCAN | VO_PROP_TVMODE | VO_PROP_MAX_NUM_FRAMES | VO_PROP_VO_TYPE]" \ }, \ { "xine_check_version", REQUIRE_ARGS, _xine_check_version, \ "Compare version numbers with xine installed version.", \ |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-19 22:38:50
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv11359 Modified Files: commands.c commands.h common.h main.c xine_commands.c Log Message: start/end mmk implemented. mmk remaining: implement all mmk commands. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- commands.c 19 Jul 2002 21:03:54 -0000 1.21 +++ commands.c 19 Jul 2002 22:38:46 -0000 1.22 @@ -312,7 +312,6 @@ } }; - /* * Callback called on XINE_EVENT_PLAYBACK_FINISHED event */ @@ -339,6 +338,44 @@ } +void *toxine_end_thread(void *data) { + toxine_t *tox = (toxine_t *) data; + int secs; + int cur; + + tox->playlist.thread_num++; + cur = tox->playlist.cur; + + while(tox->event.last.type != XINE_EVENT_PLAYBACK_FINISHED) { + + xine_usec_sleep(500000.0); + + if(tox->xine != NULL) { + secs = xine_get_current_time(tox->xine); + + if(cur == tox->playlist.cur) { + + if(secs >= tox->playlist.mmk[cur]->end) { + tox->ignore_finished = 0; + finished_cb(tox); + goto __end_done; + } + + } + else + goto __end_done; + + } + else + goto __end_done; + + } + + __end_done: + tox->playlist.thread_num--; + pthread_exit(NULL); +} + /* * Listener of xine engine events. */ @@ -800,8 +837,17 @@ } /* deinit video_out plugin */ - if(tox->xine) + if(tox->xine) { + + if(tox->playlist.thread_num > 0) { + void *v; + + pthread_cancel(tox->playlist.end_thread); + pthread_join(tox->playlist.end_thread, &v); + } + _xine_exit(NULL, tox, NULL); + } if(tox->video.cur_plugin && tox->video.cur_plugin->video_out_deinit) tox->video.cur_plugin->video_out_deinit(tox); Index: commands.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- commands.h 13 May 2002 20:46:35 -0000 1.1.1.1 +++ commands.h 19 Jul 2002 22:38:46 -0000 1.2 @@ -33,5 +33,6 @@ void toxine_handle_command(toxine_t *, void *); void toxine_stop(toxine_t *); void toxine_run(toxine_t *, int, char **); +void *toxine_end_thread(void *); #endif Index: common.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/common.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- common.h 19 Jul 2002 21:03:54 -0000 1.7 +++ common.h 19 Jul 2002 22:38:46 -0000 1.8 @@ -170,6 +170,8 @@ int num; /* number of entries in playlist */ int cur; /* current entry in playlist */ int loop; + pthread_t end_thread; + int thread_num; } playlist; char prompt[32]; Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- main.c 18 Jul 2002 22:19:30 -0000 1.9 +++ main.c 19 Jul 2002 22:38:46 -0000 1.10 @@ -103,6 +103,7 @@ int i; if(tox) { + void *v; if(tox->msg_fd >= 0) close(tox->msg_fd); @@ -262,9 +263,10 @@ } - tox->config = xine_config_file_init(tox->configfile); - tox->running = 1; - tox->playlist.mmk = NULL; + tox->config = xine_config_file_init(tox->configfile); + tox->running = 1; + tox->playlist.mmk = NULL; + tox->playlist.thread_num = 0;; for(i = 0; i < 256; i++) tox->command.args[i] = (char *) xine_xmalloc(sizeof(char *) * 2048); Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- xine_commands.c 18 Jul 2002 22:19:30 -0000 1.10 +++ xine_commands.c 19 Jul 2002 22:38:46 -0000 1.11 @@ -29,6 +29,7 @@ #include <sys/stat.h> #include <unistd.h> #include <signal.h> +#include <pthread.h> #include <xine.h> #include <xine/xineutils.h> @@ -374,7 +375,28 @@ return; } else { + mrl = tox->current_mrl; + time = tox->playlist.mmk[tox->playlist.cur]->start; + if((tox->playlist.mmk[tox->playlist.cur]->end != -1) && + (tox->playlist.mmk[tox->playlist.cur]->start < + tox->playlist.mmk[tox->playlist.cur]->end)) { + pthread_attr_t pth_attrs; + struct sched_param pth_params; + void *v; + + if(tox->playlist.thread_num > 0) + pthread_join(tox->playlist.end_thread, &v); + + pthread_attr_init(&pth_attrs); + pthread_attr_getschedparam(&pth_attrs, &pth_params); + pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); + pthread_attr_setschedparam(&pth_attrs, &pth_params); + + pthread_create(&tox->playlist.end_thread, &pth_attrs, + toxine_end_thread,(void *)tox); + + } } } else { @@ -525,6 +547,7 @@ */ void _xine_exit(commands_t *command, toxine_t *tox, void *data) { CHECK_XINE(tox); + pinfo("xine_remove_event_listener()\n"); xine_remove_event_listener(tox->xine, toxine_event_listener); pinfo("xine_exit()\n"); |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-19 22:38:49
|
Update of /cvsroot/toxine/toxine/src/plugins In directory usw-pr-cvs1:/tmp/cvs-serv11359/plugins Modified Files: vo_x11.c Log Message: start/end mmk implemented. mmk remaining: implement all mmk commands. Index: vo_x11.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_x11.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- vo_x11.c 14 Jul 2002 14:29:37 -0000 1.11 +++ vo_x11.c 19 Jul 2002 22:38:46 -0000 1.12 @@ -293,13 +293,17 @@ usec_sleep(100000); while(tox->running) { - int status = xine_get_status(tox->xine); - - if(status == XINE_PLAY) { - screensaver_timer++; - if(screensaver_timer >= private->fake_rate) { - screensaver_timer = 0; - reset_screensaver(vop); + int status; + + if(tox->xine != NULL) { + status = xine_get_status(tox->xine); + + if(status == XINE_PLAY) { + screensaver_timer++; + if(screensaver_timer >= private->fake_rate) { + screensaver_timer = 0; + reset_screensaver(vop); + } } } |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-19 21:03:58
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv15599/src Modified Files: commands.c common.h playlist.c utils.c Log Message: Fix interactive mode (-i) when fall from script to prompt. Implement toxine's playlist file parser (all playlist stuff will be backported to xine-ui soon). Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- commands.c 18 Jul 2002 22:19:30 -0000 1.20 +++ commands.c 19 Jul 2002 21:03:54 -0000 1.21 @@ -747,9 +747,11 @@ else { if(tox->command.execute) { + int old_interactive = tox->interactive; + tox->interactive = 0; toxine_handle_command(tox, NULL); - tox->interactive = 1; + tox->interactive = old_interactive; } grabbed_line = NULL; Index: common.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/common.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- common.h 18 Jul 2002 22:19:30 -0000 1.6 +++ common.h 19 Jul 2002 21:03:54 -0000 1.7 @@ -47,11 +47,8 @@ #define EMPTY_PREFIX " " #define PROMPT "toxine{%s}> " -#define MAX_PLAYLIST 2048 /* Max playlist length */ #define PLAYLIST_NOLOOP 0 #define PLAYLIST_LOOP 1 -#define MAX_MEDIAMK 2048 - #define poutalign() { \ fprintf(stdout, "%s", EMPTY_PREFIX); \ Index: playlist.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- playlist.c 18 Jul 2002 22:19:30 -0000 1.3 +++ playlist.c 19 Jul 2002 21:03:54 -0000 1.4 @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <assert.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -132,6 +133,13 @@ return((playlist->ln != NULL)); } +static void set_pos_to_value(char **p) { + assert(*p != NULL); + + while(*(*p) != '\0' && *(*p) != '=' && *(*p) != ':' && *(*p) != '{') ++(*p); + while(*(*p) == '=' || *(*p) == ':' || *(*p) == ' ' || *(*p) == '\t') ++(*p); +} + /* * Playlists guessing */ @@ -427,15 +435,177 @@ return NULL; } +static mediamark_t **guess_toxine_playlist(playlist_t *playlist, char *filename) { + mediamark_t **mmk = NULL; + + if(filename) { + if(playlist_check_for_file(filename)) { + int entries_pls = 0; + + if((playlist->fd = fopen(filename, "r")) != NULL) { + char buffer[32768]; + char *p, *pp; + int start = 0; + + memset(&buffer, 0, sizeof(buffer)); + p = buffer; + + while(playlist_get_next_line(playlist)) { + + if((playlist->ln) && (strlen(playlist->ln))) { + + if(strncmp(playlist->ln, "#", 1)) { + pp = playlist->ln; + + while(*pp != '\0') { + if(!strncasecmp(pp, "entry {", 7)) { + if(!start) { + start = 1; + pp += 7; + memset(&buffer, 0, sizeof(buffer)); + p = buffer; + } + else { + memset(&buffer, 0, sizeof(buffer)); + p = buffer; + goto __discard; + } + } + if((*pp == '}') && (*(pp + 1) == ';')) { + if(start) { + start = 0; + pp += 2; + + { /* OKAY, check found string */ + mediamark_t mmkf; + int mmkf_members[4]; + char *line; + char *m; + + mmkf.start = 0; + mmkf.end = -1; + mmkf_members[0] = 0; /* ident */ + mmkf_members[1] = -1; /* mrl */ + mmkf_members[2] = 0; /* start */ + mmkf_members[3] = 0; /* end */ + + xine_strdupa(line, (toxine_atoa(buffer))); + + while((m = xine_strsep(&line, ";")) != NULL) { + char *key; + + key = toxine_atoa(m); + if(strlen(key)) { + + if(!strncasecmp(key, "identifier", 10)) { + if(mmkf_members[0] == 0) { + mmkf_members[0] = 1; + set_pos_to_value(&key); + xine_strdupa(mmkf.ident, key); + } + } + else if(!strncasecmp(key, "start", 5)) { + if(mmkf_members[2] == 0) { + mmkf_members[2] = 1; + set_pos_to_value(&key); + mmkf.start = strtol(key, &key, 10); + } + } + else if(!strncasecmp(key, "end", 3)) { + if(mmkf_members[3] == 0) { + mmkf_members[3] = 1; + set_pos_to_value(&key); + mmkf.end = strtol(key, &key, 10); + } + } + else if(!strncasecmp(key, "mrl", 3)) { + if(mmkf_members[1] == -1) { + mmkf_members[1] = 1; + set_pos_to_value(&key); + xine_strdupa(mmkf.mrl, key); + } + } + } + } + + if((mmkf_members[1] == 0) || (mmkf_members[1] == -1)) { + /* printf("wow, no mrl found\n"); */ + goto __discard; + } + + if(mmkf_members[0] == 0) { + xine_strdupa(mmkf.ident, mmkf.mrl); + } + + /* + STORE new mmk; + */ +#if 0 + printf("DUMP mediamark entry:\n"); + printf("id: '%s'\n", mmkf.ident); + printf("mrl: '%s'\n", mmkf.mrl); + printf("start: %d\n", mmkf.start); + printf("end: %d\n", mmkf.end); +#endif + + entries_pls++; + + if(entries_pls == 1) + mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); + else + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + _playlist_store_mmk(&mmk[(entries_pls - 1)], + mmkf.mrl, mmkf.ident, mmkf.start, mmkf.end); + + playlist->entries = entries_pls; + + } + + } + else { + memset(&buffer, 0, sizeof(buffer)); + p = buffer; + goto __discard; + } + } + + if(*pp != '\0') { + *p = *pp; + p++; + } + pp++; + } + + } + } + __discard: + } + + fclose(playlist->fd); + + if(entries_pls) { + mmk[entries_pls] = NULL; + playlist->type = strdup("TOX"); + return mmk; + } + } + } + } + return NULL; +} + /* * Public */ void playlist_add_entry(toxine_t *tox, char *mrl, char *ident, int start, int end) { if(!tox->playlist.num) tox->playlist.mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else - tox->playlist.mmk = (mediamark_t **) - realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 1)); + else { + if(tox->playlist.num > 1) { + tox->playlist.mmk = (mediamark_t **) + realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 1)); + } + } if(_playlist_store_mmk(&tox->playlist.mmk[tox->playlist.num], mrl, ident, start, end)) tox->playlist.num++; @@ -455,6 +625,7 @@ mediamark_t **mmk = NULL; mediamark_t **ommk; playlist_guess_func_t guess_functions[] = { + guess_toxine_playlist, guess_xmms_playlist_pls, guess_xmms_playlist_m3u, guess_xmms_playlist, @@ -471,7 +642,7 @@ } if(found) { - pinfo("Playlist file (%s) is valid.\n", filename); + pinfo("Playlist file (%s) is valid (%s).\n", filename, playlist->type); } else { perr("Playlist file (%s) isn't valid.\n", filename); @@ -521,19 +692,18 @@ if((fd = fopen(filename, "w")) != NULL) { -#warning implement loader - fprintf(fd, "; toxine playlist\n"); + fprintf(fd, "# toxine playlist\n"); for(i = 0; i < tox->playlist.num; i++) { fprintf(fd, "\nentry {\n"); - fprintf(fd, " identifier = %s\n", tox->playlist.mmk[i]->ident); - fprintf(fd, " mrl = %s\n", tox->playlist.mmk[i]->mrl); - fprintf(fd, " start = %d\n", tox->playlist.mmk[i]->start); - fprintf(fd, " end = %d\n", tox->playlist.mmk[i]->end); - fprintf(fd,"}\n"); + fprintf(fd, "\tidentifier = %s;\n", tox->playlist.mmk[i]->ident); + fprintf(fd, "\tmrl = %s;\n", tox->playlist.mmk[i]->mrl); + fprintf(fd, "\tstart = %d;\n", tox->playlist.mmk[i]->start); + fprintf(fd, "\tend = %d;\n", tox->playlist.mmk[i]->end); + fprintf(fd,"};\n"); } - fprintf(fd, "; END\n"); + fprintf(fd, "# END\n"); fclose(fd); pinfo("Playlist '%s' saved.\n", filename); Index: utils.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- utils.c 18 Jul 2002 22:19:30 -0000 1.5 +++ utils.c 19 Jul 2002 21:03:54 -0000 1.6 @@ -203,14 +203,15 @@ void toxine_set_current_mrl(toxine_t *tox, const char *mrl) { if(tox && mrl) { + if((tox->playlist.cur = toxine_lookup_in_playlist(tox, mrl)) == -1) { char *expanded_mrl; expanded_mrl = tilde_expand(mrl); playlist_add_entry(tox, expanded_mrl, NULL, 0, -1); - tox->playlist.cur = tox->playlist.num; - + tox->playlist.cur = (tox->playlist.num - 1); + free(expanded_mrl); } |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-18 22:19:33
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv5825/src Modified Files: commands.c common.h main.c playlist.c playlist.h utils.c xine_commands.c Log Message: Playlist switch from char** to new mediamark_t** data type. mediamark stuff is under construction and not implemented yet. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- commands.c 16 Jul 2002 09:15:28 -0000 1.19 +++ commands.c 18 Jul 2002 22:19:30 -0000 1.20 @@ -123,6 +123,7 @@ static void do_events(commands_t *, toxine_t *, void *); static void do_playlist(commands_t *, toxine_t *, void *); static void do_display(commands_t *, toxine_t *, void *); +static void do_mediamk(commands_t *, toxine_t *, void *); static commands_t commands[] = { { "commands", NO_ARGS, do_help, @@ -285,7 +286,7 @@ "playlist add <mrl> ...\n" "playlist from <plugin>\n" "playlist delete # ...\n" - "playlist delete all\n" + "playlist delete [all | *]\n" "playlist load <filename>\n" "playlist save <filename>\n" "playlist loop [[yes | no | 1 | 0 | true | false] | [status]]" @@ -296,6 +297,10 @@ "display current time\n" "display settings" }, + { "mediamark", REQUIRE_ARGS, do_mediamk, + "mediamark", + "NOTHING YET" + }, { "version", NO_ARGS, do_version, "Display some version informations", "version" @@ -1423,11 +1428,13 @@ for(i = 0; i < tox->playlist.num; i++) { poutalign(); if(tox->playlist.cur == i) { - pout("*%4d: '%s'\n", i, tox->playlist.entries[i]); + pout("*%4d: '%s' ", i, tox->playlist.mmk[i]->mrl); } else { - pout(" %4d: '%s'\n", i, tox->playlist.entries[i]); + pout(" %4d: '%s' ", i, tox->playlist.mmk[i]->mrl); } + pout("[%d .. %d]\n", tox->playlist.mmk[i]->start, tox->playlist.mmk[i]->end); + } pinfo(".\n"); } @@ -1486,17 +1493,20 @@ int i = 2; while((mrl = (char *) (toxine_get_arg(tox, i))) != NULL) { - char *expanded_mrl; - expanded_mrl = tilde_expand(mrl); - - tox->playlist.entries[tox->playlist.num++] = strdup(expanded_mrl); - - free(expanded_mrl); - - if(tox->playlist.cur == -1) { - tox->playlist.cur = 0; - toxine_set_current_mrl_from_cur(tox); + if(strlen(toxine_atoa(mrl))) { + char *expanded_mrl; + + expanded_mrl = tilde_expand(mrl); + + playlist_add_entry(tox, expanded_mrl, NULL, 0, -1); + + free(expanded_mrl); + + if(tox->playlist.cur == -1) { + tox->playlist.cur = 0; + toxine_set_current_mrl_from_cur(tox); + } } i++; } @@ -1504,38 +1514,45 @@ else if(toxine_is_arg_contain(tox, 1, "from")) { char **ap; int i, mrls; + char *plugname; CHECK_XINE(tox); - pinfo("Grab mrls from '%s' input plugin.\n", toxine_get_arg(tox, 2)); - ap = xine_get_autoplay_mrls(tox->xine, (char *) (toxine_get_arg(tox, 2)), &mrls); + plugname = (char *) (toxine_get_arg(tox, 2)); + pinfo("Grab mrls from '%s' input plugin.\n", plugname); + ap = xine_get_autoplay_mrls(tox->xine, plugname, &mrls); if(ap && mrls) { - for(i = 0; i < mrls; i++) { - tox->playlist.entries[tox->playlist.num++] = strdup(ap[i]); - } + for(i = 0; i < mrls; i++) + playlist_add_entry(tox, ap[i], NULL, 0, -1); if(tox->playlist.num && (tox->playlist.cur == -1)) { tox->playlist.cur = 0; toxine_set_current_mrl_from_cur(tox); } + pinfo("Plugin '%s' returns %d mrls\n", plugname, tox->playlist.num); } else pinfo("Plugin '%s' returned nothing.\n", toxine_get_arg(tox, 2)); + pinfo(".\n"); } else if(toxine_is_arg_contain(tox, 1, "delete")) { - if(toxine_is_arg_contain(tox, 2, "all")) { + if(toxine_is_arg_contain(tox, 2, "all") || toxine_is_arg_contain(tox, 2, "*")) { if(tox->playlist.num) { + + for(; tox->playlist.num > 0;) + playlist_free_entry(tox, (tox->playlist.num - 1)); - for(; tox->playlist.num >= 0; tox->playlist.num--) - _FREE(tox->playlist.entries[tox->playlist.num]); + _FREE(tox->playlist.mmk); tox->playlist.num = 0; tox->playlist.cur = -1; tox->playlist.loop = PLAYLIST_NOLOOP; + + toxine_set_current_mrl_from_cur(tox); } } else { @@ -1548,21 +1565,22 @@ if(tox->playlist.num && (entry < tox->playlist.num)) { int j; - if(tox->playlist.cur >= entry) { + if(tox->playlist.cur >= entry) tox->playlist.cur = -1; - } - _FREE(tox->playlist.entries[entry]); + playlist_free_entry(tox, entry); for(j = entry; j < tox->playlist.num; j++) - tox->playlist.entries[j] = tox->playlist.entries[j + 1]; + tox->playlist.mmk[j] = tox->playlist.mmk[j + 1]; + + tox->playlist.mmk = (mediamark_t **) + realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 2)); - tox->playlist.entries[j] = NULL; - tox->playlist.num--; + tox->playlist.mmk[tox->playlist.num + 1] = NULL; if(!tox->playlist.num) tox->playlist.loop = PLAYLIST_NOLOOP; - + if(tox->playlist.num && (tox->playlist.cur == -1)) { tox->playlist.cur = 0; toxine_set_current_mrl_from_cur(tox); @@ -1574,18 +1592,7 @@ } } else if(toxine_is_arg_contain(tox, 1, "load")) { - /* - * Flush the playlist. - */ - if(tox->playlist.num) { - - for(; tox->playlist.num >= 0; tox->playlist.num--) - _FREE(tox->playlist.entries[tox->playlist.num]); - - tox->playlist.num = 0; - tox->playlist.cur = -1; - } - + playlist_load(tox, ((char *) toxine_get_arg(tox, 2))); tox->playlist.loop = PLAYLIST_NOLOOP; @@ -1704,4 +1711,33 @@ } } } +} + +static void do_mediamk(commands_t *command, toxine_t *tox, void *data) { + /* + mediamark show + mediamarl load + mediamark save + mediamark delete [#|mrl|id] + mediamark delete all + + mediamark add // add mediamark from current playback/time + // set id/start/end + + mediamark add mrl <mrl> (id will be == mrl) + mediamark add mrl <mrl> id <id> (start = 0, end == -1) + mediamark add [mrl <mrl> | id <id>] [start <time> | end <time] + + mediamark add [mrl <mrl> | id <id>] start <time> end <time> + + mediamark edit [#|mrl|id] // can change id/start/end + + mediamark select id; + + mediamark loop + mediamark loop [#|mrl|id] + + */ + pinfo("Function not implemented (yet)\n"); + pinfo(".\n"); } Index: common.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/common.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- common.h 11 Jul 2002 20:30:45 -0000 1.5 +++ common.h 18 Jul 2002 22:19:30 -0000 1.6 @@ -50,6 +50,7 @@ #define MAX_PLAYLIST 2048 /* Max playlist length */ #define PLAYLIST_NOLOOP 0 #define PLAYLIST_LOOP 1 +#define MAX_MEDIAMK 2048 #define poutalign() { \ @@ -103,6 +104,13 @@ char *state; } prompt_state_t; +typedef struct { + char *ident; + char *mrl; + int start; /* 0..x (secs) */ + int end; /* -1 == <till the end> else (secs) */ +} mediamark_t; + struct toxine_s { int autoinit; int running; @@ -160,7 +168,8 @@ char *current_mrl; struct { - char *entries[MAX_PLAYLIST]; + mediamark_t **mmk; + int num; /* number of entries in playlist */ int cur; /* current entry in playlist */ int loop; Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- main.c 16 Jul 2002 09:15:28 -0000 1.8 +++ main.c 18 Jul 2002 22:19:30 -0000 1.9 @@ -47,6 +47,7 @@ #include "common.h" #include "utils.h" #include "commands.h" +#include "playlist.h" extern int errno; @@ -107,8 +108,10 @@ close(tox->msg_fd); if(tox->playlist.num) { - for(; tox->playlist.num >= 0; tox->playlist.num--) - _FREE(tox->playlist.entries[tox->playlist.num]); + for(; tox->playlist.num > 0;) + playlist_free_entry(tox, (tox->playlist.num - 1)); + + _FREE(tox->playlist.mmk); } _FREE(tox->configfile); @@ -259,8 +262,9 @@ } - tox->config = xine_config_file_init(tox->configfile); - tox->running = 1; + tox->config = xine_config_file_init(tox->configfile); + tox->running = 1; + tox->playlist.mmk = NULL; for(i = 0; i < 256; i++) tox->command.args[i] = (char *) xine_xmalloc(sizeof(char *) * 2048); Index: playlist.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- playlist.c 11 Jul 2002 20:30:45 -0000 1.2 +++ playlist.c 18 Jul 2002 22:19:30 -0000 1.3 @@ -39,12 +39,37 @@ char buf[256]; char *ln; - char **playlist; int entries; char *type; + } playlist_t; -typedef int (*playlist_guess_func_t)(playlist_t *, char *); +typedef mediamark_t **(*playlist_guess_func_t)(playlist_t *, char *); + +static int _playlist_store_mmk(mediamark_t **mmk, char *mrl, char *ident, int start, int end) { + + if((mmk != NULL) && (mrl != NULL)) { + + (*mmk) = (mediamark_t *) xine_xmalloc(sizeof(mediamark_t)); + (*mmk)->mrl = strdup(mrl); + (*mmk)->ident = strdup((ident != NULL) ? ident : mrl); + (*mmk)->start = start; + (*mmk)->end = end; + return 1; + } + + return 0; +} + +static int _playlist_free_mmk(mediamark_t **mmk) { + if((*mmk) != NULL) { + _FREE((*mmk)->ident); + _FREE((*mmk)->mrl); + _FREE((*mmk)); + return 1; + } + return 0; +} /* * Check if filename is a regular file @@ -110,8 +135,9 @@ /* * Playlists guessing */ -static int guess_xmms_playlist_pls(playlist_t *playlist, char *filename) { - char *extension; +static mediamark_t **guess_xmms_playlist_pls(playlist_t *playlist, char *filename) { + mediamark_t **mmk = NULL; + char *extension; if(filename) { if(playlist_check_for_file(filename)) { @@ -134,15 +160,16 @@ char buffer[2048]; memset(buffer, 0, sizeof(buffer)); - if((sscanf(playlist->ln, "File%d=%s", &entry, &buffer[0])) == 2) { - playlist->playlist[(entry - 1)] = strdup(buffer); - } + + if((sscanf(playlist->ln, "File%d=%s", &entry, &buffer[0])) == 2) + _playlist_store_mmk(&mmk[(entry - 1)], buffer, NULL, 0, -1); + } else { if((sscanf(playlist->ln, "NumberOfEntries=%d", &entries_pls)) == 1) { if(entries_pls) { playlist->entries = entries_pls; - playlist->playlist = (char **) xine_xmalloc(sizeof(char *) * (entries_pls + 1)); + mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * (entries_pls + 1)); } } } @@ -157,20 +184,21 @@ fclose(playlist->fd); if(valid_pls && entries_pls) { - playlist->playlist[entries_pls] = NULL; + mmk[entries_pls] = NULL; playlist->type = strdup("PLS"); - return 1; + return mmk; } } } } } - return 0; + return NULL; } -static int guess_xmms_playlist_m3u(playlist_t *playlist, char *filename) { - char *extension; +static mediamark_t **guess_xmms_playlist_m3u(playlist_t *playlist, char *filename) { + mediamark_t **mmk = NULL; + char *extension; if(filename) { if(playlist_check_for_file(filename)) { @@ -191,12 +219,11 @@ entries_pls++; if(entries_pls == 1) - playlist->playlist = (char **) xine_xmalloc(sizeof(char *) * 2); + mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); else - playlist->playlist = (char **) - realloc(playlist->playlist, (sizeof(char *) * (entries_pls + 1))); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); - playlist->playlist[(entries_pls - 1)] = strdup(playlist->ln); + _playlist_store_mmk(&mmk[(entries_pls - 1)], playlist->ln, NULL, 0, -1); playlist->entries = entries_pls; } @@ -217,19 +244,20 @@ fclose(playlist->fd); if(valid_pls && entries_pls) { - playlist->playlist[entries_pls] = NULL; + mmk[entries_pls] = NULL; playlist->type = strdup("M3U"); - return 1; + return mmk; } } } } } - return 0; + return NULL; } -static int guess_xmms_playlist(playlist_t *playlist, char *filename) { +static mediamark_t **guess_xmms_playlist(playlist_t *playlist, char *filename) { + mediamark_t **mmk = NULL; if(filename) { if(playlist_check_for_file(filename)) { @@ -249,14 +277,13 @@ entries_pls++; if(entries_pls == 1) - playlist->playlist = (char **) xine_xmalloc(sizeof(char *) * 2); + mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); else - playlist->playlist = (char **) - realloc(playlist->playlist, (sizeof(char *) * (entries_pls + 1))); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); - playlist->playlist[(entries_pls - 1)] = strdup(playlist->ln); + _playlist_store_mmk(&mmk[(entries_pls - 1)], playlist->ln, NULL, 0, -1); playlist->entries = entries_pls; - + } } @@ -268,19 +295,20 @@ fclose(playlist->fd); if(valid_pls && entries_pls) { - playlist->playlist[entries_pls] = NULL; + mmk[entries_pls] = NULL; playlist->type = strdup("XMMS"); - return 1; + return mmk; } } } } - return 0; + return NULL; } -static int guess_sfv_playlist(playlist_t *playlist, char *filename) { - char *extension; +static mediamark_t **guess_sfv_playlist(playlist_t *playlist, char *filename) { + mediamark_t **mmk = NULL; + char *extension; if(filename) { if(playlist_check_for_file(filename)) { @@ -308,14 +336,13 @@ entries_pls++; if(entries_pls == 1) - playlist->playlist = (char **) xine_xmalloc(sizeof(char *) * 2); + mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); else - playlist->playlist = (char **) - realloc(playlist->playlist, (sizeof(char *) * (entries_pls + 1))); - - playlist->playlist[(entries_pls - 1)] = strdup(entry); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + + _playlist_store_mmk(&mmk[(entries_pls - 1)], entry, NULL, 0, -1); playlist->entries = entries_pls; - + } } } @@ -326,9 +353,6 @@ char fn[_PATH_MAX + _NAME_MAX + 1]; int n, t; - /* - ; 28866404 23:20.36 2002-01-22 113-DearDoctor[1of5].mpg - */ if((sscanf(playlist->ln, ";%ld %d:%d.%d %d-%d-%d %s", &size, &h, &m, &s, &Y, &M, &D, &fn[0])) == 8) { char *p = playlist->ln; @@ -347,19 +371,20 @@ fclose(playlist->fd); if(valid_pls && entries_pls) { - playlist->playlist[entries_pls] = NULL; + mmk[entries_pls] = NULL; playlist->type = strdup("SFV"); - return 1; + return mmk; } } } } } - return 0; + return NULL; } -static int guess_raw_playlist(playlist_t *playlist, char *filename) { +static mediamark_t **guess_raw_playlist(playlist_t *playlist, char *filename) { + mediamark_t **mmk = NULL; if(filename) { if(playlist_check_for_file(filename)) { @@ -377,14 +402,13 @@ entries_pls++; if(entries_pls == 1) - playlist->playlist = (char **) xine_xmalloc(sizeof(char *) * 2); + mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); else - playlist->playlist = (char **) - realloc(playlist->playlist, (sizeof(char *) * (entries_pls + 1))); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); - playlist->playlist[(entries_pls - 1)] = strdup(playlist->ln); + _playlist_store_mmk(&mmk[(entries_pls - 1)], playlist->ln, NULL, 0, -1); playlist->entries = entries_pls; - + } } } @@ -392,23 +416,44 @@ fclose(playlist->fd); if(entries_pls) { - playlist->playlist[entries_pls] = NULL; + mmk[entries_pls] = NULL; playlist->type = strdup("RAW"); - return 1; + return mmk; } } } } - return 0; + return NULL; } + /* - * END OF: Playlists guessing + * Public */ +void playlist_add_entry(toxine_t *tox, char *mrl, char *ident, int start, int end) { + if(!tox->playlist.num) + tox->playlist.mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); + else + tox->playlist.mmk = (mediamark_t **) + realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 1)); + + if(_playlist_store_mmk(&tox->playlist.mmk[tox->playlist.num], mrl, ident, start, end)) + tox->playlist.num++; +} + +void playlist_free_entry(toxine_t *tox, int offset) { + + if(tox->playlist.num && (offset < tox->playlist.num)) { + if(_playlist_free_mmk(&tox->playlist.mmk[offset])) + tox->playlist.num--; + } +} void playlist_load(toxine_t *tox, char *filename) { playlist_t *playlist; - int i, found; + int i, found, onum; + mediamark_t **mmk = NULL; + mediamark_t **ommk; playlist_guess_func_t guess_functions[] = { guess_xmms_playlist_pls, guess_xmms_playlist_m3u, @@ -421,7 +466,7 @@ playlist = (playlist_t *) xine_xmalloc(sizeof(playlist_t)); for(i = 0, found = 0; (guess_functions[i] != NULL) && (found == 0); i++) { - if(guess_functions[i](playlist, filename)) + if((mmk = guess_functions[i](playlist, filename)) != NULL) found = 1; } @@ -434,18 +479,18 @@ return; } - /* printf("playlist type '%s'\n", playlist->type); */ - /* printf("playlist entries %d\n", playlist->entries); */ - for(i = 0; i < playlist->entries; i++) { - /* printf("playlist%d='%s'\n", i+1, playlist->playlist[i]); */ - tox->playlist.entries[tox->playlist.num++] = strdup(playlist->playlist[i]); - } + ommk = tox->playlist.mmk; + onum = tox->playlist.num; - for(i = 0; i < playlist->entries; i++) { - _FREE(playlist->playlist[i]); - } - - _FREE(playlist->playlist); + tox->playlist.mmk = mmk; + tox->playlist.num = playlist->entries; + tox->playlist.cur = -1; + + for(i = 0; i < onum; i++) + (void) _playlist_free_mmk(&ommk[i]); + + _FREE(ommk); + _FREE(playlist->type); _FREE(playlist); } @@ -475,11 +520,18 @@ FILE *fd; if((fd = fopen(filename, "w")) != NULL) { - + +#warning implement loader fprintf(fd, "; toxine playlist\n"); - for(i = 0; i < tox->playlist.num; i++) - fprintf(fd, "%s\n", tox->playlist.entries[i]); + for(i = 0; i < tox->playlist.num; i++) { + fprintf(fd, "\nentry {\n"); + fprintf(fd, " identifier = %s\n", tox->playlist.mmk[i]->ident); + fprintf(fd, " mrl = %s\n", tox->playlist.mmk[i]->mrl); + fprintf(fd, " start = %d\n", tox->playlist.mmk[i]->start); + fprintf(fd, " end = %d\n", tox->playlist.mmk[i]->end); + fprintf(fd,"}\n"); + } fprintf(fd, "; END\n"); Index: playlist.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- playlist.h 8 Jul 2002 12:54:48 -0000 1.1 +++ playlist.h 18 Jul 2002 22:19:30 -0000 1.2 @@ -22,6 +22,9 @@ #include "common.h" +void playlist_add_entry(toxine_t *tox, char *mrl, char *ident, int start, int end); +void playlist_free_entry(toxine_t *tox, int offset); + void playlist_load(toxine_t *tox, char *filename); void playlist_save(toxine_t *tox, char *filename); Index: utils.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- utils.c 8 Jul 2002 13:59:00 -0000 1.4 +++ utils.c 18 Jul 2002 22:19:30 -0000 1.5 @@ -36,6 +36,7 @@ extern int errno; #include "common.h" +#include "playlist.h" extern prompt_state_t prompt_state[]; @@ -160,8 +161,6 @@ memset(tox->command.line, 0, sizeof(tox->command.line)); sprintf(tox->command.line, "%s", line); - // if(tox->command.remain) - // _FREE(tox->command.remain); } } @@ -173,7 +172,7 @@ if(tox->playlist.num) { for(i = 0; i < tox->playlist.num; i++) { - if(!strcmp(mrl, tox->playlist.entries[i])) + if(!strcmp(mrl, tox->playlist.mmk[i]->mrl)) return i; } } @@ -186,10 +185,15 @@ */ void toxine_set_current_mrl_from_cur(toxine_t *tox) { if(tox) { - if((tox->playlist.cur >= 0) && (tox->playlist.entries[tox->playlist.cur] != NULL)) - tox->current_mrl = tox->playlist.entries[tox->playlist.cur]; - else + if((tox->playlist.cur >= 0) + && tox->playlist.mmk + && tox->playlist.mmk[tox->playlist.cur] + && (tox->playlist.mmk[tox->playlist.cur]->mrl != NULL)) + tox->current_mrl = tox->playlist.mmk[tox->playlist.cur]->mrl; + else { tox->current_mrl = NULL; + tox->playlist.cur = -1; + } } } @@ -204,8 +208,8 @@ expanded_mrl = tilde_expand(mrl); - tox->playlist.cur = tox->playlist.num++; - tox->playlist.entries[tox->playlist.cur] = strdup(expanded_mrl); + playlist_add_entry(tox, expanded_mrl, NULL, 0, -1); + tox->playlist.cur = tox->playlist.num; free(expanded_mrl); } @@ -223,7 +227,7 @@ if(tox->playlist.cur >= (tox->playlist.num - 1)) return NULL; - return tox->playlist.entries[tox->playlist.cur + 1]; + return tox->playlist.mmk[tox->playlist.cur + 1]->mrl; } return NULL; Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- xine_commands.c 17 Jul 2002 22:08:37 -0000 1.9 +++ xine_commands.c 18 Jul 2002 22:19:30 -0000 1.10 @@ -517,7 +517,6 @@ pthread_mutex_init(&tox->event.mutex, NULL); pinfo("xine_register_event_listener()\n"); xine_register_event_listener(tox->xine, toxine_event_listener, (void *) tox); - pinfo(".\n"); } |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-17 22:08:40
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv18165 Modified Files: xine_commands.c xine_commands.h Log Message: Sync to xine's API (get_input_plugin_caps). Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- xine_commands.c 14 Jul 2002 14:29:36 -0000 1.8 +++ xine_commands.c 17 Jul 2002 22:08:37 -0000 1.9 @@ -74,6 +74,26 @@ { NULL, 0 } }; + +static struct input_caps_s { + char *name; + uint32_t cap; +} input_caps[] = { + { "INPUT_CAP_NOCAP", INPUT_CAP_NOCAP }, + { "INPUT_CAP_SEEKABLE", INPUT_CAP_SEEKABLE }, + { "INPUT_CAP_BLOCK", INPUT_CAP_BLOCK }, + { "INPUT_CAP_AUTOPLAY", INPUT_CAP_AUTOPLAY }, + { "INPUT_CAP_GET_DIR", INPUT_CAP_GET_DIR }, + { "INPUT_CAP_BROWSABLE", INPUT_CAP_BROWSABLE }, + { "INPUT_CAP_CLUT", INPUT_CAP_CLUT }, + { "INPUT_CAP_AUDIOLANG", INPUT_CAP_AUDIOLANG }, + { "INPUT_CAP_SPULANG", INPUT_CAP_SPULANG }, + { "INPUT_CAP_VARIABLE_BITRATE", INPUT_CAP_VARIABLE_BITRATE }, + { "INPUT_CAP_PREVIEW", INPUT_CAP_PREVIEW }, + { "INPUT_CAP_CHAPTERS", INPUT_CAP_CHAPTERS }, + { NULL, 0 } +}; + static struct video_props_s { char *name; int prop; @@ -1423,6 +1443,26 @@ } } } + + +void _xine_get_input_plugin_capabilities(commands_t *command, toxine_t *tox, void *data) { + uint32_t caps; + int i; + + CHECK_XINE(tox); + + pinfo("xine_get_input_plugin_capabilities():\n"); + caps = xine_get_input_plugin_capabilities(tox->xine); + pinfo("capabilities (0x%x):\n", caps); + + for(i = 0; input_caps[i].name != NULL; i++) { + if(caps & input_caps[i].cap) + pinfo("%s\n", input_caps[i].name); + } + + pinfo(".\n"); +} + /* * xine-utils Index: xine_commands.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- xine_commands.h 13 Jul 2002 22:18:34 -0000 1.4 +++ xine_commands.h 17 Jul 2002 22:08:37 -0000 1.5 @@ -57,6 +57,7 @@ void _xine_list_audio_output_plugins(commands_t *, toxine_t *, void *); void _xine_send_event(commands_t *, toxine_t *, void *); void _config(commands_t *, toxine_t *, void *); +void _xine_get_input_plugin_capabilities(commands_t *, toxine_t *, void *); void _xine_usec_sleep(commands_t *, toxine_t *, void *); @@ -142,20 +143,20 @@ "xine_set_audio_property <property> <value>\n" \ " - property can be: [AO_PROP_MIXER_VOL | AO_PROP_PCM_VOL | AO_PROP_MUTE_VOL]\n" \ "xine_set_audio_property volume <level>\n" \ - "xine_set_audio_property mute", \ + "xine_set_audio_property mute" \ }, \ { "xine_get_audio_capabilities", NO_ARGS, _xine_get_audio_capabilities, \ "Get audio driver capabilities", \ - "xine_get_audio_capabilities", \ + "xine_get_audio_capabilities" \ }, \ { "xine_get_audio_property", REQUIRE_ARGS, _xine_get_audio_property, \ "Get an audio property", \ "xine_get_audio_property <property>\n" \ - " - property can be: [AO_PROP_MIXER_VOL | AO_PROP_PCM_VOL | AO_PROP_MUTE_VOL]", \ + " - property can be: [AO_PROP_MIXER_VOL | AO_PROP_PCM_VOL | AO_PROP_MUTE_VOL]" \ }, \ { "xine_get_video_capabilities", NO_ARGS, _NAPI_xine_get_video_capabilities, \ "Get video driver capabilities", \ - "xine_get_video_capabilities", \ + "xine_get_video_capabilities" \ }, \ { "xine_set_video_property", REQUIRE_ARGS, _NAPI_xine_set_video_property, \ "Set a video property to a value", \ @@ -164,7 +165,7 @@ " [VO_PROP_INTERLACED | VO_PROP_ASPECT_RATIO | VO_PROP_HUE |\n" \ " VO_PROP_SATURATION | VO_PROP_CONTRAST | VO_PROP_BRIGHTNESS |\n" \ " VO_PROP_COLORKEY | VO_PROP_AUTOPAINT_COLORKEY | VO_PROP_ZOOM_FACTOR |\n" \ - " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]", \ + " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]" \ }, \ { "xine_get_video_property", REQUIRE_ARGS, _NAPI_xine_get_video_property, \ "Get a video property", \ @@ -173,7 +174,7 @@ " [VO_PROP_INTERLACED | VO_PROP_ASPECT_RATIO | VO_PROP_HUE |\n" \ " VO_PROP_SATURATION | VO_PROP_CONTRAST | VO_PROP_BRIGHTNESS |\n" \ " VO_PROP_COLORKEY | VO_PROP_AUTOPAINT_COLORKEY | VO_PROP_ZOOM_FACTOR |\n" \ - " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]", \ + " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]" \ }, \ { "xine_get_video_property_min_max", REQUIRE_ARGS, _NAPI_xine_get_video_property_min_max, \ "Get a video property min and max values", \ @@ -182,7 +183,7 @@ " [VO_PROP_INTERLACED | VO_PROP_ASPECT_RATIO | VO_PROP_HUE |\n" \ " VO_PROP_SATURATION | VO_PROP_CONTRAST | VO_PROP_BRIGHTNESS |\n" \ " VO_PROP_COLORKEY | VO_PROP_AUTOPAINT_COLORKEY | VO_PROP_ZOOM_FACTOR |\n" \ - " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]", \ + " VO_PROP_PAN_SCAN | VO_PROP_TVMODE]" \ }, \ { "xine_check_version", REQUIRE_ARGS, _xine_check_version, \ "Compare version numbers with xine installed version.", \ @@ -190,51 +191,51 @@ }, \ { "xine_get_av_offset", NO_ARGS, _xine_get_av_offset, \ "Return the current audio/video sync offset.", \ - "xine_get_av_offset", \ + "xine_get_av_offset" \ }, \ { "xine_set_av_offset", REQUIRE_ARGS, _xine_set_av_offset, \ "Set audio/video sync offset, according to offset pts value.", \ - "xine_set_av_offset <offset pts>", \ + "xine_set_av_offset <offset pts>" \ }, \ { "xine_eject", NO_ARGS, _xine_eject, \ "Tell current input plugin to eject media.", \ - "xine_eject", \ + "xine_eject" \ }, \ { "xine_get_status", NO_ARGS, _xine_get_status, \ "Return the current state of xine engine.", \ - "xine_get_status", \ + "xine_get_status" \ }, \ { "xine_get_current_position", NO_ARGS, _xine_get_current_position, \ "Get current position in stream.", \ - "xine_get_current_position", \ + "xine_get_current_position" \ }, \ { "xine_get_current_time", NO_ARGS, _xine_get_current_time, \ "Get current position measured in seconds from the beginning of the stream.", \ - "xine_get_current_time", \ + "xine_get_current_time" \ }, \ { "xine_get_stream_length", NO_ARGS, _xine_get_stream_length, \ "Estimate length of input stream in seconds.", \ - "xine_get_stream_length", \ + "xine_get_stream_length" \ }, \ { "xine_is_stream_seekable", NO_ARGS, _xine_is_stream_seekable, \ "check if the stream is seekable.", \ - "xine_is_stream_seekable", \ + "xine_is_stream_seekable" \ }, \ { "xine_get_browsable_input_plugin_ids", NO_ARGS, _xine_get_browsable_input_plugin_ids, \ "Get list of browsable input plugins.", \ - "xine_get_browsable_input_plugin_ids", \ + "xine_get_browsable_input_plugin_ids" \ }, \ { "xine_get_autoplay_input_plugin_ids", NO_ARGS, _xine_get_autoplay_input_plugin_ids, \ "Get list of autoplay input plugins identifiers.", \ - "xine_get_autoplay_input_plugin_ids", \ + "xine_get_autoplay_input_plugin_ids" \ }, \ { "xine_get_input_plugin_description", REQUIRE_ARGS, _xine_get_input_plugin_description, \ "Description string.", \ - "xine_get_input_plugin_description <plugin id>", \ + "xine_get_input_plugin_description <plugin id>" \ }, \ { "xine_get_autoplay_mrls", REQUIRE_ARGS, _xine_get_autoplay_mrls, \ "Get autoplay MRL list from an input plugin.", \ - "xine_get_autoplay_mrls <plugin id>", \ + "xine_get_autoplay_mrls <plugin id>" \ }, \ { "xine_get_browse_mrls", REQUIRE_ARGS, _xine_get_browse_mrls, \ "Asks input plugin named <plugin_id> to return\n" \ @@ -242,17 +243,17 @@ "<start_mrl> may be NULL indicating the toplevel domain/dir\n" \ "returns <start_mrl> if <start_mrl> is a valid MRL, not a directory\n" \ "returns NULL if <start_mrl> is an invalid MRL, not even a directory.", \ - "xine_get_browse_mrls <plugin id> [start mrl | NULL]", \ + "xine_get_browse_mrls <plugin id> [start mrl | NULL]" \ }, \ { "xine_list_video_output_plugins", OPTIONAL_ARGS, _xine_list_video_output_plugins, \ "List video output plugin installed.", \ "xine_list_video_output_plugins [visual type]\n" \ "visual can be: [VISUAL_TYPE_X11 | VISUAL_TYPE_AA | VISUAL_TYPE_FB |\n" \ - " VISUAL_TYPE_GTK | VISUAL_TYPE_DFB]", \ + " VISUAL_TYPE_GTK | VISUAL_TYPE_DFB]" \ }, \ { "xine_list_audio_output_plugins", NO_ARGS, _xine_list_audio_output_plugins, \ "Get a list of available audio output plugins.", \ - "xine_list_audio_output_plugins", \ + "xine_list_audio_output_plugins" \ }, \ { "xine_send_event", REQUIRE_ARGS, _xine_send_event, \ "Send an event to the engine.", \ @@ -268,14 +269,18 @@ " XINE_EVENT_INPUT_PREVIOUS | XINE_EVENT_INPUT_ANGLE_NEXT | \n" \ " XINE_EVENT_INPUT_ANGLE_PREVIOUS | XINE_EVENT_SPU_FORCEDISPLAY | \n" \ " XINE_EVENT_FRAME_CHANGE | XINE_EVENT_CLOSED_CAPTION | \n" \ - " XINE_EVENT_INPUT_BUTTON_FORCE]", \ + " XINE_EVENT_INPUT_BUTTON_FORCE]" \ }, \ { "config", REQUIRE_ARGS, _config, \ - "manage xine's config stuff.", \ + "Manage xine's config stuff.", \ "config read <filename>\n" \ "config save\n" \ "config lookup <key>\n" \ - "config dump", \ + "config dump" \ + }, \ + { "xine_get_input_plugin_capabilities", NO_ARGS, _xine_get_input_plugin_capabilities, \ + "Request input plugin capabilities.", \ + "xine_get_input_plugin_capabilities" \ }, \ { "xine_usec_sleep", REQUIRE_ARGS, _xine_usec_sleep, \ "Sleep some µ seconds", \ |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-16 09:15:31
|
Update of /cvsroot/toxine/toxine/doc/man/en In directory usw-pr-cvs1:/tmp/cvs-serv5480/doc/man/en Modified Files: toxine.1 Log Message: Fix a segfault at exit time. 'set' don't display settings anymore, instead 'display settings' do a better job. Index: toxine.1 =================================================================== RCS file: /cvsroot/toxine/toxine/doc/man/en/toxine.1,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- toxine.1 14 Jul 2002 14:29:36 -0000 1.8 +++ toxine.1 16 Jul 2002 09:15:28 -0000 1.9 @@ -1,7 +1,7 @@ .\" -*-Nroff-*- .\"" .\"" -.TH TOXINE 1x 2002-07-14 "toxine" +.TH TOXINE 1x 2002-07-16 "toxine" .SH NAME toxine \- a text program, using xine library. .SH SYNOPSIS @@ -577,6 +577,8 @@ \ \ display current position .br \ \ display current time +.br +\ \ display settings .br .br .TP |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-16 09:15:31
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv5480/src Modified Files: commands.c main.c Log Message: Fix a segfault at exit time. 'set' don't display settings anymore, instead 'display settings' do a better job. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- commands.c 14 Jul 2002 18:31:24 -0000 1.18 +++ commands.c 16 Jul 2002 09:15:28 -0000 1.19 @@ -293,7 +293,8 @@ { "display", REQUIRE_ARGS, do_display, "Display some status", "display current position\n" - "display current time" + "display current time\n" + "display settings" }, { "version", NO_ARGS, do_version, "Display some version informations", @@ -1012,15 +1013,6 @@ } } } - else { - /* Display settings */ - pinfo("current settings:\n"); - pinfo("current video driver name: %s\n", (tox->video.name)?tox->video.name:"not set"); - pinfo("current audio driver name: %s\n", (tox->audio.name)?tox->audio.name:"not set"); - pinfo("interactive mode: %s\n", (tox->interactive)?"yes":"no"); - pinfo("current mrl: %s\n", (tox->current_mrl)?tox->current_mrl:"not set"); - pinfo("more comming soon.\n"); - } } @@ -1632,7 +1624,44 @@ nargs = toxine_is_args(tox); - if(nargs >= 2) { + if(nargs == 1) { + if(toxine_is_arg_contain(tox, 1, "settings")) { + + pinfo("Current settings:\n"); + pinfo("-----------------\n"); + pinfo("\n"); + pinfo(" Xine engine:\n"); + pinfo(" initialized: '%s'\n", (tox->xine) ? "YES" : "NO"); + pinfo("\n"); + pinfo(" Video:\n"); + pinfo(" number of toxine plugins: '%d'\n", tox->video.plugins_num); + pinfo(" driver name: '%s'\n", (tox->video.name) ? tox->video.name : "not set"); + pinfo(" spu channel: '%d'\n", tox->video.spu_channel); + pinfo("\n"); + pinfo(" Audio:\n"); + pinfo(" driver name: '%s'\n", (tox->audio.name) ? tox->audio.name : "not set"); + pinfo(" capabilities: '0x%x\n", tox->audio.mixer.caps); + pinfo(" mixer enabled: '%s'\n", (tox->audio.mixer.enable) ? "YES" : "NO"); + pinfo(" channel: '%d'\n", tox->audio.channel); + pinfo(" volume: '%d'\n", tox->audio.mixer.volume_level); + pinfo(" mute: '%s'\n", (tox->audio.mixer.mute) ? "ON" : "OFF"); + pinfo("\n"); + pinfo(" Toxine:\n"); + pinfo(" interactive mode: '%s'\n", (tox->interactive) ? "YES" : "NO"); + pinfo(" mrl: '%s'\n", (tox->current_mrl) ? tox->current_mrl : "not set"); + pinfo(" ignore finished: '%d'\n", tox->ignore_finished); + pinfo(" Playlist:\n"); + pinfo(" number of entries: '%d'\n", tox->playlist.num); + pinfo(" current: '%d'\n", tox->playlist.cur); + pinfo(" loop: '%s'\n", (tox->playlist.loop == PLAYLIST_LOOP) ? "YES" : "NO"); + pinfo(" Script:\n"); + pinfo(" in use: '%s'\n", (tox->script.in_use) ? "YES" : "NO"); + pinfo(" file: '%s'\n", (tox->script.filename) ? tox->script.filename : "not set"); + pinfo(".\n"); + + } + } + else if(nargs >= 2) { if(toxine_is_arg_contain(tox, 1, "current")) { if(toxine_is_arg_contain(tox, 2, "position")) { float position; Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- main.c 11 Jul 2002 20:30:45 -0000 1.7 +++ main.c 16 Jul 2002 09:15:28 -0000 1.8 @@ -121,7 +121,6 @@ for(i = 0; i < 256; i++) _FREE(tox->command.args[i]); - _FREE(tox->current_mrl); _FREE(tox->script.filename); pthread_mutex_destroy(&tox->event.mutex); |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-16 09:15:31
|
Update of /cvsroot/toxine/toxine/readline In directory usw-pr-cvs1:/tmp/cvs-serv5480/readline Modified Files: bind.c complete.c histexpand.c input.c rltty.c tilde.c Log Message: Fix a segfault at exit time. 'set' don't display settings anymore, instead 'display settings' do a better job. Index: bind.c =================================================================== RCS file: /cvsroot/toxine/toxine/readline/bind.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bind.c 13 May 2002 20:46:09 -0000 1.1.1.1 +++ bind.c 16 Jul 2002 09:15:28 -0000 1.2 @@ -316,7 +316,7 @@ { register int i, c, l, temp; - for (i = l = 0; c = seq[i]; i++) + for (i = l = 0; (c = seq[i]); i++) { if (c == '\\') { @@ -1027,8 +1027,8 @@ if (*string == '"') { int passc = 0; - - for (i = 1; c = string[i]; i++) + + for (i = 1; (c = string[i]); i++) { if (passc) { @@ -1104,7 +1104,7 @@ { int delimiter = string[i++], passc; - for (passc = 0; c = string[i]; i++) + for (passc = 0; (c = string[i]); i++) { if (passc) { @@ -1842,7 +1842,7 @@ fprintf (rl_outstream, "\n"); - for (i = 0; name = names[i]; i++) + for (i = 0; (name = names[i]); i++) { rl_command_func_t *function; char **invokers; Index: complete.c =================================================================== RCS file: /cvsroot/toxine/toxine/readline/complete.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- complete.c 13 May 2002 20:46:04 -0000 1.1.1.1 +++ complete.c 16 Jul 2002 09:15:28 -0000 1.2 @@ -1428,7 +1428,7 @@ match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); match_list[1] = (char *)NULL; - while (string = (*entry_function) (text, matches)) + while ((string = (*entry_function) (text, matches))) { if (matches + 1 == match_list_size) match_list = (char **)xrealloc @@ -1478,7 +1478,7 @@ setpwent (); } - while (entry = getpwent ()) + while ((entry = getpwent ())) { /* Null usernames should result in all users as possible completions. */ if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) Index: histexpand.c =================================================================== RCS file: /cvsroot/toxine/toxine/readline/histexpand.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- histexpand.c 13 May 2002 20:46:24 -0000 1.1.1.1 +++ histexpand.c 16 Jul 2002 09:15:28 -0000 1.2 @@ -203,7 +203,7 @@ } /* Only a closing `?' or a newline delimit a substring search string. */ - for (local_index = i; c = string[i]; i++) + for (local_index = i; (c = string[i]); i++) if ((!substring_okay && (whitespace (c) || c == ':' || (history_search_delimiter_chars && member (c, history_search_delimiter_chars)) || string[i] == delimiting_quote)) || Index: input.c =================================================================== RCS file: /cvsroot/toxine/toxine/readline/input.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- input.c 13 May 2002 20:46:19 -0000 1.1.1.1 +++ input.c 16 Jul 2002 09:15:28 -0000 1.2 @@ -364,7 +364,7 @@ else { /* If input is coming from a macro, then use that. */ - if (c = _rl_next_macro_key ()) + if ((c = _rl_next_macro_key ())) return (c); /* If the user has an event function, then call it periodically. */ Index: rltty.c =================================================================== RCS file: /cvsroot/toxine/toxine/readline/rltty.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- rltty.c 13 May 2002 20:46:00 -0000 1.1.1.1 +++ rltty.c 16 Jul 2002 09:15:28 -0000 1.2 @@ -647,7 +647,7 @@ if (get_tty_settings (tty, &tio) < 0) { release_sigint (); -fprintf(stderr, "readline: warning: rl_prep_terminal: cannot get terminal settings"); + fprintf(stderr, "readline: warning: rl_prep_terminal: cannot get terminal settings"); return; } Index: tilde.c =================================================================== RCS file: /cvsroot/toxine/toxine/readline/tilde.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- tilde.c 13 May 2002 20:46:28 -0000 1.1.1.1 +++ tilde.c 16 Jul 2002 09:15:28 -0000 1.2 @@ -193,7 +193,7 @@ int result_size, result_index; result_index = result_size = 0; - if (result = strchr (string, '~')) + if ((result = strchr (string, '~'))) result = (char *)xmalloc (result_size = (strlen (string) + 16)); else result = (char *)xmalloc (result_size = (strlen (string) + 1)); |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-15 22:41:44
|
Update of /cvsroot/toxine/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv7307 Modified Files: links.html Log Message: Fix logo. Index: links.html =================================================================== RCS file: /cvsroot/toxine/htdocs/links.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- links.html 15 Jul 2002 14:39:14 -0000 1.2 +++ links.html 15 Jul 2002 22:41:41 -0000 1.3 @@ -3,40 +3,43 @@ <head> <title>links</title> - + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <meta name="author" content="Daniel Caujolle-Bert"> + <meta name="description" content="link frame"> </head> <body background="bg.jpg" bgcolor="#ffffff" text="#000000" link="#99ff99" vlink="#ffcccc" alink="#33ff33"> - + <div align="center"><a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=53365&type=5" width="110" height="35" border="0" alt="SourceForge Logo"> - <br> - <br> - </a></div> - -<div align="left"> -<address><a href="http://toxine.sourceforge.net/main.html" target="main"> Home Page</a></address> - -<address><a href="http://www.sf.net/projects/toxine" target="main"> Project -Page</a></address> - + </a></div> + +<div align="left"> +<address><a href="http://toxine.sourceforge.net/main.html" target="main"><br> + <br> + <br> + Home Page</a></address> + +<address><a href="http://www.sourceforge.net/projects/toxine" + target="main">Project Page</a></address> + <address> <a href="http://prdownloads.sourceforge.net/toxine/toxine-0.5.0.tar.gz?download" - target="main"> Download</a></address> - -<address><u><a href="http://toxine.sf.net/screenshots.html" - target="main"> Screenshots</a></u></address> - + target="main">Download</a></address> + +<address><u><a href="http://toxine.sourceforge.net/screenshots.html" + target="main">Screenshots</a></u></address> + <address><u><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/toxine/" - target="main"> Browse CVS</a></u></address> - <br> - </div> - + target="main">Browse CVS</a></u></address> + <br> + </div> + </body> </html> |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-15 14:39:17
|
Update of /cvsroot/toxine/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv7281 Modified Files: links.html Log Message: URL bug. Index: links.html =================================================================== RCS file: /cvsroot/toxine/htdocs/links.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- links.html 15 Jul 2002 14:36:45 -0000 1.1 +++ links.html 15 Jul 2002 14:39:14 -0000 1.2 @@ -20,7 +20,7 @@ </a></div> <div align="left"> -<address><a href="http://toxine.sourceforge.net" target="main"> Home Page</a></address> +<address><a href="http://toxine.sourceforge.net/main.html" target="main"> Home Page</a></address> <address><a href="http://www.sf.net/projects/toxine" target="main"> Project Page</a></address> |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-15 14:36:48
|
Update of /cvsroot/toxine/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv6414 Modified Files: index.html Added Files: bg.jpg links.html main.html screenshots.html Log Message: Site pages update. --- NEW FILE: bg.jpg --- ÿØÿà $.' ",#(7),01444'9=82<.342ÿÛ P ¬ ° , °` --- NEW FILE: links.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>links</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <meta name="author" content="Daniel Caujolle-Bert"> <meta name="description" content="link frame"> </head> <body background="bg.jpg" bgcolor="#ffffff" text="#000000" link="#99ff99" vlink="#ffcccc" alink="#33ff33"> <div align="center"><a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=53365&type=5" width="110" height="35" border="0" alt="SourceForge Logo"> <br> <br> </a></div> <div align="left"> <address><a href="http://toxine.sourceforge.net" target="main"> Home Page</a></address> <address><a href="http://www.sf.net/projects/toxine" target="main"> Project Page</a></address> <address> <a href="http://prdownloads.sourceforge.net/toxine/toxine-0.5.0.tar.gz?download" target="main"> Download</a></address> <address><u><a href="http://toxine.sf.net/screenshots.html" target="main"> Screenshots</a></u></address> <address><u><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/toxine/" target="main"> Browse CVS</a></u></address> <br> </div> </body> </html> --- NEW FILE: main.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Main</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <meta name="author" content="Daniel Caujolle-Bert"> <meta name="description" content="main frame"> </head> <body background="bg.jpg" bgcolor="#ffffff" text="#000000" link="#99ff99" vlink="#ffcccc" alink="#33ff33"> <h1 align="center"><font color="#ff0000"><b>TOXINE</b></font></h1> <div align="justify"> <blockquote><font color="#ffff00">Toxine is a text user interface using the xine library. It permit to playback all streams that xine supports, in interactive or in script mode (using toxine syntax). It use xine's visualisation plugins (AAlib, X11, DXR3/HW+), and/or his own 'none' one (audio only output).<br> </font> </blockquote> </div> <blockquote> <div align="justify"><font color="#ffff00">It use the readline library, which permit, in interactive mode, to recall commands, completions, etc..<br> <br> You can use it in a console (useful for DXR3/HW+ owners, using TV output), or in a X11 terminal window.<br> If you're a developper, and you want to test/debug your own plugins, using toxine is useful due of script usage. This way, you can reproduce actions without interactions, redirect outputs to a file (name given or not). You can also see how to implement your own xine library frontend, because toxine implement almost all xine's API calls.<br> <br> If you don't like GUIs, or love console (and AAlib video output), toxine is for you ;-)</font> <br> </div> </blockquote> <hr width="100%" size="2" dir="ltr"> <h5><font color="#ffffff">(c) Daniel Caujolle-Bert, 15-07-2002 <a href="mailto:f1...@us...">f1rmb</a></font></h5> </body> </html> --- NEW FILE: screenshots.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Main</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body background="bg.jpg" bgcolor="#ffffff" text="#000000" link="#99ff99" vlink="#ffcccc" alink="#33ff33"> <h1 align="center"><font color="#ff0000"><b>TOXINE Screenshots</b></font></h1> <br> <font color="#ffff00">Coming soon...<br> <br> </font><br> </body> </html> Index: index.html =================================================================== RCS file: /cvsroot/toxine/htdocs/index.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- index.html 5 Jul 2002 14:06:55 -0000 1.1.1.1 +++ index.html 15 Jul 2002 14:36:45 -0000 1.2 @@ -1,11 +1,12 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - <title>Toxine project</title> + <title>Toxine's homepage</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> -<body> -<a href="http://www.sourceforge.net/projects/toxine">Project Page</a> -</body> +<frameset cols="14%,*"> +<frame src="links.html" name="links" noresize> +<frame src="main.html" name="main" noresize> +</frameset> </html> |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 18:56:36
|
Update of /cvsroot/toxine/toxine In directory usw-pr-cvs1:/tmp/cvs-serv11565 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/toxine/toxine/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ChangeLog 14 Jul 2002 18:53:43 -0000 1.6 +++ ChangeLog 14 Jul 2002 18:56:33 -0000 1.7 @@ -1,3 +1,7 @@ +2002-07-14 Sunday 20:53 f1rmb + + 0.5.0 release. + 2002-07-14 Sunday 20:25 f1rmb Use readline calls to know screen width. |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 18:53:46
|
Update of /cvsroot/toxine/toxine In directory usw-pr-cvs1:/tmp/cvs-serv10947 Modified Files: ChangeLog configure.in Log Message: 0.5.0 release. Index: ChangeLog =================================================================== RCS file: /cvsroot/toxine/toxine/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ChangeLog 9 Jul 2002 20:34:18 -0000 1.5 +++ ChangeLog 14 Jul 2002 18:53:43 -0000 1.6 @@ -1,3 +1,34 @@ +2002-07-14 Sunday 20:25 f1rmb + + Use readline calls to know screen width. + +2002-07-14 Sunday 16:29 f1rmb + + Add 'display' command. + +2002-07-14 Sunday 00:20 f1rmb + + Man page update. + +2002-07-14 Sunday 00:18 f1rmb + + Few xine's config management. vo_x11: screensaver fake key rate + value available through tox.fake_rate config key. + +2002-07-12 Friday 16:31 f1rmb + + Fix rpm build. + +2002-07-12 Friday 15:40 f1rmb + + Add video output plugin 'none', which display nothing, don't create + a window, etc... xine's 'none' plugin is provided (it's not part of + xine-lib, and i don't know if it will be). + +2002-07-11 Thursday 22:30 f1rmb + + Add playlist loop feature. + 2002-07-09 Tuesday 22:33 f1rmb Add ability to compile DXR3 plugin for xine-lib CVS version Index: configure.in =================================================================== RCS file: /cvsroot/toxine/toxine/configure.in,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- configure.in 12 Jul 2002 14:31:00 -0000 1.16 +++ configure.in 14 Jul 2002 18:53:43 -0000 1.17 @@ -17,7 +17,7 @@ dnl 0.2.0 was never released dnl switch directly to 0.3.0 since toxine have is own project site. TOXINE_MAJOR=0 -TOXINE_MINOR=4 +TOXINE_MINOR=5 TOXINE_SUB=0 TOXINE_PRE="`if test -f ./.cvsversion; then echo cvs;fi`" |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 18:31:27
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv4857 Modified Files: commands.c Log Message: Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- commands.c 14 Jul 2002 18:25:24 -0000 1.17 +++ commands.c 14 Jul 2002 18:31:24 -0000 1.18 @@ -1220,8 +1220,6 @@ int screen_rows, screen_cols; rl_get_screen_size(&screen_rows, &screen_cols); - printf("screen_rows %d\n", screen_rows); - printf("screen_cols %d\n", screen_cols); while(commands[i].command != NULL) { if(strlen(commands[i].command) > maxlen) |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 18:25:27
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv3578 Modified Files: commands.c Log Message: Use readline calls to know screen width. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- commands.c 14 Jul 2002 14:29:36 -0000 1.16 +++ commands.c 14 Jul 2002 18:25:24 -0000 1.17 @@ -1217,6 +1217,11 @@ int i = 0, j; int maxlen = 0; int curpos = 0; + int screen_rows, screen_cols; + + rl_get_screen_size(&screen_rows, &screen_cols); + printf("screen_rows %d\n", screen_rows); + printf("screen_cols %d\n", screen_cols); while(commands[i].command != NULL) { if(strlen(commands[i].command) > maxlen) @@ -1233,7 +1238,7 @@ while(commands[i].command != NULL) { - if((curpos + maxlen) >= 80) { + if((curpos + maxlen) >= screen_cols) { pout("\n"); poutalign(); curpos = strlen(EMPTY_PREFIX); @@ -1634,6 +1639,7 @@ if(toxine_is_arg_contain(tox, 2, "position")) { float position; int range, pos, i; + int screen_rows, screen_cols; CHECK_XINE(tox); @@ -1641,11 +1647,13 @@ pinfo("Current position: (%%%.2f) %d/65535\n", ((position / 65535) * 100.0), (int) position); - range = 65535 / 60; + rl_get_screen_size(&screen_rows, &screen_cols); + + range = 65535 / (screen_cols - 20); pos = position / range; pinfo("|"); - for(i = 0; i <= 60; i++) { + for(i = 0; i <= (screen_cols - 20); i++) { if(i == pos) { pout("*"); } |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 14:29:40
|
Update of /cvsroot/toxine/toxine/src/plugins In directory usw-pr-cvs1:/tmp/cvs-serv10363/src/plugins Modified Files: vo_x11.c Log Message: Add 'display' command. Index: vo_x11.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_x11.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- vo_x11.c 13 Jul 2002 22:18:35 -0000 1.10 +++ vo_x11.c 14 Jul 2002 14:29:37 -0000 1.11 @@ -308,7 +308,7 @@ update_cursor_visibility(tox); } - sleep(2); + sleep(1); } pthread_exit(NULL); |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 14:29:39
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv10363/src Modified Files: commands.c xine_commands.c Log Message: Add 'display' command. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- commands.c 11 Jul 2002 20:30:45 -0000 1.15 +++ commands.c 14 Jul 2002 14:29:36 -0000 1.16 @@ -122,6 +122,7 @@ static void do_waitfor(commands_t *, toxine_t *, void *); static void do_events(commands_t *, toxine_t *, void *); static void do_playlist(commands_t *, toxine_t *, void *); +static void do_display(commands_t *, toxine_t *, void *); static commands_t commands[] = { { "commands", NO_ARGS, do_help, @@ -289,6 +290,11 @@ "playlist save <filename>\n" "playlist loop [[yes | no | 1 | 0 | true | false] | [status]]" }, + { "display", REQUIRE_ARGS, do_display, + "Display some status", + "display current position\n" + "display current time" + }, { "version", NO_ARGS, do_version, "Display some version informations", "version" @@ -1613,6 +1619,53 @@ tox->playlist.loop = PLAYLIST_LOOP; break; } + } + } + } +} + +static void do_display(commands_t *command, toxine_t *tox, void *data) { + int nargs; + + nargs = toxine_is_args(tox); + + if(nargs >= 2) { + if(toxine_is_arg_contain(tox, 1, "current")) { + if(toxine_is_arg_contain(tox, 2, "position")) { + float position; + int range, pos, i; + + CHECK_XINE(tox); + + position = (int) xine_get_current_position(tox->xine); + pinfo("Current position: (%%%.2f) %d/65535\n", + ((position / 65535) * 100.0), (int) position); + + range = 65535 / 60; + pos = position / range; + + pinfo("|"); + for(i = 0; i <= 60; i++) { + if(i == pos) { + pout("*"); + } + else { + pout("-"); + } + } + pout("|\n"); + pinfo(".\n"); + + } + else if(toxine_is_arg_contain(tox, 2, "time")) { + int seconds; + + CHECK_XINE(tox); + + seconds = xine_get_current_time(tox->xine); + pinfo("Current time: %02d:%02d:%02d\n", + seconds / (60 * 60), (seconds / 60) % 60, seconds % 60); + } } } Index: xine_commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- xine_commands.c 13 Jul 2002 22:18:34 -0000 1.7 +++ xine_commands.c 14 Jul 2002 14:29:36 -0000 1.8 @@ -168,7 +168,7 @@ int i; pinfo(" entry->enum_values: "); for(i = 0; entry->enum_values[i]; i++) { - pinfo("'%s' ", entry->enum_values[i]); + pout("'%s' ", entry->enum_values[i]); } pinfo("\n"); } @@ -194,7 +194,7 @@ int i; pinfo(" entry->enum_values: "); for(i = 0; entry->enum_values[i]; i++) { - pinfo("'%s' ", entry->enum_values[i]); + pout("'%s' ", entry->enum_values[i]); } pinfo("\n"); } |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-14 14:29:39
|
Update of /cvsroot/toxine/toxine/doc/man/en In directory usw-pr-cvs1:/tmp/cvs-serv10363/doc/man/en Modified Files: toxine.1 Log Message: Add 'display' command. Index: toxine.1 =================================================================== RCS file: /cvsroot/toxine/toxine/doc/man/en/toxine.1,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- toxine.1 13 Jul 2002 22:20:06 -0000 1.7 +++ toxine.1 14 Jul 2002 14:29:36 -0000 1.8 @@ -565,6 +565,21 @@ .br .br .TP +.BR display +.br +.BR action: +.br +Display some status +.br + +.BR syntax: +.br +\ \ display current position +.br +\ \ display current time +.br +.br +.TP .BR version .br .BR action: |
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-13 22:20:09
|
Update of /cvsroot/toxine/toxine/doc/man/en In directory usw-pr-cvs1:/tmp/cvs-serv31591 Modified Files: toxine.1 Log Message: Man page update. Index: toxine.1 =================================================================== RCS file: /cvsroot/toxine/toxine/doc/man/en/toxine.1,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- toxine.1 11 Jul 2002 20:30:44 -0000 1.6 +++ toxine.1 13 Jul 2002 22:20:06 -0000 1.7 @@ -1,7 +1,7 @@ .\" -*-Nroff-*- .\"" .\"" -.TH TOXINE 1x 2002-07-11 "toxine" +.TH TOXINE 1x 2002-07-14 "toxine" .SH NAME toxine \- a text program, using xine library. .SH SYNOPSIS @@ -1137,6 +1137,25 @@ \ \ - event can be: .br \ \ [XINE_EVENT_MOUSE_BUTTON | XINE_EVENT_MOUSE_MOVE | XINE_EVENT_SPU_BUTTON | XINE_EVENT_SPU_CLUT | XINE_EVENT_UI_CHANNELS_CHANGED | XINE_EVENT_UI_SET_TITLE | XINE_EVENT_INPUT_MENU1 | XINE_EVENT_INPUT_MENU2 | XINE_EVENT_INPUT_MENU3 | XINE_EVENT_INPUT_UP | XINE_EVENT_INPUT_DOWN | XINE_EVENT_INPUT_LEFT | XINE_EVENT_INPUT_RIGHT | XINE_EVENT_INPUT_SELECT | XINE_EVENT_PLAYBACK_FINISHED | XINE_EVENT_BRANCHED | XINE_EVENT_NEED_NEXT_MRL | XINE_EVENT_INPUT_NEXT | XINE_EVENT_INPUT_PREVIOUS | XINE_EVENT_INPUT_ANGLE_NEXT | XINE_EVENT_INPUT_ANGLE_PREVIOUS | XINE_EVENT_SPU_FORCEDISPLAY | XINE_EVENT_FRAME_CHANGE | XINE_EVENT_CLOSED_CAPTION | XINE_EVENT_INPUT_BUTTON_FORCE] +.br +.br +.TP +.BR config +.br +.BR action: +.br +manage xine's config stuff. +.br + +.BR syntax: +.br +\ \ config read <filename> +.br +\ \ config save +.br +\ \ config lookup <key> +.br +\ \ config dump .br .br .TP |