// --- cMenuSearchMain --------------------------------------------------------- cMenuSearchMain::cMenuSearchMain(void) :cOsdMenu("", GetTab(1), GetTab(2), GetTab(3), GetTab(4), GetTab(5)) { #if VDRVERSNUM >= 10728 SetMenuCategory(mcSchedule); #endif helpKeys = -1; otherChannel = 0; toggleKeys = 0; shiftTime = 0; InWhatsOnMenu = false; InFavoritesMenu = false; cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); schedules = cSchedules::Schedules(schedulesLock); if (channel) { cMenuWhatsOnSearch::SetCurrentChannel(channel->Number()); if (EPGSearchConfig.StartMenu == 0 || forceMenu != 0) PrepareSchedule(channel); SetHelpKeys(); cMenuWhatsOnSearch::currentShowMode = showNow; // timeb tnow; //ftime(&tnow); //isyslog("duration epgs sched: %d", tnow.millitm - gl_time.millitm + ((tnow.millitm - gl_time.millitm<0)?1000:0)); } if ((EPGSearchConfig.StartMenu == 1 || forceMenu == 1) && forceMenu != 2) { InWhatsOnMenu = true; AddSubMenu(new cMenuWhatsOnSearch(schedules, cDevice::CurrentChannel())); } if (forceMenu == 3) ShowSummary(); }
eOSState cMenuSearchResults::ProcessKey(eKeys Key) { bool HadSubMenu = HasSubMenu(); eOSState state = cOsdMenu::ProcessKey(Key); if (!HasSubMenu() && HadSubMenu) // navigation in summary could have changed current item, so update it UpdateCurrent(); if (state == osUnknown) { switch (Key) { case k0: if(!HasSubMenu()) { toggleKeys = 1 - toggleKeys; SetHelpKeys(true); } state = osContinue; break; case kGreen: state = OnGreen(); break; case kYellow: state = OnYellow(); break; case kOk: case kInfo: if(HasSubMenu()) { state = cOsdMenu::ProcessKey(Key); break; } if (Count()) state = ShowSummary(); else state = osBack; break; default: break; } } if (!HasSubMenu()) { if ((HadSubMenu || gl_TimerProgged) && Update()) { if (gl_TimerProgged) // when using epgsearch's timer edit menu, update is delayed because of SVDRP { gl_TimerProgged = 0; SetHelpKeys(); } Display(); } if (Key != kNone) SetHelpKeys(); if (gl_InfoConflict) { gl_InfoConflict = 0; if (Interface->Confirm(tr("Timer conflict! Show?"))) state = AddSubMenu(new cMenuConflictCheck()); } } return state; }
int Unreal3DExport::DoExport( const TCHAR *name, ExpInterface *ei, Interface *i, BOOL suppressPrompts, DWORD options ) { int Result = FALSE; // Set a global prompt display switch bShowPrompts = suppressPrompts ? false : true; bExportSelected = (options & SCENE_EXPORT_SELECTED) ? true : false; // Get file names SplitFilename(TSTR(name), &FilePath, &FileName, &FileExt); if( MatchPattern(FileName,TSTR(_T("*_d")),TRUE) || MatchPattern(FileName,TSTR(_T("*_a")),TRUE) ) { FileName = FileName.Substr(0,FileName.length()-2); } ModelFileName = FilePath + _T("\\") + FileName + TSTR(_T("_d")) + FileExt; AnimFileName = FilePath + _T("\\") + FileName + TSTR(_T("_a")) + FileExt; ScriptFileName = FilePath + _T("\\") + FileName + TSTR(_T("_rc.uc")); // Open Log fLog = _tfopen(FilePath + _T("\\") + FileName + _T(".log") ,_T("wb")); // Init pInt = GetCOREInterface(); pInt->ProgressStart( GetString(IDS_INFO_INIT), TRUE, fn, this); Progress += U3D_PROGRESS_INIT; try { MyErrorProc pErrorProc; SetErrorCallBack(&pErrorProc); ReadConfig(); //if(bShowPrompts) /*DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_PANEL), GetActiveWindow(), Unreal3DExportOptionsDlgProc, (LPARAM)this);*/ //if(showPrompts) { // Prompt the user with our dialogbox, and get all the options. if(!DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_PANEL), GetActiveWindow(), Unreal3DExportOptionsDlgProc, (LPARAM)this)) { throw CancelException(); } } // Enumerate interesting nodes Init(); // Fetch data from nodes GetTris(); GetAnim(); // Prepare data for writing Prepare(); // Write to files WriteScript(); WriteModel(); WriteTracking(); // Show optional summary ShowSummary(); WriteConfig(); Result = IMPEXP_SUCCESS; } catch( CancelException& ) { Result = IMPEXP_CANCEL; } catch( MAXException& e ) { if( bShowPrompts && !e.message.isNull() ) { MaxMsgBox(pInt->GetMAXHWnd(),e.message,ShortDesc(),MB_OK|MB_ICONERROR); } Result = IMPEXP_FAIL; } // Release scene if( pScene != NULL ) { pScene->ReleaseIGame(); pScene = NULL; } // Close files fclosen(fMesh); fclosen(fAnim); fclosen(fLog); fclosen(fScript); // Return to MAX pInt->ProgressEnd(); return Result; }
eOSState cMenuSearchMain::ProcessKey(eKeys Key) { bool HadSubMenu = HasSubMenu(); eOSState state = cOsdMenu::ProcessKey(Key); if (exitToMainMenu == 1) { exitToMainMenu = 0; return osBack; } if (!HasSubMenu() && HadSubMenu) UpdateCurrent(); if (state == osUnknown) { switch (Key) { case kFastRew: if (HasSubMenu() && !InWhatsOnMenu && !InFavoritesMenu) { /* if (Count()) { CursorUp(); return ShowSummary(); } */ } else return Shift(-EPGSearchConfig.timeShiftValue); case kFastFwd: if (HasSubMenu() && !InWhatsOnMenu && !InFavoritesMenu) { /* if (Count()) { CursorDown(); return ShowSummary(); } */ } else return Shift(EPGSearchConfig.timeShiftValue); case kRecord: case kRed: if(HasSubMenu()) { UpdateCurrent(); state = Record(); break; } if (Count()) { if (EPGSearchConfig.redkeymode==toggleKeys) state = Record(); else { cMenuMyScheduleItem *mi = (cMenuMyScheduleItem *)Get(Current()); if (mi) { if (mi->event) { return AddSubMenu(new cMenuSearchCommands(tr("EPG Commands"),mi->event)); } } } } break; case k0: if(!HasSubMenu()) { toggleKeys = 1 - toggleKeys; SetHelpKeys(true); } state = osContinue; break; case k1...k9: if (!HasSubMenu()) return Commands(Key); else state = osContinue; break; case kGreen: if (schedules) { if (HasSubMenu() && !InWhatsOnMenu && !InFavoritesMenu) { if (Count()) { // CursorUp(); // return ShowSummary(); } } else if (toggleKeys == 0 || (toggleKeys == 1 && EPGSearchConfig.toggleGreenYellow == 0)) { int ChannelNr = cDevice::CurrentChannel(); if (Count()) { cMenuMyScheduleItem* Item = (cMenuMyScheduleItem *)Get(Current()); if (Item && Item->event) { cChannel *channel = Channels.GetByChannelID(Item->event->ChannelID(), true, true); if (channel) ChannelNr = channel->Number(); } } if (cMenuWhatsOnSearch::currentShowMode == showFavorites) { InFavoritesMenu = true; return AddSubMenu(new cMenuFavorites()); } else { InWhatsOnMenu = true; return AddSubMenu(new cMenuWhatsOnSearch(schedules, ChannelNr)); } } else { cChannel *channel = Channels.GetByNumber(currentChannel-1,-1); if (channel) { PrepareSchedule(channel); if (channel->Number() != cDevice::CurrentChannel()) { otherChannel = channel->Number(); } Display(); } SetHelpKeys(true); return osContinue; } } case kYellow: if (schedules) { if (HasSubMenu()) { if (Count()) { // CursorDown(); // return ShowSummary(); } } else if (toggleKeys == 0 || (toggleKeys == 1 && EPGSearchConfig.toggleGreenYellow == 0)) { cMenuWhatsOnSearch::currentShowMode = showNext; InWhatsOnMenu = true; return AddSubMenu(new cMenuWhatsOnSearch(schedules, cMenuWhatsOnSearch::CurrentChannel())); } else { cChannel *channel = Channels.GetByNumber(currentChannel+1,1); if (channel) { PrepareSchedule(channel); if (channel->Number() != cDevice::CurrentChannel()) { otherChannel = channel->Number(); } Display(); } SetHelpKeys(true); return osContinue; } } break; case kBlue: if (HasSubMenu()) { UpdateCurrent(); return Switch(); } if (EPGSearchConfig.bluekeymode==toggleKeys) return Switch(); else return ExtendedSearch(); break; case kInfo: case kOk: if (Count()) return ShowSummary(); break; default: break; } } if (!HasSubMenu()) { cChannel *ch = cMenuWhatsOnSearch::ScheduleChannel(); InWhatsOnMenu = false; InFavoritesMenu = false; if (ch) { // when switch from the other menus to the schedule, try to keep the same time if (cMenuWhatsOnSearch::shiftTime) { time_t diff = cMenuWhatsOnSearch::seekTime - time(NULL); shiftTime = (diff + (diff>0?30:-30)) / 60 ; } else shiftTime = 0; PrepareSchedule(ch); if (ch->Number() != cDevice::CurrentChannel()) { otherChannel = ch->Number(); } Display(); } else if ((HadSubMenu || gl_TimerProgged) && Update()) { if (gl_TimerProgged) // when using epgsearch's timer edit menu, update is delayed because of SVDRP { gl_TimerProgged = 0; SetHelpKeys(); } Display(); } if (Key != kNone) SetHelpKeys(); if (gl_InfoConflict) { gl_InfoConflict = 0; if (Interface->Confirm(tr("Timer conflict! Show?"))) return AddSubMenu(new cMenuConflictCheck()); } } return state; }