From d8d60c782d078595963e45ffeb30ab2933894b03 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Mon, 16 Oct 2006 23:37:22 +0000 Subject: [PATCH] One message queue only. Player events go back to parent only. And Finally: WSS switching on PAL line 23!! --- command.cc | 108 +++++++++++++++++++++++++++------------------- message.h | 1 + objects.mk | 2 +- player.cc | 57 +++++++++++++++++------- player.h | 15 ++++++- timerreceiver.h | 2 +- vchannelselect.cc | 6 +-- vconnect.cc | 1 + vepg.cc | 2 +- vepgsettimer.cc | 3 +- view.h | 2 +- viewman.cc | 3 +- viewman.h | 5 +-- vlivebanner.cc | 4 +- vmute.cc | 2 +- voptions.cc | 4 +- vquestion.cc | 2 +- vquestion.h | 1 + vrecmove.cc | 2 +- vrecordingmenu.cc | 12 +++--- vserverselect.cc | 2 +- vserverselect.h | 1 + vvideolive.cc | 39 ++++++++++++++++- vvideorec.cc | 68 ++++++++++++++++++++++++++--- vvideorec.h | 6 +++ vvolume.cc | 2 +- 26 files changed, 255 insertions(+), 97 deletions(-) diff --git a/command.cc b/command.cc index 08750ce..e6ba5ee 100644 --- a/command.cc +++ b/command.cc @@ -240,57 +240,75 @@ void Command::processMessage(Message* m) { logger->log("Command", Log::DEBUG, "processing message %i", m->message); - switch(m->message) + // Timer handling is very weird at the mo. Take them out here and convert + if (m->message == Message::TIMER) { - case Message::STANDBY: - { - doStandby(); - break; - } - case Message::STOP_PLAYBACK: - { - handleCommand(Remote::STOP); // an odd way of doing it, but so simple - break; - } - case Message::STREAM_END: - { - VVideoLive::getInstance()->streamEnd(); - break; - } - case Message::VDR_CONNECTED: - { - doJustConnected((VConnect*)m->from); - break; - } - case Message::TIMER: - { - // FIXME - go to one message queue only - then instead of having - // objects deriving from messagequeues, make them derive from - // messagereceiver - then one messagequeue can deliver any message to anywhere + // FIXME - go to one message queue only - then instead of having + // objects deriving from messagequeues, make them derive from + // messagereceiver - then one messagequeue can deliver any message to anywhere - // deliver timer + // deliver timer - ((TimerReceiver*)m->to)->timercall(m->parameter); - handleCommand(Remote::NA_NONE); // in case any timer has posted messages to viewman, - // run viewman message queue here. FIXME improve this! - break; - } - case Message::SCREENSHOT: - { - Osd::getInstance()->screenShot("/out.jpg"); - break; - } - case Message::CONNECTION_LOST: - { - doFromTheTop(true); - break; - } - case Message::UDP_BUTTON: + logger->log("Command", Log::DEBUG, "sending timer"); + ((TimerReceiver*)m->to)->timercall(m->parameter); +// handleCommand(Remote::NA_NONE); // in case any timer has posted messages to viewman, +// // run viewman message queue here. FIXME improve this! +// break; + } + else if (m->to == this) + { + switch(m->message) { - handleCommand(m->parameter); - break; + case Message::STANDBY: + { + doStandby(); + break; + } + + + // << FIXME OBSELETE + case Message::STOP_PLAYBACK: + { + handleCommand(Remote::STOP); // an odd way of doing it, but so simple + break; + } + case Message::STREAM_END: + { + VVideoLive::getInstance()->streamEnd(); + break; + } + + // Also connection_lost comes from player - anywhere else? + // FIXME OBSELETE >> + + + case Message::VDR_CONNECTED: + { + doJustConnected((VConnect*)m->from); + break; + } + case Message::SCREENSHOT: + { + Osd::getInstance()->screenShot("/out.jpg"); + break; + } + case Message::CONNECTION_LOST: + { + doFromTheTop(true); + break; + } + case Message::UDP_BUTTON: + { + handleCommand(m->parameter); + break; + } } } + else + { + logger->log("Command", Log::DEBUG, "Sending message to viewman"); + viewman->processMessage(m); + } } void Command::handleCommand(int button) diff --git a/message.h b/message.h index c0084ce..8a9b293 100644 --- a/message.h +++ b/message.h @@ -64,6 +64,7 @@ class Message const static ULONG CONNECTION_LOST = 19; const static ULONG MOVE_RECORDING = 20; const static ULONG UDP_BUTTON = 21; + const static ULONG PLAYER_EVENT = 22; }; #endif diff --git a/objects.mk b/objects.mk index 1eb44f8..d5805b2 100644 --- a/objects.mk +++ b/objects.mk @@ -11,6 +11,6 @@ OBJECTS1 = command.o log.o tcp.o dsock.o thread.o timers.o i18n.o mutex.o \ vchannellist.o vwelcome.o vvideolive.o vvideorec.o vepgsettimer.o \ vchannelselect.o vserverselect.o vconnect.o vepg.o vrecmove.o \ widget.o wselectlist.o wjpeg.o wsymbol.o wbutton.o \ - woptionbox.o wtextbox.o \ + woptionbox.o wtextbox.o wwss.o \ fonts/helvB24.o fonts/helvB18.o \ remote.o led.o mtd.o video.o audio.o osd.o surface.o diff --git a/player.cc b/player.cc index 6306a79..6a2ce33 100644 --- a/player.cc +++ b/player.cc @@ -22,10 +22,11 @@ // ----------------------------------- Called from outside, one offs or info funcs -Player::Player(MessageQueue* messageQueue, bool tIsRecording, bool tIsRadio) +Player::Player(MessageQueue* tmessageQueue, void* tmessageReceiver, bool tIsRecording, bool tIsRadio) : vfeed(this), afeed(this) { - commandMessageQueue = messageQueue; + messageQueue = tmessageQueue; + messageReceiver = tmessageReceiver; audio = Audio::getInstance(); video = Video::getInstance(); logger = Log::getInstance(); @@ -691,10 +692,13 @@ void Player::restartAtFrame(ULONG newFrame) void Player::doConnectionLost() { + logger->log("Player", Log::DEBUG, "Connection lost, sending message"); Message* m = new Message(); - m->message = Message::CONNECTION_LOST; - m->to = this; - commandMessageQueue->postMessage(m); + m->to = messageReceiver; + m->from = this; + m->message = Message::PLAYER_EVENT; + m->parameter = Player::CONNECTION_LOST; + messageQueue->postMessage(m); } // ----------------------------------- Callback @@ -716,11 +720,25 @@ void Player::call(void* caller) { logger->log("Player", Log::DEBUG, "Demuxer said video is 4:3 aspect, switching TV"); video->setAspectRatio(Video::ASPECT4X3); + + Message* m = new Message(); + m->from = this; + m->to = messageReceiver; + m->message = Message::PLAYER_EVENT; + m->parameter = Player::ASPECT43; + messageQueue->postMessage(m); } else if (dxCurrentAspect == Demuxer::ASPECT_16_9) { logger->log("Player", Log::DEBUG, "Demuxer said video is 16:9 aspect, switching TV"); video->setAspectRatio(Video::ASPECT16X9); + + Message* m = new Message(); + m->from = this; + m->to = messageReceiver; + m->message = Message::PLAYER_EVENT; + m->parameter = Player::ASPECT169; + messageQueue->postMessage(m); } else { @@ -762,9 +780,12 @@ void Player::threadMethod() { threadCheckExit(); Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex - m->message = Message::STOP_PLAYBACK; - logger->log("Player", Log::DEBUG, "Posting message to %p...", commandMessageQueue); - commandMessageQueue->postMessage(m); + m->to = messageReceiver; + m->from = this; + m->message = Message::PLAYER_EVENT; + m->parameter = STOP_PLAYBACK; + logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue); + messageQueue->postMessage(m); logger->log("Player", Log::DEBUG, "Message posted..."); return; } @@ -886,9 +907,12 @@ void Player::threadFeedLive() threadCheckExit(); Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex - m->message = Message::STREAM_END; - logger->log("Player", Log::DEBUG, "Posting message to %p...", commandMessageQueue); - commandMessageQueue->postMessage(m); + m->to = messageReceiver; + m->from = this; + m->message = Message::PLAYER_EVENT; + m->parameter = Player::STREAM_END; + logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue); + messageQueue->postMessage(m); logger->log("Player", Log::DEBUG, "Message posted..."); } @@ -991,11 +1015,14 @@ void Player::threadFeedPlay() threadCheckExit(); + Message* m = new Message(); // Must be done after this thread finishes, and must break into master mutex - m->message = Message::STOP_PLAYBACK; // recording - logger->log("Player", Log::DEBUG, "Posting message to %p...", commandMessageQueue); - commandMessageQueue->postMessage(m); - logger->log("Player", Log::DEBUG, "Message posted..."); + m->to = messageReceiver; + m->from = this; + m->message = Message::PLAYER_EVENT; + m->parameter = Player::STOP_PLAYBACK; + logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue); + messageQueue->postMessage(m); } void Player::threadFeedScan() diff --git a/player.h b/player.h index 8c02d7f..39a4d87 100644 --- a/player.h +++ b/player.h @@ -48,7 +48,7 @@ class Player : public Thread_TYPE, public Callback { public: - Player(MessageQueue* messageQueue, bool isRecording, bool isRadio); + Player(MessageQueue* messageQueue, void* messageReceiver, bool isRecording, bool isRadio); virtual ~Player(); int init(); @@ -81,6 +81,16 @@ class Player : public Thread_TYPE, public Callback const static UCHAR S_STOP = 6; const static UCHAR S_JUMP = 7; + // Player events + + // FIXME so far this just duplicates the old system + the wss + + const static UCHAR CONNECTION_LOST = 1; + const static UCHAR STOP_PLAYBACK = 2; + const static UCHAR STREAM_END = 3; + const static UCHAR ASPECT43 = 4; + const static UCHAR ASPECT169 = 5; + #ifdef DEV void test1(); void test2(); @@ -101,7 +111,8 @@ class Player : public Thread_TYPE, public Callback void doConnectionLost(); void restartAtFrame(ULONG newFrame); - MessageQueue* commandMessageQueue; + MessageQueue* messageQueue; + void* messageReceiver; Log* logger; Audio* audio; Video* video; diff --git a/timerreceiver.h b/timerreceiver.h index 68e5064..9e0f301 100755 --- a/timerreceiver.h +++ b/timerreceiver.h @@ -25,7 +25,7 @@ class TimerReceiver { public: virtual ~TimerReceiver() {} - virtual void timercall(int clientReference)=0; + virtual void timercall(int clientReference)=0; // Master lock will be locked! }; #endif diff --git a/vchannelselect.cc b/vchannelselect.cc index 8a48f05..d362c6e 100644 --- a/vchannelselect.cc +++ b/vchannelselect.cc @@ -159,7 +159,7 @@ int VChannelSelect::handleCommand(int command) m->to = videoLive; m->message = Message::CHANNEL_CHANGE; m->parameter = (first * 100) + (second * 10) + third; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } return 4; @@ -182,7 +182,7 @@ void VChannelSelect::timercall(int clientReference) m->from = this; m->to = ViewMan::getInstance(); m->message = Message::CLOSE_ME; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); // Is there valid data? if ((first > 0) || (second > 0) || (third > 0)) @@ -205,6 +205,6 @@ void VChannelSelect::timercall(int clientReference) m->to = videoLive; m->message = Message::CHANNEL_CHANGE; m->parameter = newChannel; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessage(m); } } diff --git a/vconnect.cc b/vconnect.cc index 7292b71..e87b555 100644 --- a/vconnect.cc +++ b/vconnect.cc @@ -159,6 +159,7 @@ void VConnect::threadMethod() Message* m = new Message(); // Must be done after this thread ends m->from = this; + m->to = Command::getInstance(); m->message = Message::VDR_CONNECTED; Command::getInstance()->postMessage(m); } diff --git a/vepg.cc b/vepg.cc index 94ad220..85e1ddd 100644 --- a/vepg.cc +++ b/vepg.cc @@ -383,7 +383,7 @@ int VEpg::handleCommand(int command) m->from = this; m->to = videoLive; m->message = Message::EPG_CLOSE; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } return 4; } diff --git a/vepgsettimer.cc b/vepgsettimer.cc index b406fed..57ef730 100644 --- a/vepgsettimer.cc +++ b/vepgsettimer.cc @@ -266,6 +266,5 @@ void VEpgSetTimer::doit() m->message = Message::ADD_VIEW; m->to = viewman; m->parameter = (ULONG)vi; - - viewman->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } diff --git a/view.h b/view.h index 4da134f..5cc6009 100644 --- a/view.h +++ b/view.h @@ -38,7 +38,7 @@ class View : public Box virtual void draw(); virtual int handleCommand(int command); - virtual void processMessage(Message* m); + virtual void processMessage(Message* m); // The master lock will be locked void setBorderOn(UCHAR on); void setTitleBarOn(UCHAR on); diff --git a/viewman.cc b/viewman.cc index 8ac891e..7b017aa 100644 --- a/viewman.cc +++ b/viewman.cc @@ -393,7 +393,7 @@ int ViewMan::handleCommand(UCHAR command) // Log::getInstance()->log("ViewMan", Log::DEBUG, "out of handlecommand code, now on to messages"); - processMessageQueue(); +// processMessageQueue(); return retVal2; } @@ -411,6 +411,7 @@ void ViewMan::processMessage(Message* m) return; } } + return; } Log::getInstance()->log("ViewMan", Log::DEBUG, "it's for meeee!"); diff --git a/viewman.h b/viewman.h index 006e07d..ea56d63 100644 --- a/viewman.h +++ b/viewman.h @@ -40,7 +40,7 @@ typedef list RegionList; -class ViewMan : public MessageQueue +class ViewMan { public: ViewMan(); @@ -56,6 +56,7 @@ class ViewMan : public MessageQueue void updateView(View* toUpdate, Region* regionToUpdate = NULL); int handleCommand(UCHAR command); + void processMessage(Message* m); private: static ViewMan* instance; @@ -64,8 +65,6 @@ class ViewMan : public MessageQueue View* views[20]; int numViews; - void processMessage(Message* m); - // New windowing stuff void deleteView(int z); void repaintRevealed(int x, Region r); diff --git a/vlivebanner.cc b/vlivebanner.cc index fe2269d..eb445e3 100644 --- a/vlivebanner.cc +++ b/vlivebanner.cc @@ -243,7 +243,7 @@ int VLiveBanner::handleCommand(int command) m->message = Message::EPG; m->to = vvideoLive; m->from = this; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 4; } } @@ -260,7 +260,7 @@ void VLiveBanner::timercall(int clientReference) m->message = Message::CLOSE_ME; m->to = ViewMan::getInstance(); m->from = this; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } else if (clientReference == 2) { diff --git a/vmute.cc b/vmute.cc index 91643ea..921f15a 100644 --- a/vmute.cc +++ b/vmute.cc @@ -64,7 +64,7 @@ void VMute::timercall(int clientReference) m->message = Message::CLOSE_ME; m->to = ViewMan::getInstance(); m->from = this; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } int VMute::handleCommand(int command) diff --git a/voptions.cc b/voptions.cc index e564157..cffacc0 100644 --- a/voptions.cc +++ b/voptions.cc @@ -218,7 +218,7 @@ int VOptions::handleCommand(int command) m->message = Message::CLOSE_ME; m->from = this; m->to = viewman; - viewman->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 2; } @@ -280,7 +280,7 @@ void VOptions::doSave() m->message = Message::CHANGED_OPTIONS; m->to = parent; m->parameter = (ULONG)optionChanges; - viewman->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } diff --git a/vquestion.cc b/vquestion.cc index b14509c..ec1571e 100644 --- a/vquestion.cc +++ b/vquestion.cc @@ -106,7 +106,7 @@ int VQuestion::handleCommand(int command) m->from = this; m->to = replyTo; m->message = Message::QUESTION_YES; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 4; } diff --git a/vquestion.h b/vquestion.h index d69f8fb..ccddf7f 100644 --- a/vquestion.h +++ b/vquestion.h @@ -30,6 +30,7 @@ #include "viewman.h" #include "colour.h" #include "i18n.h" +#include "command.h" class VQuestion : public View { diff --git a/vrecmove.cc b/vrecmove.cc index b34322a..7e3dc35 100644 --- a/vrecmove.cc +++ b/vrecmove.cc @@ -118,7 +118,7 @@ int VRecMove::handleCommand(int command) m->message = Message::MOVE_RECORDING; m->to = parent; m->parameter = sl.getCurrentOptionData(); - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 4; } diff --git a/vrecordingmenu.cc b/vrecordingmenu.cc index 60880b4..9f53124 100644 --- a/vrecordingmenu.cc +++ b/vrecordingmenu.cc @@ -99,7 +99,7 @@ int VRecordingMenu::handleCommand(int command) m->from = this; m->to = vRecList; m->message = Message::PLAY_SELECTED_RECORDING; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 4; } @@ -109,7 +109,7 @@ int VRecordingMenu::handleCommand(int command) m->from = this; m->to = vRecList; m->message = Message::RESUME_SELECTED_RECORDING; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 4; } @@ -196,13 +196,13 @@ void VRecordingMenu::processMessage(Message* m) m2->from = this; m2->to = ViewMan::getInstance(); m2->message = Message::CLOSE_ME; - ViewMan::getInstance()->postMessage(m2); + Command::getInstance()->postMessageNoLock(m2); m2 = new Message(); // OK. Want this to delete before this message does its job m2->from = this; m2->to = vRecList; m2->message = Message::DELETE_SELECTED_RECORDING; - ViewMan::getInstance()->postMessage(m2); + Command::getInstance()->postMessageNoLock(m2); } } else if (m->message == Message::MOVE_RECORDING) @@ -211,13 +211,13 @@ void VRecordingMenu::processMessage(Message* m) m2->from = this; m2->to = ViewMan::getInstance(); m2->message = Message::CLOSE_ME; - ViewMan::getInstance()->postMessage(m2); + Command::getInstance()->postMessageNoLock(m2); m2 = new Message(); m2->from = this; m2->to = vRecList; m2->message = Message::MOVE_RECORDING; m2->parameter = m->parameter; - ViewMan::getInstance()->postMessage(m2); + Command::getInstance()->postMessageNoLock(m2); } } diff --git a/vserverselect.cc b/vserverselect.cc index f5bae81..12580e7 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -91,7 +91,7 @@ int VServerSelect::handleCommand(int command) m->to = replyTo; m->message = Message::SERVER_SELECTED; m->parameter = sl.getCurrentOption(); - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); return 4; } } diff --git a/vserverselect.h b/vserverselect.h index 2af588d..3aa191a 100644 --- a/vserverselect.h +++ b/vserverselect.h @@ -34,6 +34,7 @@ #include "viewman.h" #include "i18n.h" #include "vdr.h" +#include "command.h" using namespace std; diff --git a/vvideolive.cc b/vvideolive.cc index 026f842..4d274a4 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -38,8 +38,8 @@ VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType, VChannelList* unavailableView = NULL; streamType = tstreamType; videoMode = video->getMode(); - if (streamType == VDR::RADIO) player = new Player(Command::getInstance(), false, true); - else player = new Player(Command::getInstance(), false, false); + if (streamType == VDR::RADIO) player = new Player(Command::getInstance(), this, false, true); + else player = new Player(Command::getInstance(), this, false, false); player->init(); create(video->getScreenWidth(), video->getScreenHeight()); @@ -243,6 +243,41 @@ void VVideoLive::processMessage(Message* m) video->setMode(videoMode); if (saveUnavailable) showUnavailable(1); } + else if (m->message == Message::PLAYER_EVENT) + { + switch(m->parameter) + { + case Player::CONNECTION_LOST: // connection lost detected + { + Log::getInstance()->log("VVideoLive", Log::DEBUG, "Received connection lost from player"); + // 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::STREAM_END: + { + // I can't handle this, send it to command - 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::STREAM_END; + Command::getInstance()->postMessageNoLock(m); + break; + } + case Player::ASPECT43: + { + Log::getInstance()->log("VVideoLive", Log::DEBUG, "Received do WSS 43"); + break; + } + case Player::ASPECT169: + { + Log::getInstance()->log("VVideoLive", Log::DEBUG, "Received do WSS 169"); + break; + } + } + } } void VVideoLive::doBanner(bool bannerTakesCommands) diff --git a/vvideorec.cc b/vvideorec.cc index d578877..656b9f9 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -28,7 +28,7 @@ VVideoRec::VVideoRec(Recording* rec) // TODO Work out if is a radio stream - player = new Player(Command::getInstance(), true, false); + player = new Player(Command::getInstance(), this, true, false); player->init(); videoMode = video->getMode(); @@ -76,10 +76,19 @@ VVideoRec::VVideoRec(Recording* rec) clocksRegion.w = 170; clocksRegion.h = surface->getFontHeight(); + barBlue.set(0, 0, 150, 150); barShowing = false; stickyBar = false; + + wss.setSurface(surface); + wss.setWide(true); + + wssRegion.x = 0; + wssRegion.y = 0; + wssRegion.w = video->getScreenWidth(); + wssRegion.h = 10; } VVideoRec::~VVideoRec() @@ -99,6 +108,7 @@ VVideoRec::~VVideoRec() void VVideoRec::draw() { View::draw(); + wss.draw(); } void VVideoRec::go(ULONG startFrameNum) @@ -131,7 +141,7 @@ void VVideoRec::go(ULONG startFrameNum) m->message = Message::CLOSE_ME; m->from = this; m->to = viewman; - viewman->postMessage(m); + Command::getInstance()->postMessageNoLock(m); VInfo* vi = new VInfo(); vi->create(400, 150); @@ -149,7 +159,7 @@ void VVideoRec::go(ULONG startFrameNum) m->message = Message::ADD_VIEW; m->to = viewman; m->parameter = (ULONG)vi; - viewman->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } } @@ -270,6 +280,54 @@ int VVideoRec::handleCommand(int command) return 1; } +void VVideoRec::processMessage(Message* m) +{ + if (m->from != player) return; + if (m->message != Message::PLAYER_EVENT) return; + + Log::getInstance()->log("VVideoRec", 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: + { + // 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; + } + case Player::ASPECT43: + { + Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 43"); + wss.setWide(false); + wss.draw(); + ViewMan::getInstance()->updateView(this, &wssRegion); + Log::getInstance()->log("VVideoRec", Log::DEBUG, "WSS done"); + break; + } + case Player::ASPECT169: + { + Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 169"); + wss.setWide(true); + wss.draw(); + ViewMan::getInstance()->updateView(this, &wssRegion); + Log::getInstance()->log("VVideoRec", Log::DEBUG, "WSS done"); + break; + } + } +} + void VVideoRec::stopPlay() { Log::getInstance()->log("VVideoRec", Log::DEBUG, "Pre stopPlay"); @@ -380,8 +438,8 @@ void VVideoRec::doBar(int action) } else { -// timers->setTimerD(this, 1, 4); // only set the getridofbar timer if not ffwd/fbwd -// stickyBar = false; + timers->setTimerD(this, 1, 4); // only set the getridofbar timer if not ffwd/fbwd + stickyBar = false; } timers->setTimerD(this, 2, 0, 200000000); } diff --git a/vvideorec.h b/vvideorec.h index dfd013c..775afc3 100644 --- a/vvideorec.h +++ b/vvideorec.h @@ -32,6 +32,8 @@ #include "osd.h" #include "timers.h" #include "timerreceiver.h" +#include "message.h" +#include "wwss.h" //#include "vepg.h" // for testing EPG in NTSC with a NTSC test video @@ -47,6 +49,7 @@ class VVideoRec : public View, public TimerReceiver void go(ULONG startPosition); void timercall(int clientReference); + void processMessage(Message* m); private: VDR* vdr; @@ -73,6 +76,9 @@ class VVideoRec : public View, public TimerReceiver UINT startMargin; UINT endMargin; + + Wwss wss; + Region wssRegion; }; #endif diff --git a/vvolume.cc b/vvolume.cc index 1c509cb..fd7cbf6 100644 --- a/vvolume.cc +++ b/vvolume.cc @@ -79,7 +79,7 @@ void VVolume::timercall(int clientReference) m->message = Message::CLOSE_ME; m->to = ViewMan::getInstance(); m->from = this; - ViewMan::getInstance()->postMessage(m); + Command::getInstance()->postMessageNoLock(m); } int VVolume::handleCommand(int command) -- 2.39.5