From 6457aed01293cd00e9009692e0c5c9c7f09bc442 Mon Sep 17 00:00:00 2001 From: phintuka Date: Tue, 22 Aug 2006 08:32:38 +0000 Subject: Enable audio visualization plugins for file playback --- frontend.c | 6 +++--- xine_input_vdr.c | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/frontend.c b/frontend.c index 815b1ebd..3745e256 100644 --- a/frontend.c +++ b/frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.11 2006-08-22 03:45:34 phintuka Exp $ + * $Id: frontend.c,v 1.12 2006-08-22 08:32:38 phintuka Exp $ * */ @@ -494,8 +494,8 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, TRACEF("cXinelibThread::PlayFile"); char buf[2048]; m_bEndOfStreamReached = false; - sprintf(buf, "PLAYFILE %s %d %s\r\n", - LoopPlay ? "Loop" : "", Position, FileName ? FileName : ""); + sprintf(buf, "PLAYFILE %s %d %s %s\r\n", + LoopPlay ? "Loop" : "", Position, xc.audio_visualization, FileName ? FileName : ""); int result = PlayFileCtrl(buf); if(!FileName || result != 0) { diff --git a/xine_input_vdr.c b/xine_input_vdr.c index b7dd4d56..605c3a69 100644 --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.30 2006-08-22 04:02:18 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.31 2006-08-22 08:32:38 phintuka Exp $ * */ @@ -2183,7 +2183,7 @@ static void vdr_event_cb (void *user_data, const xine_event_t *event); static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) { const char *pt = cmd + 9; - char filename[1024]="", *subs = NULL; + char filename[1024]="", *subs = NULL, av[64], *pt2=av; int loop = 0, pos = 0, err = 0; while(*pt==' ') pt++; @@ -2199,11 +2199,17 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) while(*pt && *pt != ' ') pt++; while(*pt == ' ') pt++; + /* audio visualization */ + while(*pt && *pt != ' ') + *pt2++ = *pt++; + *pt2 = 0; + while(*pt == ' ') pt++; + strncpy(filename, pt, 1023); filename[1023] = 0; - LOGMSG("PLAYFILE (Loop: %d, Offset: %ds, File: %s)", - loop, pos, *filename ? filename : "" ); + LOGMSG("PLAYFILE (Loop: %d, Offset: %ds, File: %s %s)", + loop, pos, *filename ? av:"", *filename ? filename : ""); if(*filename) { this->loop_play = 0; @@ -2249,6 +2255,11 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) has_video = _x_stream_info_get(this->slave_stream, XINE_STREAM_INFO_HAS_VIDEO); this->funcs.fe_control(this->funcs.fe_handle, has_video ? "NOVIDEO 1\r\n" : "NOVIDEO 0\r\n"); + if(!has_video && *av && strcmp(av, "none")) { + char str[64]; + sprintf(str, "POST %s On\r\n", av); + this->funcs.fe_control(this->funcs.fe_handle, str); + } } } else { LOGMSG("Error playing file ! (File not found ? Unknown format ?)"); @@ -2264,6 +2275,7 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) xine_event_dispose_queue (this->slave_event_queue); this->slave_event_queue = NULL; } + this->funcs.fe_control(this->funcs.fe_handle, "POST 0 Off\r\n"); if(this->funcs.fe_control) this->funcs.fe_control(this->funcs.fe_handle, "SLAVE 0x0\r\n"); if(this->fd_control>=0) -- cgit v1.2.3