/****************Function to detect mouse events****************/ static void Mouse(int button, int state, int mouseX, int mouseY) { GLint key; static GLint oldKeyLeft, oldKeyRight; if (state == GLUT_DOWN) { key = DoSelect((GLint) mouseX, (GLint) mouseY); if (key != -1 && key != 0) { if (button == GLUT_LEFT_BUTTON) { RecolorKey(key, 0); oldKeyLeft = key; } else if (button == GLUT_RIGHT_BUTTON) { zoomInKey(key); oldKeyRight = key; } } } else if (state == GLUT_UP) { key = DoSelect((GLint) mouseX, (GLint) mouseY); if (key != -1 ) { if (button == GLUT_LEFT_BUTTON && key == oldKeyLeft) { processInput(key); RecolorKey(key, 1); } else if (button == GLUT_RIGHT_BUTTON && key == oldKeyRight) { zoomOutKey(key); } else if (button == GLUT_LEFT_BUTTON) RecolorKey(oldKeyLeft, 1); else if(button == GLUT_RIGHT_BUTTON) zoomOutKey(oldKeyRight); } } glutPostRedisplay(); }
bool Command::Execute( void ) { switch( mCmdID ) { case kCmdAssign : return DoAssign(); case kCmdClose : return DoCloseCursor(); case kCmdExec : return DoExec(); case kCmdFetch : return DoFetch(); case kCmdGoIf : return DoGoIf(); case kCmdGoIfNot : return DoGoIfNot(); case kCmdOpen : return DoOpenCursor(); case kCmdParam : return DoReadParam(); case kCmdPrint : return DoPrint(); case kCmdReset : return mpVM->mVariables[ mObject ]->mIsNULL = true; case kCmdReturn : return DoReturn(); case kCmdSelect : return DoSelect(); case kCmdGo : mpVM->mPos = mParam.ToInt(); case kCmdNope : return true; default:; } return false; }
void WindowStack::Select(wxWindow* win) { wxString key = Find(win); if (!key.IsEmpty()) { DoSelect(win, key); } }
void WindowStack::Select(const wxString &key) { wxWindow *win = Find(key); if (win) { DoSelect(win, key); } }
void FCComputedGOTO( void ) { //======================== // Perform computed GOTO. DoSelect( FC_COMPUTED_GOTO ); }
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) : wxMSWDCImpl( owner ) { CreateCompatible(NULL); Init(); DoSelect(bitmap); }
void OBSBasicPreview::ProcessClick(const vec2 &pos) { Qt::KeyboardModifiers modifiers = QGuiApplication::keyboardModifiers(); if (modifiers & Qt::ControlModifier) DoCtrlSelect(pos); else DoSelect(pos); }
bool WindowStack::Add(wxWindow* win, bool select) { if(!win || Contains(win)) { return false; } win->Reparent(this); m_windows.insert(win); if(select) { DoSelect(win); } else { win->Hide(); } }
CHEWING_API int chewing_handle_Numlock( ChewingContext *ctx, int key ) { ChewingData *pgdata = ctx->data; ChewingOutput *pgo = ctx->output; int rtn, QuickCommit = 0; int keystrokeRtn = KEYSTROKE_ABSORB; if ( ! pgdata->bSelect ) { /* If we're not selecting words, we should send out numeric * characters at once. */ if ( pgdata->chiSymbolBufLen == 0 ) { QuickCommit = 1; } rtn = SymbolInput( key, pgdata ); /* copied from chewing_handle_Default */ if ( rtn == SYMBOL_KEY_ERROR ) { keystrokeRtn = KEYSTROKE_IGNORE ; } else if ( QuickCommit ) { pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ]; pgo->nCommitStr = 1; pgdata->chiSymbolBufLen = 0; pgdata->chiSymbolCursor = 0; keystrokeRtn = KEYSTROKE_COMMIT; } else { /* Not quick commit */ CallPhrasing( pgdata ); if( ReleaseChiSymbolBuf( pgdata, pgo ) != 0 ) keystrokeRtn = KEYSTROKE_COMMIT; } } else { /* Otherwise, if we are selecting words, we use numeric keys * as selkey * and submit the words. */ int num = -1; if ( key > '0' && key < '9' ) num = key - '1'; else if ( key == '0' ) num = 9; DoSelect( pgdata, num ); } CallPhrasing( pgdata ); MakeOutputWithRtn( pgo, pgdata, keystrokeRtn ); return 0; }
int wxSelectDispatcher::Dispatch(int timeout) { wxSelectSets sets(m_sets); switch ( DoSelect(sets, timeout) ) { case -1: wxLogSysError(_("Failed to monitor I/O channels")); return -1; case 0: // timeout expired without anything happening return 0; default: return ProcessSets(sets); } }
void BrowseDir(HWND hWnd) { const int MAX= MAX_PATH * 2; TCHAR path[MAX]; ::GetDlgItemText(hWnd, IDC_FOLDER, path, MAX); if (::GetFileAttributes(path) == 0-1) { if (TCHAR* sep= _tcsrchr(path, '\\')) *sep = 0; } TCHAR selected[MAX]; if (!DoSelect(hWnd, _T("Select ExifPro destination folder:"), path, selected)) return; ::SetDlgItemText(hWnd, IDC_FOLDER, selected); }
//----------------------------------------------------------------------------- // Called in general to actually do the work of the command //----------------------------------------------------------------------------- MStatus CVstAttachmentCmd::redoIt() { if ( m_mArgDatabase->isFlagSet( kOptHelp ) ) { return DoHelp(); } else if ( m_mArgDatabase->isFlagSet( "create" ) ) { return DoCreate(); } else if ( m_mArgDatabase->isFlagSet( "select" ) ) { return DoSelect(); } merr << "No valid operation specified via command line arguments" << std::endl; return MS::kFailure; }
static void Mouse(int button, int state, int mouseX, int mouseY) { GLint hit; if (state == GLUT_DOWN) { hit = DoSelect((GLint) mouseX, (GLint) mouseY); if (hit != -1) { if (button == GLUT_LEFT_BUTTON) { RecolorTri(hit); } else if (button == GLUT_MIDDLE_BUTTON) { GrowTri(hit); } else if (button == GLUT_RIGHT_BUTTON) { DeleteTri(hit); } glutPostRedisplay(); } } }
void wxListBox::Activate(int item) { if ( item != -1 ) SetCurrentItem(item); else item = m_current; if ( !(GetWindowStyle() & wxLB_MULTIPLE) ) { DeselectAll(item); } if ( item != -1 ) { DoSelect(item); SendEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); } }
void mouse(int button, int state, int mouseX, int mouseY) { GLint hit; if (state == GLUT_DOWN) { hit = DoSelect((GLint) mouseX, (GLint) mouseY); if (hit != -1) { if (button == GLUT_LEFT_BUTTON) { recolor_poly(hit); } else if (button == GLUT_MIDDLE_BUTTON) { resize_poly(hit); } else if (button == GLUT_RIGHT_BUTTON) { delete_poly(hit); } glutPostRedisplay(); } else { mutate(); } } }
void FieldStringEditor::do_xselection_request(Event& e) { int origin = display->Left(0, 0); int width = display->Width(); Poll(e); start_ = display->LineIndex(0, e.x); if (e.x < 0) { origin = Math::min(0, origin - e.x); } else if (e.x > xmax) { origin = Math::max( xmax - width, origin - (e.x - xmax) ); } display->Scroll(0, origin, ymax); index_ = display->LineIndex(0, e.x); DoSelect(start_, index_); XDisplay* disp = GetWorld()->display()->rep()->display_; unsigned int win = GetCanvas()->rep()->window_->rep()->xwindow_; Atom target_property = XInternAtom(disp, "PASTESTRING", false); int ret = XConvertSelection(disp, XA_PRIMARY, XA_STRING, target_property, win, e.rep()->xevent_.xbutton.time); }
//----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- MStatus CVstSelectCoincidentFacesCmd::redoIt() { MStatus mStatus; if ( !mStatus ) { setResult( MString( "Cannot parse command line" ) + mStatus.errorString() ); return MS::kFailure; } const MArgDatabase &mArgDatabase( m_undo.ArgDatabase() ); m_undo.SaveCurrentSelection(); if ( mArgDatabase.isFlagSet( kOptHelp ) ) { GetSyntaxHelp()->PrintHelp( GetName(), GetDesc() ); return MS::kSuccess; } return DoSelect(); }
void FieldStringEditor::do_select(Event& e) { int origin = display->Left(0, 0); int width = display->Width(); Poll(e); start_ = display->LineIndex(0, e.x); do { if (e.x < 0) { origin = Math::min(0, origin - e.x); } else if (e.x > xmax) { origin = Math::max( xmax - width, origin - (e.x - xmax) ); } display->Scroll(0, origin, ymax); index_ = display->LineIndex(0, e.x); DoSelect(start_, index_); Poll(e); } while (e.leftmouse); SelectionManager* s = e.display()->primary_selection(); s->own( new SelectionCallback(FieldStringEditor)(this, &FieldStringEditor::cut) ); }
/* The numArg here is the listbox item index while the strArg is used differently for the different actions: a) for wxACTION_LISTBOX_FIND it has the natural meaning: this is the string to find b) for wxACTION_LISTBOX_SELECT and wxACTION_LISTBOX_EXTENDSEL it is used to decide if the listbox should send the notification event (it is empty) or not (it is not): this allows us to reuse the same action for when the user is dragging the mouse when it has been released although in the first case no notification is sent while in the second it is sent. */ bool wxListBox::PerformAction(const wxControlAction& action, long numArg, const wxString& strArg) { int item = (int)numArg; if ( action == wxACTION_LISTBOX_SETFOCUS ) { SetCurrentItem(item); } else if ( action == wxACTION_LISTBOX_ACTIVATE ) { Activate(item); } else if ( action == wxACTION_LISTBOX_TOGGLE ) { if ( item == -1 ) item = m_current; if ( IsSelected(item) ) DoUnselect(item); else SelectAndNotify(item); } else if ( action == wxACTION_LISTBOX_SELECT ) { DeselectAll(item); if ( strArg.empty() ) SelectAndNotify(item); else DoSelect(item); } else if ( action == wxACTION_LISTBOX_SELECTADD ) DoSelect(item); else if ( action == wxACTION_LISTBOX_UNSELECT ) DoUnselect(item); else if ( action == wxACTION_LISTBOX_MOVEDOWN ) ChangeCurrent(1); else if ( action == wxACTION_LISTBOX_MOVEUP ) ChangeCurrent(-1); else if ( action == wxACTION_LISTBOX_PAGEDOWN ) ChangeCurrent(GetItemsPerPage()); else if ( action == wxACTION_LISTBOX_PAGEUP ) ChangeCurrent(-GetItemsPerPage()); else if ( action == wxACTION_LISTBOX_START ) SetCurrentItem(0); else if ( action == wxACTION_LISTBOX_END ) SetCurrentItem(GetCount() - 1); else if ( action == wxACTION_LISTBOX_UNSELECTALL ) DeselectAll(item); else if ( action == wxACTION_LISTBOX_EXTENDSEL ) ExtendSelection(item); else if ( action == wxACTION_LISTBOX_FIND ) FindNextItem(strArg); else if ( action == wxACTION_LISTBOX_ANCHOR ) AnchorSelection(item == -1 ? m_current : item); else if ( action == wxACTION_LISTBOX_SELECTALL || action == wxACTION_LISTBOX_SELTOGGLE ) wxFAIL_MSG(_T("unimplemented yet")); else return wxControl::PerformAction(action, numArg, strArg); return true; }
void wxListBox::SelectAndNotify(int item) { DoSelect(item); SendEvent(wxEVT_COMMAND_LISTBOX_SELECTED); }
void WindowStack::SelectNone() { DoSelect(NULL, wxEmptyString); }
void WindowStack::SelectNone() { DoSelect(NULL); }
void WindowStack::Select(wxWindow* win) { if(!Contains(win)) return; DoSelect(win); }
void wxGPACControl::OnSetSelection(wxCommandEvent &WXUNUSED(event)) { m_sel = m_select->GetSelection(); DoSelect(); }
wxGPACControl::wxGPACControl(wxWindow *parent) : wxDialog(parent, -1, wxString(wxT("GPAC Control Panel"))) { const char *sOpt; SetSize(320, 240); u32 i; wxBoxSizer *bs; Centre(); m_pApp = (wxOsmo4Frame *)parent; s_main = new wxBoxSizer(wxVERTICAL); s_header = new wxBoxSizer(wxHORIZONTAL); //s_header->Add(new wxStaticText(this, 0, wxT("Category"), wxDefaultPosition, wxSize(60, 20)), wxALIGN_CENTER); m_select = new wxComboBox(this, ID_SELECT, wxT(""), wxDefaultPosition, wxSize(120, 30), 0, NULL, wxCB_READONLY); s_header->Add(m_select, 2, wxALIGN_CENTER | wxADJUST_MINSIZE); s_header->Add( new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition, #ifdef WIN32 wxSize(40, 20) #else wxSize(40, 30) #endif ), 1, wxALIGN_TOP|wxALIGN_RIGHT|wxADJUST_MINSIZE); s_main->Add(s_header, 0, wxEXPAND, 0); /*general section*/ s_general = new wxBoxSizer(wxVERTICAL); m_loop = new wxCheckBox(this, 0, wxT("Loop at End"), wxPoint(10, 40), wxSize(140, 20)); s_general->Add(m_loop); m_lookforsubs = new wxCheckBox(this, 0, wxT("Look for Subtitles"), wxPoint(180, 40), wxSize(140, 20)); s_general->Add(m_lookforsubs); m_noconsole = new wxCheckBox(this, 0, wxT("Disable console messages"), wxPoint(10, 80), wxSize(180, 20)); s_general->Add(m_noconsole); m_viewxmt = new wxCheckBox(this, 0, wxT("View graph in XMT-A format"), wxPoint(10, 120), wxSize(180, 20)); s_general->Add(m_viewxmt); s_main->Add(s_general, 0, wxEXPAND, 0); /*MPEG-4 systems*/ s_mpeg4 = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Prefered Stream Language")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_lang = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_lang, wxALIGN_CENTER | wxADJUST_MINSIZE); s_mpeg4->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Decoder Threading Mode")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_thread = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_thread, wxALIGN_CENTER | wxADJUST_MINSIZE); s_mpeg4->Add(bs, 0, wxALL|wxEXPAND, 2); m_bifsalwaysdrawn = new wxCheckBox(this, 0, wxT("Always draw late BIFS frames")); s_mpeg4->Add(m_bifsalwaysdrawn); m_singletime = new wxCheckBox(this, 0, wxT("Force Single Timeline")); s_mpeg4->Add(m_singletime); s_main->Add(s_mpeg4, 0, wxEXPAND, 0); /*media decoders*/ s_mdec = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Prefered Audio Output")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_decaudio = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_decaudio, wxALIGN_CENTER | wxADJUST_MINSIZE); s_mdec->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Prefered Video Output")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_decvideo = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_decvideo, wxALIGN_CENTER | wxADJUST_MINSIZE); s_mdec->Add(bs, 0, wxALL|wxEXPAND, 2); s_main->Add(s_mdec, 0, wxEXPAND, 0); /*Rendering*/ s_rend = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Target Frame Rate")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_fps = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_fps, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Anti-Aliasing")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_aa = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_aa, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Graphics Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_graph = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_graph, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); m_draw_bounds = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(new wxStaticText(this, 0, wxT("Bounds")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); bs->Add(m_draw_bounds, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend->Add(bs, 0, wxALL|wxEXPAND, 2); m_fast = new wxCheckBox(this, 0, wxT("Fast Rendering")); m_force_size = new wxCheckBox(this, 0, wxT("Force Scene Size")); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(m_fast, wxALIGN_CENTER | wxADJUST_MINSIZE); bs->Add(m_force_size, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend->Add(bs, 0, wxALL|wxEXPAND, 2); m_use3D = new wxCheckBox(this, 0, wxT("Use 3D Renderer")); s_rend->Add(m_use3D, 0, wxALL|wxEXPAND, 2); m_bWas3D = m_use3D->GetValue(); s_main->Add(s_rend, 0, wxEXPAND, 0); /*Render 2D*/ s_rend2d = new wxBoxSizer(wxVERTICAL); m_direct = new wxCheckBox(this, 0, wxT("Direct Rendering")); s_rend2d->Add(m_direct, 0, wxALL|wxEXPAND, 2); m_scalable = new wxCheckBox(this, 0, wxT("Scalable Zoom")); s_rend2d->Add(m_scalable, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); m_noyuv = new wxCheckBox(this, 0, wxT("Disable YUV hardware")); bs->Add(m_noyuv, wxALIGN_CENTER | wxADJUST_MINSIZE); m_yuvtxt = new wxStaticText(this, 0, wxT("(No YUV used)"), wxDefaultPosition, wxSize(60, 20), wxALIGN_LEFT); bs->Add(m_yuvtxt, wxALIGN_CENTER|wxADJUST_MINSIZE); s_rend2d->Add(bs, 0, wxALL|wxEXPAND, 2); s_main->Add(s_rend2d, 0, wxEXPAND, 0); /*Render 3D*/ s_rend3d = new wxBoxSizer(wxVERTICAL); m_raster_outlines = new wxCheckBox(this, 0, wxT("Use OpenGL Raster outlines")); s_rend3d->Add(m_raster_outlines, 0, wxALL|wxEXPAND, 2); m_polyaa = new wxCheckBox(this, 0, wxT("Enable polygon anti-aliasing")); s_rend3d->Add(m_polyaa, 0, wxALL|wxEXPAND, 2); m_nobackcull = new wxCheckBox(this, 0, wxT("Disable backface culling")); s_rend3d->Add(m_nobackcull, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Wireframe mode")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_wire = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_wire, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend3d->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Draw Normals")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_normals = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_normals, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rend3d->Add(bs, 0, wxALL|wxEXPAND, 2); m_emulpow2 = new wxCheckBox(this, 0, wxT("Emulate power-of-two textures for video")); s_rend3d->Add(m_emulpow2, 0, wxALL|wxEXPAND, 2); m_norectext = new wxCheckBox(this, 0, wxT("Disable rectangular texture extensions")); s_rend3d->Add(m_norectext, 0, wxALL|wxEXPAND, 2); m_copypixels = new wxCheckBox(this, 0, wxT("Bitmap node uses direct pixel copy")); s_rend3d->Add(m_copypixels, 0, wxALL|wxEXPAND, 2); s_main->Add(s_rend3d, 0, wxEXPAND, 0); /*video*/ s_video = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Video Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_video = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_video , wxALIGN_CENTER | wxADJUST_MINSIZE); s_video->Add(bs, 0, wxALL|wxEXPAND, 2); m_switchres = new wxCheckBox(this, 0, wxT("Change video resolution in fullscreen")); s_video->Add(m_switchres, 0, wxALL|wxEXPAND, 2); m_usehwmem = new wxCheckBox(this, 0, wxT("Use hardware memory in 2D mode")); s_video->Add(m_usehwmem, 0, wxALL|wxEXPAND, 2); s_main->Add(s_video, 0, wxEXPAND, 0); /*audio*/ s_audio = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Audio Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_audio = new wxComboBox(this, ID_AUDIO_DRIVER, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_audio, wxALIGN_CENTER | wxADJUST_MINSIZE); s_audio->Add(bs, 0, wxALL|wxEXPAND, 2); m_forcecfg = new wxCheckBox(this, ID_FORCE_AUDIO, wxT("Force Audio Config")); m_forcecfg->SetValue(1); s_audio->Add(m_forcecfg, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Number of buffers")), wxALIGN_CENTER|wxADJUST_MINSIZE); m_nbbuf = new wxSpinCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(20, 20), wxSP_WRAP | wxSP_ARROW_KEYS, 1, 30, 15); m_nbbuf->SetValue(8); bs->Add(m_nbbuf, wxALIGN_CENTER | wxADJUST_MINSIZE); s_audio->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Total length in ms")), wxALIGN_CENTER | wxADJUST_MINSIZE); m_buflen = new wxSpinCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(20, 20), wxSP_WRAP | wxSP_ARROW_KEYS, 1, 1000); m_buflen->SetValue(400); bs->Add(m_buflen, wxALIGN_CENTER | wxADJUST_MINSIZE|wxLEFT,10); s_audio->Add(bs, 0, wxALL|wxEXPAND, 2); m_noresync = new wxCheckBox(this, -1, wxT("Disable Resynchronization")); s_audio->Add(m_noresync); m_nomulitch = new wxCheckBox(this, -1, wxT("Disable Multichannel")); s_audio->Add(m_nomulitch); #ifdef WIN32 m_notifs = new wxCheckBox(this, -1, wxT("Disable DirectSound Notifications")); s_audio->Add(m_notifs); #endif s_main->Add(s_audio, 0, wxEXPAND, 0); /*font*/ s_font = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Font Engine")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_font = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_font, wxALIGN_CENTER | wxADJUST_MINSIZE); s_font->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("System Font Directory")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_fontdir = new wxButton(this, ID_FONT_DIR, wxT("..."), wxDefaultPosition, wxDefaultSize); bs->Add(m_fontdir, wxALIGN_CENTER | wxADJUST_MINSIZE); s_font->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Text Texturing Mode")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_texturemode = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY); bs->Add(m_texturemode, wxALIGN_CENTER | wxADJUST_MINSIZE); s_font->Add(bs, 0, wxALL|wxEXPAND, 2); s_main->Add(s_font, 0, wxEXPAND, 0); /*download*/ s_dnld = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Cache Directory")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_cachedir = new wxButton(this, ID_CACHE_DIR, wxT("...")); bs->Add(m_cachedir, wxALIGN_CENTER | wxADJUST_MINSIZE); s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2); m_cleancache = new wxCheckBox(this, -1, wxT("Remove temp files on exit")); s_dnld->Add(m_cleancache); m_restartcache = new wxCheckBox(this, -1, wxT("Always redownload incomplete cached files")); s_dnld->Add(m_restartcache); bs = new wxBoxSizer(wxHORIZONTAL); m_progressive = new wxCheckBox(this, ID_PROGRESSIVE, wxT("XML progressive load")); bs->Add(m_progressive, wxALIGN_CENTER | wxADJUST_MINSIZE); m_sax_duration = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20)); bs->Add(m_sax_duration, wxALIGN_CENTER | wxADJUST_MINSIZE); bs->Add(new wxStaticText(this, 0, wxT("max load slice (ms)")), wxADJUST_MINSIZE | wxALIGN_CENTER); s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); m_use_proxy = new wxCheckBox(this, ID_USE_PROXY, wxT("Use proxy")); bs->Add(m_use_proxy, wxALIGN_CENTER | wxADJUST_MINSIZE); m_proxy_name = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20)); bs->Add(m_proxy_name, wxALIGN_CENTER | wxADJUST_MINSIZE); s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2); s_main->Add(s_dnld, 0, wxEXPAND, 0); /*streaming*/ s_stream = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Default RTSP port")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_port = new wxComboBox(this, ID_RTSP_PORT, wxT(""), wxPoint(160, 40), wxSize(140, 30), 0, NULL, wxCB_READONLY); bs->Add(m_port, wxALIGN_CENTER | wxADJUST_MINSIZE); s_stream->Add(bs, 0, wxALL|wxEXPAND, 2); m_rtsp = new wxCheckBox(this, ID_RTP_OVER_RTSP, wxT("RTP over RTSP"), wxPoint(10, 80), wxSize(140, 20)); m_reorder = new wxCheckBox(this, -1, wxT("use RTP reordering"), wxPoint(160, 80), wxSize(130, 20)); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(m_rtsp, wxALIGN_CENTER | wxADJUST_MINSIZE); bs->Add(m_reorder, wxALIGN_CENTER | wxADJUST_MINSIZE); s_stream->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); m_timeout = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20)); bs->Add(new wxStaticText(this, 0, wxT("Control Timeout (ms): ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); bs->Add(m_timeout, wxALIGN_CENTER | wxADJUST_MINSIZE); s_stream->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); m_buffer = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 150), wxSize(60, 20)); bs->Add(new wxStaticText(this, 0, wxT("Media Buffering (ms): ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); bs->Add(m_buffer, wxALIGN_CENTER | wxADJUST_MINSIZE); s_stream->Add(bs, 0, wxALL|wxEXPAND, 2); bs = new wxBoxSizer(wxHORIZONTAL); m_dorebuffer = new wxCheckBox(this, ID_RTSP_REBUFFER, wxT("Rebuffer if below")); bs->Add(m_dorebuffer, wxALIGN_CENTER | wxADJUST_MINSIZE); m_rebuffer = new wxTextCtrl(this, 0, wxT(""), wxPoint(200, 180), wxSize(60, 20)); bs->Add(m_rebuffer, wxALIGN_CENTER | wxADJUST_MINSIZE); m_rebuffer->Disable(); s_stream->Add(bs, 0, wxALL|wxEXPAND, 2); s_main->Add(s_stream, 0, wxEXPAND, 0); /*streaming cache*/ s_rec = new wxBoxSizer(wxVERTICAL); bs = new wxBoxSizer(wxHORIZONTAL); bs->Add(new wxStaticText(this, 0, wxT("Record To: ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT); m_recdir = new wxButton(this, ID_RECORD_DIR, wxT("...")); bs->Add(m_recdir, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rec->Add(bs, 0, wxALL|wxEXPAND, 2); m_overwrite = new wxCheckBox(this, -1, wxT("Overwrite existing files")); s_rec->Add(m_overwrite); bs = new wxBoxSizer(wxHORIZONTAL); m_usename = new wxCheckBox(this, ID_USE_FILENAME, wxT("Use filename")); m_recfile = new wxTextCtrl(this, 0, wxT("")); bs->Add(m_usename, wxALIGN_CENTER | wxADJUST_MINSIZE); bs->Add(m_recfile, wxALIGN_CENTER | wxADJUST_MINSIZE); s_rec->Add(bs, 0, wxALL|wxEXPAND, 2); s_main->Add(s_rec, 0, wxEXPAND, 0); /*load options*/ GF_Config *cfg = m_pApp->m_user.config; /*general*/ sOpt = gf_cfg_get_key(cfg, "General", "Loop"); m_loop->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "General", "LookForSubtitles"); m_lookforsubs->SetValue((sOpt && !stricmp(sOpt, "no")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "General", "ConsoleOff"); m_noconsole->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "General", "ViewXMT"); m_viewxmt->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); /*systems config*/ sOpt = gf_cfg_get_key(cfg, "Systems", "Language3CC"); if (!sOpt) sOpt = "eng"; u32 select = 0; i=0; while (GF_ISO639_Lang[i]) { /*only use common languages (having both 2- and 3-char code names)*/ if (GF_ISO639_Lang[i+2][0]) { m_lang->Append(wxString(GF_ISO639_Lang[i], wxConvUTF8) ); if (sOpt && !stricmp(sOpt, GF_ISO639_Lang[i+1])) select = m_lang->GetCount() - 1; } i+=3; } m_lang->SetSelection(select); sOpt = gf_cfg_get_key(cfg, "Systems", "ThreadingPolicy"); select = 0; m_thread->Append(wxT("Single Thread")); m_thread->Append(wxT("Mutli Thread")); if (sOpt && !stricmp(sOpt, "Multi")) select = 1; m_thread->Append(wxT("Free")); if (sOpt && !stricmp(sOpt, "Free")) select = 2; m_thread->SetSelection(select); sOpt = gf_cfg_get_key(cfg, "Systems", "ForceSingleClock"); m_singletime->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Systems", "AlwaysDrawBIFS"); m_bifsalwaysdrawn->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); /*audio dec enum*/ sOpt = gf_cfg_get_key(cfg, "Systems", "DefAudioDec"); u32 count = gf_modules_get_count(m_pApp->m_user.modules); GF_BaseDecoder *ifc_d; select = 0; s32 to_sel = 0; for (i=0; i<count; i++) { ifc_d = (GF_BaseDecoder *) gf_modules_load_interface(m_pApp->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE); if (!ifc_d) continue; if (ifc_d->CanHandleStream(ifc_d, GF_STREAM_AUDIO, NULL, 0)) { if (sOpt && !stricmp(ifc_d->module_name, sOpt)) select = to_sel; m_decaudio->Append(wxString(ifc_d->module_name, wxConvUTF8) ); to_sel++; } gf_modules_close_interface((GF_BaseInterface *) ifc_d); } m_decaudio->SetSelection(select); /*video dec enum*/ sOpt = gf_cfg_get_key(cfg, "Systems", "DefVideoDec"); select = to_sel = 0; for (i=0; i<count; i++) { ifc_d = (GF_BaseDecoder *) gf_modules_load_interface(m_pApp->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE); if (!ifc_d) continue; if (ifc_d->CanHandleStream(ifc_d, GF_STREAM_VISUAL, NULL, 0)) { if (sOpt && !stricmp(ifc_d->module_name, sOpt)) select = to_sel; m_decvideo->Append(wxString(ifc_d->module_name, wxConvUTF8) ); to_sel++; } gf_modules_close_interface((GF_BaseInterface *) ifc_d); } m_decvideo->SetSelection(select); /*rendering FIXME*/ m_bWas3D = 0; m_use3D->SetValue(m_bWas3D ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "ForceSceneSize"); m_force_size->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "FrameRate"); if (!sOpt) sOpt = "30.0"; select = 0; for (i = 0; i<NUM_RATES; i++) { m_fps->Append(wxString(BIFSRates[i], wxConvUTF8) ); if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i; } m_fps->SetSelection(select); sOpt = gf_cfg_get_key(cfg, "Compositor", "HighSpeed"); m_fast->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "AntiAlias"); m_aa->Append(wxT("None")); m_aa->Append(wxT("Text only")); m_aa->Append(wxT("Complete")); select = 2; if (sOpt && !stricmp(sOpt, "Text")) select = 1; else if (sOpt && !stricmp(sOpt, "None")) select = 0; m_aa->SetSelection(select); sOpt = gf_cfg_get_key(cfg, "Compositor", "BoundingVolume"); m_draw_bounds->Append(wxT("None")); m_draw_bounds->Append(wxT("Box/Rect")); m_draw_bounds->Append(wxT("AABB Tree")); select = 0; if (sOpt && !stricmp(sOpt, "Box")) select = 1; else if (sOpt && !stricmp(sOpt, "AABB")) select = 2; m_draw_bounds->SetSelection(select); /*render2d*/ sOpt = gf_cfg_get_key(cfg, "Compositor", "DirectDraw"); m_direct->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "ScalableZoom"); m_scalable->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "DisableYUV"); m_noyuv->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); SetYUVLabel(); /*graphics driver enum*/ sOpt = gf_cfg_get_key(cfg, "Compositor", "Raster2D"); GF_BaseInterface *ifce; select = to_sel = 0; for (i=0; i<count; i++) { ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_RASTER_2D_INTERFACE); if (!ifce) continue; if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel; m_graph->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) ); gf_modules_close_interface(ifce); to_sel++; } m_graph->SetSelection(select); /*render3d*/ sOpt = gf_cfg_get_key(cfg, "Compositor", "RasterOutlines"); m_raster_outlines->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "EmulatePOW2"); m_emulpow2->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "PolygonAA"); m_polyaa->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "BackFaceCulling"); m_nobackcull->SetValue((sOpt && !stricmp(sOpt, "Off")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "Wireframe"); sOpt = gf_cfg_get_key(cfg, "Compositor", "BitmapCopyPixels"); m_copypixels->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Compositor", "DisableRectExt"); m_norectext->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); m_wire->Append(wxT("No Wireframe")); m_wire->Append(wxT("Wireframe Only")); m_wire->Append(wxT("Solid and Wireframe")); sOpt = gf_cfg_get_key(cfg, "Compositor", "Wireframe"); if (sOpt && !stricmp(sOpt, "WireOnly")) m_wire->SetSelection(1); else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_wire->SetSelection(2); else m_wire->SetSelection(0); m_normals->Append(wxT("Never")); m_normals->Append(wxT("Per Face")); m_normals->Append(wxT("Per Vertex")); sOpt = gf_cfg_get_key(cfg, "Compositor", "DrawNormals"); if (sOpt && !stricmp(sOpt, "PerFace")) m_normals->SetSelection(1); else if (sOpt && !stricmp(sOpt, "PerVertex")) m_normals->SetSelection(2); else m_normals->SetSelection(0); /*video*/ sOpt = gf_cfg_get_key(cfg, "Video", "SwitchResolution"); m_switchres->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Video", "UseHardwareMemory"); m_usehwmem->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Video", "DriverName"); select = to_sel = 0; for (i=0; i<count; i++) { ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_VIDEO_OUTPUT_INTERFACE); if (!ifce) continue; if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel; m_video->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) ); gf_modules_close_interface(ifce); to_sel++; } m_video->SetSelection(select); /*audio*/ sOpt = gf_cfg_get_key(cfg, "Audio", "ForceConfig"); m_forcecfg->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Audio", "NumBuffers"); m_nbbuf->SetValue( sOpt ? wxString(sOpt, wxConvUTF8) : wxT("2")); sOpt = gf_cfg_get_key(cfg, "Audio", "TotalDuration"); m_buflen->SetValue( sOpt ? wxString(sOpt, wxConvUTF8) : wxT("120")); wxCommandEvent event; ForceAudio(event); sOpt = gf_cfg_get_key(cfg, "Audio", "NoResync"); m_noresync->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Audio", "DisableMultiChannel"); m_nomulitch->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); /*driver enum*/ sOpt = gf_cfg_get_key(cfg, "Audio", "DriverName"); select = to_sel = 0; for (i=0; i<count; i++) { ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE); if (!ifce) continue; if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel; m_audio->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) ); gf_modules_close_interface(ifce); to_sel++; } m_audio->SetSelection(select); #ifdef WIN32 sOpt = gf_cfg_get_key(cfg, "Audio", "DisableNotification"); m_notifs->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); wxCommandEvent audevt; OnSetAudioDriver(audevt); #endif /*font*/ sOpt = gf_cfg_get_key(cfg, "FontEngine", "FontReader"); to_sel = select = 0; for (i=0; i<count; i++) { ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_FONT_READER_INTERFACE); if (!ifce) continue; if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel; m_font->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) ); gf_modules_close_interface(ifce); to_sel++; } m_font->SetSelection(select); sOpt = gf_cfg_get_key(cfg, "FontEngine", "FontDirectory"); if (sOpt) m_fontdir->SetLabel(wxString(sOpt, wxConvUTF8) ); sOpt = gf_cfg_get_key(cfg, "Compositor", "TextureTextMode"); m_texturemode->Append(wxT("Default")); m_texturemode->Append(wxT("Never")); m_texturemode->Append(wxT("Always")); if (sOpt && !stricmp(sOpt, "Always")) m_texturemode->SetSelection(2); else if (sOpt && !stricmp(sOpt, "3D")) m_texturemode->SetSelection(1); else m_texturemode->SetSelection(0); /*downloader*/ sOpt = gf_cfg_get_key(cfg, "General", "CacheDirectory"); if (sOpt) m_cachedir->SetLabel(wxString(sOpt, wxConvUTF8) ); sOpt = gf_cfg_get_key(cfg, "Downloader", "CleanCache"); m_cleancache->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "Downloader", "RestartFiles"); m_restartcache->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "SAXLoader", "Progressive"); m_progressive->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); sOpt = gf_cfg_get_key(cfg, "SAXLoader", "MaxDuration"); m_sax_duration->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("30")); if (! m_progressive->GetValue()) m_sax_duration->Enable(0); sOpt = gf_cfg_get_key(cfg, "HTTPProxy", "Enabled"); m_use_proxy->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0); char szProxy[GF_MAX_PATH]; strcpy(szProxy, ""); sOpt = gf_cfg_get_key(cfg, "HTTPProxy", "Name"); if (sOpt) { strcat(szProxy, sOpt); sOpt = gf_cfg_get_key(cfg, "HTTPProxy", "Port"); if (sOpt) { strcat(szProxy, ":"); strcat(szProxy, sOpt); } } else { m_use_proxy->SetValue(0); } m_proxy_name->SetValue( wxString((char *)szProxy, wxConvUTF8) ); if (! m_use_proxy->GetValue()) m_proxy_name->Enable(0); /*streaming*/ m_port->Append(wxT("554 (RTSP standard)")); m_port->Append(wxT("7070 (RTSP ext)")); m_port->Append(wxT("80 (RTSP / HTTP tunnel)")); m_port->Append(wxT("8080 (RTSP / HTTP tunnel)")); sOpt = gf_cfg_get_key(cfg, "Streaming", "DefaultPort"); u32 port = 554; Bool force_rtsp = 0; if (sOpt) port = atoi(sOpt); switch (port) { case 8080: m_port->SetSelection(3); force_rtsp = 1; break; case 80: m_port->SetSelection(2); force_rtsp = 1; break; case 7070: m_port->SetSelection(1); break; default: m_port->SetSelection(0); break; } Bool use_rtsp = 0; sOpt = gf_cfg_get_key(cfg, "Streaming", "RTPoverRTSP"); if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = 1; if (force_rtsp) { m_rtsp->SetValue(1); m_rtsp->Enable(0); m_reorder->SetValue(0); m_reorder->Enable(0); } else { m_rtsp->SetValue(use_rtsp ? 1 : 0); m_rtsp->Enable(1); m_reorder->Enable(1); sOpt = gf_cfg_get_key(cfg, "Streaming", "ReorderSize"); m_reorder->SetValue( (sOpt && !stricmp(sOpt, "0")) ? 1 : 0); } sOpt = gf_cfg_get_key(cfg, "Streaming", "RTSPTimeout"); m_timeout->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("30000")); sOpt = gf_cfg_get_key(cfg, "Network", "BufferLength"); m_buffer->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("3000")); sOpt = gf_cfg_get_key(cfg, "Network", "RebufferLength"); u32 buf_len = 0; if (sOpt) buf_len = atoi(sOpt); if (buf_len) { m_dorebuffer->SetValue(1); m_rebuffer->SetValue(wxString(sOpt, wxConvUTF8)); m_rebuffer->Enable(1); } else { m_dorebuffer->SetValue(0); m_rebuffer->SetValue(wxT("0")); m_rebuffer->Enable(0); } RTPoverRTSP(event); sOpt = gf_cfg_get_key(cfg, "StreamingCache", "RecordDirectory"); if (!sOpt) sOpt = gf_cfg_get_key(cfg, "General", "CacheDirectory"); if (sOpt) m_recdir->SetLabel(wxString(sOpt, wxConvUTF8)); sOpt = gf_cfg_get_key(cfg, "StreamingCache", "KeepExistingFiles"); m_overwrite->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 0 : 1); sOpt = gf_cfg_get_key(cfg, "StreamingCache", "BaseFileName"); if (sOpt) { m_usename->SetValue(1); m_recfile->Enable(1); m_recfile->SetValue(wxString(sOpt, wxConvUTF8)); } else { m_usename->SetValue(0); m_recfile->Enable(0); m_recfile->SetValue(wxT("uses service URL")); } m_select->Append(wxT("General")); m_select->Append(wxT("MPEG-4 Systems")); m_select->Append(wxT("Media Decoders")); m_select->Append(wxT("Compositor")); m_select->Append(wxT("Renderer 2D")); m_select->Append(wxT("Renderer 3D")); m_select->Append(wxT("Video Output")); m_select->Append(wxT("Audio Output")); m_select->Append(wxT("Text Engine")); m_select->Append(wxT("File Download")); m_select->Append(wxT("Real-Time Streaming")); m_select->Append(wxT("Streaming Cache")); sOpt = gf_cfg_get_key(cfg, "General", "ConfigPanel"); m_sel = sOpt ? atoi(sOpt) : 0; if (m_sel>11) m_sel=11; m_select->SetSelection(m_sel); DoSelect(); }
CHEWING_API int chewing_handle_Default( ChewingContext *ctx, int key ) { ChewingData *pgdata = ctx->data; ChewingOutput *pgo = ctx->output; int rtn, num; int keystrokeRtn = KEYSTROKE_ABSORB; int bQuickCommit = 0; /* Update lifetime */ chewing_lifetime++; /* Skip the special key */ if ( key & 0xFF00 ) { keystrokeRtn = KEYSTROKE_IGNORE; goto End_KeyDefault; } /* We ignore non-printable input */ if ( ! isprint( key ) ) goto End_KeyDefault; CheckAndResetRange( pgdata ); DEBUG_CHECKPOINT(); DEBUG_OUT( " key=%d", key ); /* Dvorak Hsu */ if ( pgdata->zuinData.kbtype == KB_DVORAK_HSU ) { key = dvorak_convert( key ); } /* selecting */ if ( pgdata->bSelect ) { if ( key == ' ' ) return chewing_handle_Right( ctx ); /* num starts from 0 */ num = CountSelKeyNum( key, pgdata ); if ( num >= 0 ) { DoSelect( pgdata, num ); goto End_keyproc; } /* Otherwise, use 'j' and 'k' for paging in selection mode */ DEBUG_OUT( "\t\tchecking paging key, got '%c'\n", key ); switch ( key ) { case 'j': case 'J': if ( pgdata->chiSymbolCursor > 0 ) { if ( ! ChewingIsEntering( pgdata ) ) { keystrokeRtn = KEYSTROKE_IGNORE; } CheckAndResetRange( pgdata ); pgdata->chiSymbolCursor--; ChoiceFirstAvail( pgdata ); } goto End_Paging; case 'k': case 'K': if ( pgdata->chiSymbolCursor < pgdata->chiSymbolBufLen ) { if ( ! ChewingIsEntering( pgdata ) ) { keystrokeRtn = KEYSTROKE_IGNORE; } CheckAndResetRange( pgdata ); pgdata->chiSymbolCursor++; ChoiceFirstAvail( pgdata ); } goto End_Paging; default: break; } } /* editing */ else { if ( pgdata->bChiSym == CHINESE_MODE ) { if ( pgdata->config.bEasySymbolInput != 0 ) { EasySymbolInput( key, pgdata, pgo ); goto End_keyproc; } /* open symbol table */ if ( key == '`' ) { pgdata->bSelect = 1; pgdata->choiceInfo.oldChiSymbolCursor = pgdata->chiSymbolCursor; HaninSymbolInput( &( pgdata->choiceInfo ), &( pgdata->availInfo ), pgdata->phoneSeq, pgdata->config.candPerPage ); goto End_KeyDefault; } rtn = ZuinPhoInput( &( pgdata->zuinData ), key ); DEBUG_OUT( "\t\tChinese mode key, " "ZuinPhoInput return value = %d\n", rtn ); DEBUG_FLUSH; if ( rtn == ZUIN_KEY_ERROR ) rtn = SpecialSymbolInput( key, pgdata ); switch ( rtn ) { case ZUIN_ABSORB: keystrokeRtn = KEYSTROKE_ABSORB; break; case ZUIN_COMMIT: AddChi( pgdata->zuinData.phone, pgdata ); break; case ZUIN_NO_WORD: keystrokeRtn = KEYSTROKE_BELL | KEYSTROKE_ABSORB; break; case ZUIN_KEY_ERROR: case ZUIN_IGNORE: DEBUG_OUT( "\t\tbefore isupper(key),key=%d\n", key ); /* change upper case into lower case */ if ( isupper( key ) ) key = tolower( key ); DEBUG_OUT( "\t\tafter isupper(key),key=%d\n", key ); /* see if buffer contains nothing */ if ( pgdata->chiSymbolBufLen == 0 ) { bQuickCommit = 1; } if ( pgdata->config.bEasySymbolInput == 0 ) { if ( pgdata->bFullShape ) rtn = FullShapeSymbolInput( key, pgdata ); else rtn = SymbolInput( key, pgdata ); } if ( rtn == SYMBOL_KEY_ERROR ) { keystrokeRtn = KEYSTROKE_IGNORE; /* * If the key is not a printable symbol, * then it's wrong to commit it. */ bQuickCommit = 0; } else keystrokeRtn = KEYSTROKE_ABSORB; break; } } /* English mode */ else { /* see if buffer contains nothing */ if ( pgdata->chiSymbolBufLen == 0 ) { bQuickCommit = 1; } if ( pgdata->bFullShape ) { rtn = FullShapeSymbolInput( key, pgdata ); } else { rtn = SymbolInput( key, pgdata ); } if ( rtn == SYMBOL_KEY_ERROR ) { keystrokeRtn = KEYSTROKE_IGNORE; bQuickCommit = 0; } } } End_keyproc: if ( ! bQuickCommit ) { CallPhrasing( pgdata ); if ( ReleaseChiSymbolBuf( pgdata, pgo ) != 0 ) keystrokeRtn = KEYSTROKE_COMMIT; } /* Quick commit */ else { DEBUG_OUT( "\t\tQuick commit buf[0]=%c\n", pgdata->chiSymbolBuf[ 0 ].s[ 0 ] ); pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ]; pgo->nCommitStr = 1; pgdata->chiSymbolBufLen = 0; pgdata->chiSymbolCursor = 0; keystrokeRtn = KEYSTROKE_COMMIT; } if ( pgdata->phrOut.nNumCut > 0 ) { int i; for ( i = 0; i < pgdata->phrOut.nDispInterval; i++ ) { pgdata->bUserArrBrkpt[ pgdata->phrOut.dispInterval[ i ].from ] = 1; pgdata->bUserArrBrkpt[ pgdata->phrOut.dispInterval[ i ].to ] = 1; } pgdata->phrOut.nNumCut = 0; } End_KeyDefault: CallPhrasing( pgdata ); End_Paging: MakeOutputWithRtn( pgo, pgdata, keystrokeRtn ); return 0; }
bool wxSelectDispatcher::HasPending() const { wxSelectSets sets(m_sets); return DoSelect(sets, 0) > 0; }
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap) : wxWindowDCImpl( owner ) { Init(); DoSelect(bitmap); }