MOUSEControls::MOUSEControls() : _proto(nullptr) { ui.setupUi( this ); ui.cbxSelectMouse_X->addItem("None"); ui.cbxSelectMouse_X->addItem("X"); ui.cbxSelectMouse_X->addItem("Y"); ui.cbxSelectMouse_X->addItem("Z"); ui.cbxSelectMouse_X->addItem("Yaw"); ui.cbxSelectMouse_X->addItem("Pitch"); ui.cbxSelectMouse_X->addItem("Roll"); ui.cbxSelectMouse_Y->addItem("None"); ui.cbxSelectMouse_Y->addItem("X"); ui.cbxSelectMouse_Y->addItem("Y"); ui.cbxSelectMouse_Y->addItem("Z"); ui.cbxSelectMouse_Y->addItem("Yaw"); ui.cbxSelectMouse_Y->addItem("Pitch"); ui.cbxSelectMouse_Y->addItem("Roll"); connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); tie_setting(s.Mouse_X, ui.cbxSelectMouse_X); tie_setting(s.Mouse_Y, ui.cbxSelectMouse_Y); }
// // Constructor for server-settings-dialog // FTControls::FTControls() : QWidget() { QString aFileName; // File Path and Name ui.setupUi( this ); // Connect Qt signals to member-functions connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); connect(ui.bntLocateNPClient, SIGNAL(clicked()), this, SLOT(selectDLL())); tie_setting(s.intUsedInterface, ui.cbxSelectInterface); tie_setting(s.useDummyExe, ui.chkStartDummy); tie_setting(s.useTIRViews, ui.chkTIRViews); ui.cbxSelectInterface->addItem("Enable both"); ui.cbxSelectInterface->addItem("Use FreeTrack, hide TrackIR"); ui.cbxSelectInterface->addItem("Use TrackIR, hide FreeTrack"); aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll"; if ( !QFile::exists( aFileName ) ) { ui.chkTIRViews->setChecked( false ); ui.chkTIRViews->setEnabled ( false ); } else { ui.chkTIRViews->setEnabled ( true ); } }
FilterControls::FilterControls() : QWidget(), pFilter(NULL) { ui.setupUi( this ); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); tie_setting(s.kMaxSmoothing, ui.maxSmooth); tie_setting(s.kMinSmoothing, ui.minSmooth); tie_setting(s.kSmoothingScaleCurve, ui.powCurve); }
// // Constructor for server-settings-dialog // FGControls::FGControls() : theProtocol(nullptr) { ui.setupUi( this ); tie_setting(s.ip1, ui.spinIPFirstNibble); tie_setting(s.ip2, ui.spinIPSecondNibble); tie_setting(s.ip3, ui.spinIPThirdNibble); tie_setting(s.ip4, ui.spinIPFourthNibble); tie_setting(s.port, ui.spinPortNumber); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); }
FTNControls::FTNControls() : QWidget() { ui.setupUi( this ); tie_setting(s.ip1, ui.spinIPFirstNibble); tie_setting(s.ip2, ui.spinIPSecondNibble); tie_setting(s.ip3, ui.spinIPThirdNibble); tie_setting(s.ip4, ui.spinIPFourthNibble); tie_setting(s.port, ui.spinPortNumber); connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); }
KeyboardShortcutDialog::KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent ) : QWidget( parent, Qt::Dialog) { ui.setupUi( this ); QPoint offsetpos(100, 100); this->move(parent->pos() + offsetpos); mainApp = ftnoir; // Preserve a pointer to FTNoIR // Connect Qt signals to member-functions connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); for ( int i = 0; i < global_key_sequences.size(); i++) { ui.cbxCenterKey->addItem(global_key_sequences.at(i)); ui.cbxToggleKey->addItem(global_key_sequences.at(i)); } tie_setting(mainApp->s.center_key.key_index, ui.cbxCenterKey); tie_setting(mainApp->s.center_key.alt, ui.chkCenterAlt); tie_setting(mainApp->s.center_key.shift, ui.chkCenterShift); tie_setting(mainApp->s.center_key.ctrl, ui.chkCenterCtrl); tie_setting(mainApp->s.toggle_key.key_index, ui.cbxToggleKey); tie_setting(mainApp->s.toggle_key.alt, ui.chkToggleAlt); tie_setting(mainApp->s.toggle_key.shift, ui.chkToggleShift); tie_setting(mainApp->s.toggle_key.ctrl, ui.chkToggleCtrl); }
TrackerControls::TrackerControls() : tracker(nullptr) { ui.setupUi( this ); // Connect Qt signals to member-functions connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); { auto hr = CoInitialize( nullptr ); LPDIRECTINPUT8 g_pDI = nullptr; if( FAILED( hr = DirectInput8Create( GetModuleHandle( NULL ), DIRECTINPUT_VERSION, IID_IDirectInput8, ( VOID** )&g_pDI, NULL ) ) ) goto fin; if( FAILED( hr = g_pDI->EnumDevices( DI8DEVCLASS_GAMECTRL, EnumJoysticksCallback, this, DIEDFL_ATTACHEDONLY ))) goto fin; fin: if (g_pDI) g_pDI->Release(); } tie_setting(s.joyid, ui.joylist); }
FSUIPCControls::FSUIPCControls() { ui.setupUi( this ); connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); connect(ui.btnFindDLL, SIGNAL(clicked()), this, SLOT(getLocationOfDLL())); tie_setting(s.LocationOfDLL, ui.txtLocationOfDLL); }
TrackerControls::TrackerControls() : QWidget() { ui.setupUi( this ); // Connect Qt signals to member-functions connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); tie_setting(s.bEnableYaw, ui.chkEnableYaw); tie_setting(s.bEnablePitch, ui.chkEnablePitch); tie_setting(s.bEnableRoll, ui.chkEnableRoll); tie_setting(s.constant_drift, ui.constantDrift); tie_setting(s.deadzone, ui.deadzone); tie_setting(s.persistence, ui.persistence); tie_setting(s.useYawSpring, ui.yawSpring); }
FaceTrackNoIR::FaceTrackNoIR(QWidget *parent) : QMainWindow(parent), #if defined(_WIN32) keybindingWorker(NULL), #else keyCenter(this), keyToggle(this), #endif b(bundle("opentrack-ui")), s(b), pose(std::vector<axis_opts*>{&s.a_x, &s.a_y, &s.a_z, &s.a_yaw, &s.a_pitch, &s.a_roll}), timUpdateHeadPose(this), pTrackerDialog(NULL), pSecondTrackerDialog(NULL), pProtocolDialog(NULL), pFilterDialog(NULL), kbd_quit(QKeySequence("Ctrl+Q"), this), looping(0) { ui.setupUi(this); setFixedSize(size()); _keyboard_shortcuts = 0; _curve_config = 0; tracker = 0; CurveConfigurationDialog* ccd; if (!_curve_config) { ccd = new CurveConfigurationDialog( this, this ); _curve_config = ccd; } else { ccd = dynamic_cast<CurveConfigurationDialog*>(_curve_config); } QDir::setCurrent(QCoreApplication::applicationDirPath()); fill_profile_cbx(); connect(ui.btnLoad, SIGNAL(clicked()), this, SLOT(open())); connect(ui.btnSave, SIGNAL(clicked()), this, SLOT(save())); connect(ui.btnSaveAs, SIGNAL(clicked()), this, SLOT(saveAs())); connect(ui.btnEditCurves, SIGNAL(clicked()), this, SLOT(showCurveConfiguration())); connect(ui.btnShortcuts, SIGNAL(clicked()), this, SLOT(showKeyboardShortcuts())); connect(ui.btnShowEngineControls, SIGNAL(clicked()), this, SLOT(showTrackerSettings())); connect(ui.btnShowSecondTrackerSettings, SIGNAL(clicked()), this, SLOT(showSecondTrackerSettings())); connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showServerControls())); connect(ui.btnShowFilterControls, SIGNAL(clicked()), this, SLOT(showFilterControls())); ui.cbxSecondTrackerSource->addItem(QIcon(), ""); dlopen_filters.push_back((DynamicLibrary*) NULL); ui.iconcomboFilter->addItem(QIcon(), ""); fill_combobox("opentrack-proto-*.", dlopen_protocols, ui.iconcomboProtocol, NULL); fill_combobox("opentrack-tracker-*.", dlopen_trackers, ui.iconcomboTrackerSource, ui.cbxSecondTrackerSource); fill_combobox("opentrack-filter-*.", dlopen_filters, ui.iconcomboFilter, NULL); tie_setting(s.tracker_dll, ui.iconcomboTrackerSource); tie_setting(s.tracker2_dll, ui.cbxSecondTrackerSource); tie_setting(s.protocol_dll, ui.iconcomboProtocol); tie_setting(s.filter_dll, ui.iconcomboFilter); connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker())); connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stopTracker())); GetCameraNameDX(); connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int))); connect(&timUpdateHeadPose, SIGNAL(timeout()), this, SLOT(showHeadPose())); #ifndef _WIN32 connect(&keyCenter, SIGNAL(activated()), this, SLOT(shortcutRecentered())); connect(&keyToggle, SIGNAL(activated()), this, SLOT(shortcutToggled())); #endif connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); kbd_quit.setEnabled(true); }