vdr = VDR::getInstance();
boxstack = BoxStack::getInstance();
video = Video::getInstance();
+
+ vas = NULL;
chanList = tchanList;
vchannelList = tvchannelList;
if ((*chanList)[currentChannelIndex]->type == VDR::VIDEO)
{
+ streamType = VDR::VIDEO;
player = new PlayerLiveTV(Command::getInstance(), this, chanList);
}
else
{
+ streamType = VDR::RADIO;
player = new PlayerLiveRadio(Command::getInstance(), this, chanList);
}
player->init();
textRed.setText("Summary");
osd.add(&textRed);
- textGreen.setBackgroundColour(osdBack);
- textGreen.setPosition(boxGreen.getX()+18, 98);
- textGreen.setSize(120, 30);
- textGreen.setText("Audio");
- osd.add(&textGreen);
+ if (streamType == VDR::VIDEO)
+ {
+ textGreen.setBackgroundColour(osdBack);
+ textGreen.setPosition(boxGreen.getX()+18, 98);
+ textGreen.setSize(120, 30);
+ textGreen.setText("Audio");
+ osd.add(&textGreen);
+ }
textYellow.setBackgroundColour(osdBack);
textYellow.setPosition(boxYellow.getX()+18, 98);
add(&summary);
textSummary.setBackgroundColour(osdBack);
- textSummary.setPosition(30, 10);
- textSummary.setSize(video->getScreenWidth() - 60, 130);
+ textSummary.setPosition(40, 10);
+ textSummary.setSize(video->getScreenWidth() - 80, 130);
textSummary.setParaMode(true);
summary.add(&textSummary);
case Remote::GREEN:
{
- /*
- VAudioSelector* vas = new VAudioSelector(this, (*chanList)[currentChannelIndex], ((Player*)player)->getCurrentAudioChannel());
- vas->setBackgroundColour(Colour::VIEWBACKGROUND);
- vas->setPosition(0, getHeight()-200);
- vas->draw();
- BoxStack::getInstance()->add(vas);
- BoxStack::getInstance()->update(vas);
- */
+ if (streamType == VDR::VIDEO) doAudioSelector();
+ return 2;
}
case Remote::YELLOW:
{
delete[] keyingString;
}
+void VVideoLiveTV::doAudioSelector()
+{
+ // If the osd is already visisble there might be a timer for it
+ Timers::getInstance()->cancelTimer(this, 1);
+
+ // Cancel keying
+ if (keying)
+ {
+ keying = 0;
+ // and reset the display - this is a copy from setNowNextData
+ char formatChanNum[20];
+ SNPRINTF(formatChanNum, 19, "%0*lu", numberWidth, (*chanList)[osdChannelIndex]->number);
+ osdChanNum.setText(formatChanNum);
+ osdChanName.setText((*chanList)[osdChannelIndex]->name);
+ }
+
+ // Draw the selector
+ vas = new VAudioSelector(this, (*chanList)[currentChannelIndex], ((PlayerLiveTV*)player)->getCurrentAudioChannel());
+ Colour osdBack = Colour(0, 0, 0, 128);
+ vas->setBackgroundColour(osdBack);
+ vas->setPosition(0, osd.getScreenY() - vas->getHeight());
+ vas->draw();
+
+ // make vas != null and displayOSD will not set a timer or do any boxstack update
+ summary.setVisible(false);
+ if (osd.getVisible()) displayOSD(false);
+ else displayOSD(true);
+ draw();
+
+ BoxStack::getInstance()->add(vas);
+ BoxStack::getInstance()->update(this);
+ BoxStack::getInstance()->update(vas);
+}
+
void VVideoLiveTV::doEPG()
{
if (osd.getVisible()) clearScreen();
summary.draw();
boxstack->update(this, &osdSummaryRegion);
}
- else
+ else if (!vas)
{
boxstack->update(this, osd.getRegion());
Timers::getInstance()->setTimerD(this, 1, 4);
{
video->setMode(videoMode);
}
+ else if (m->message == Message::CHILD_CLOSE)
+ {
+ if (m->from == vas)
+ {
+ vas = NULL;
+ displayOSD(false);
+ }
+ }
else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
{
Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %i", m->parameter);