From d2a098346fb804ea1be0f3e89c7b5919abf6a545 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 29 Dec 2006 14:30:17 +0000 Subject: [PATCH] *** empty log message *** --- demuxerts.cc | 3 +++ vradiorec.cc | 73 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 56 insertions(+), 20 deletions(-) diff --git a/demuxerts.cc b/demuxerts.cc index 7789588..7fcce99 100644 --- a/demuxerts.cc +++ b/demuxerts.cc @@ -36,6 +36,8 @@ void DemuxerTS::flush() int DemuxerTS::scan(UCHAR *buf, int len) { + return 0xc0; +/* // Temporarily, just look for the lowest audio stream and return it UINT LoPattern = 0x100 | PESTYPE_AUD0, @@ -53,6 +55,7 @@ int DemuxerTS::scan(UCHAR *buf, int len) if (HiPattern == LoPattern) break; } return ret; +*/ } void DemuxerTS::setVID(int p_vID) diff --git a/vradiorec.cc b/vradiorec.cc index c31cd38..989a37c 100644 --- a/vradiorec.cc +++ b/vradiorec.cc @@ -247,30 +247,63 @@ int VRadioRec::handleCommand(int command) void VRadioRec::processMessage(Message* m) { - if (m->from != player) return; - if (m->message != Message::PLAYER_EVENT) return; - - Log::getInstance()->log("VRadioRec", Log::DEBUG, "Message received"); - - switch(m->parameter) + if (m->message == Message::MOUSE_LBDOWN) { - case Player::CONNECTION_LOST: // connection lost detected + int x=(m->parameter>>16)-(int)getScreenX(); + int y=(m->parameter&0xFFFF)-(int)getScreenY(); + if (!barShowing) { - // I can't handle this, send it to command - Message* m = new Message(); - m->to = Command::getInstance(); - m->message = Message::CONNECTION_LOST; - Command::getInstance()->postMessageNoLock(m); - break; + ViewMan::getInstance()->handleCommand(Remote::OK); //simulate rok press } - case Player::STOP_PLAYBACK: + else if ((int)barRegion.x<=x && (int)barRegion.y<=y && ((int)barRegion.x+(int)barRegion.w)>=x + && ((int)barRegion.y+(int)barRegion.h)>=y) { - // FIXME Obselete ish - improve this - Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex - m->to = Command::getInstance(); - m->message = Message::STOP_PLAYBACK; - Command::getInstance()->postMessageNoLock(m); - break; + int progBarXbase = barRegion.x + 300; + if (x>=(int)barRegion.x + progBarXbase + 24 + && x<=(int)barRegion.x + progBarXbase + 4 + 302 + && y>=(int)barRegion.y + 12 - 2 + && y<=(int)barRegion.y + 12 - 2+28) + { + int cx=x-(barRegion.x + progBarXbase + 4); + double percent=((double)cx)/302.*100.; + player->jumpToPercent(percent); + doBar(3); + return; + // int progressWidth = 302 * currentFrameNum / lengthFrames; + // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + } + } + else + { + ViewMan::getInstance()->handleCommand(Remote::OK); //simulate rok press + } + } + else if (m->message == Message::PLAYER_EVENT) + { + if (m->from != player) return; + + Log::getInstance()->log("VRadioRec", Log::DEBUG, "Message received"); + + switch(m->parameter) + { + case Player::CONNECTION_LOST: // connection lost detected + { + // I can't handle this, send it to command + Message* m = new Message(); + m->to = Command::getInstance(); + m->message = Message::CONNECTION_LOST; + Command::getInstance()->postMessageNoLock(m); + break; + } + case Player::STOP_PLAYBACK: + { + // FIXME Obselete ish - improve this + Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex + m->to = Command::getInstance(); + m->message = Message::STOP_PLAYBACK; + Command::getInstance()->postMessageNoLock(m); + break; + } } } } -- 2.39.5