void disableVideoOutput(bool disable) { settings.videoOutputDisabled = disable; printf("[controld] videoOutput %s\n", disable?"off":"on"); #ifdef HAVE_DBOX_HARDWARE int arg=disable?1:0; int fd; if ((fd = open(SAA7126_DEVICE,O_RDWR|O_NONBLOCK)) < 0) perror("[controld] " SAA7126_DEVICE); else { if ((ioctl(fd,SAAIOSPOWERSAVE,&arg) < 0)) perror("[controld] SAAIOSPOWERSAVE"); close(fd); } #endif /* arg=disable?0:0xf; if((fd = open("/dev/dbox/fp0",O_RDWR|O_NONBLOCK)) < 0) { perror("[controld] FP DEVICE: "); return; } if ( (ioctl(fd,FP_IOCTL_LCD_DIMM,&arg) < 0)) { perror("[controld] IOCTL: "); close(fd); return; } close(fd); */ if (!disable) { //zapit.setStandby(false); if (!settings.mute) audioDecoder->unmute(); #if defined HAVE_DREAMBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE startPlayBack(cc); #endif setvideooutput(settings.videooutput, false); videoDecoder->setVideoFormat(settings.videoformat); } else { #ifdef HAVE_TRIPLEDRAGON if (videoDecoder) videoDecoder->setVideoOutput(VID_OUTFMT_DISABLE_DACS); #else setvideooutput(CControld::FORMAT_CVBS, false); #endif videoDecoder->setVideoFormat(-1); //zapit.setStandby(true); audioDecoder->mute(); #if defined HAVE_DREAMBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE stopPlayBack(); #endif } }
int CWebTV::Show() { int res = -1; neutrino_msg_t msg; neutrino_msg_data_t data; if(channels.empty()) loadChannels(); // display channame in vfd CVFD::getInstance()->setMode(CVFD::MODE_IPTV); // windows size width = w_max ( (frameBuffer->getScreenWidth() / 20 * 17), (frameBuffer->getScreenWidth() / 20 )); height = h_max ( (frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20)); // head height frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icon_hd_w, &icon_hd_h); theight = std::max(icon_hd_h, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()) + 6; // buttonheight frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icon_bf_w, &icon_bf_h); buttonHeight = std::max(icon_bf_h, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) + 6; // listbox/items iheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight() + 2; listmaxshow = (height - theight - buttonHeight)/iheight; height = theight + buttonHeight + listmaxshow * iheight; // info height info_height = 5 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight() + 5 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 5; // x/y x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - (width + ConnectLineBox_Width)) / 2 + ConnectLineBox_Width; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2; showList: // head paintHead(); // foot paintFoot(); // paint all paint(); frameBuffer->blit(); oldselected = selected; int zapOnExit = false; // loop control unsigned long long timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); bool loop = true; while (loop) { g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd ); if ( msg <= CRCInput::RC_MaxRC ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) { selected = oldselected; loop = false; res = -1; } else if ( msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup || msg == CRCInput::RC_yellow) { int step = 0; int prev_selected = selected; step = ((int) msg == g_settings.key_channelList_pageup || (int) msg == CRCInput::RC_yellow) ? listmaxshow : 1; // browse or step 1 selected -= step; if((prev_selected-step) < 0) // because of uint selected = channels.size() - 1; paintItem(prev_selected - liststart); unsigned int oldliststart = liststart; liststart = (selected/listmaxshow)*listmaxshow; if(oldliststart!=liststart) paint(); else paintItem(selected - liststart); } else if ( msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown || msg == CRCInput::RC_green) { unsigned int step = 0; int prev_selected = selected; step = ((int) msg == g_settings.key_channelList_pagedown || (int)msg == CRCInput::RC_green) ? listmaxshow : 1; // browse or step 1 selected += step; if(selected >= channels.size()) { if (((channels.size() / listmaxshow) + 1) * listmaxshow == channels.size() + listmaxshow) // last page has full entries selected = 0; else selected = ((step == listmaxshow) && (selected < (((channels.size() / listmaxshow)+1) * listmaxshow))) ? (channels.size() - 1) : 0; } paintItem(prev_selected - liststart); unsigned int oldliststart = liststart; liststart = (selected/listmaxshow)*listmaxshow; if(oldliststart != liststart) paint(); else paintItem(selected - liststart); } else if ( msg == CRCInput::RC_ok || msg == (neutrino_msg_t) g_settings.mpkey_play) { zapOnExit = true; loop = false; } else if (msg == CRCInput::RC_info) { showFileInfoWebTV(selected); res = -1; goto showList; } else if (msg == CRCInput::RC_red) { addUserBouquet(); res = -1; goto showList; } else if(msg == CRCInput::RC_blue || msg == CRCInput::RC_favorites) { showUserBouquet(); res = -1; goto showList; } else if( msg == (neutrino_msg_t) g_settings.key_timeshift) // pause playing { if(playstate == PAUSE) continuePlayBack(); else if(playstate == PLAY) pausePlayBack(); res = -1; loop = false; } else if( msg == CRCInput::RC_stop) // pause playing { if(playstate == PLAY || playstate == PAUSE) stopPlayBack(); res = -1; loop = false; } else if(msg == (neutrino_msg_t)g_settings.mpkey_play) { if(playstate == PAUSE) continuePlayBack(); res = -1; loop = false; } else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = - 1; } } frameBuffer->blit(); } hide(); //CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); if(zapOnExit) res = selected; printf("CWebTV::show res %d\n", res); return (res); }