From 3089c4bbc10e98d18f43e8a70e7a3d0c0eaf0900 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 22 Mar 2013 20:48:17 +0100 Subject: Downcase. PLEASE TURN OFF IGNORING CASE IN GIT CONFIG!!! .git/config: [core] ignorecase = false --- .../ftnoir_tracker_facedetect_dialog.cpp | 180 --------------------- 1 file changed, 180 deletions(-) delete mode 100644 FTNoIR_Tracker_FD/ftnoir_tracker_facedetect_dialog.cpp (limited to 'FTNoIR_Tracker_FD/ftnoir_tracker_facedetect_dialog.cpp') diff --git a/FTNoIR_Tracker_FD/ftnoir_tracker_facedetect_dialog.cpp b/FTNoIR_Tracker_FD/ftnoir_tracker_facedetect_dialog.cpp deleted file mode 100644 index 71b19242..00000000 --- a/FTNoIR_Tracker_FD/ftnoir_tracker_facedetect_dialog.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (c) 2012 Stanislaw Halik - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - */ - -#include "ftnoir_tracker_fd.h" -#include -#include -#include - -//******************************************************************************************************* -// faceDetect Settings-dialog. -//******************************************************************************************************* - -static void load_settings(struct face_detect_settings* out) { - qDebug("[!] load_settings()"); - QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) - - QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); - QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - - iniFile.beginGroup ( "FaceDetectTracker" ); - out->redetect_ms = iniFile.value("RedetectMs", 500).toInt(); - out->camera_id = iniFile.value("CameraId", 0).toInt(); - out->quit = 0; - out->newOutput = 0; - out->magic = FD_MAGIC; - out->widgetp = iniFile.value("VideoWidget", true).toBool(); - iniFile.endGroup (); -} - -static void save_settings(const struct face_detect_settings* in) { - - QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) - - QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); - QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - - iniFile.beginGroup ( "FaceDetectTracker" ); - iniFile.setValue("RedetectMs", in->redetect_ms); - iniFile.setValue("CameraId", in->camera_id); - iniFile.setValue("VideoWidget", in->widgetp); - iniFile.endGroup (); -} - - -// -// Constructor for server-settings-dialog -// -TrackerControls::TrackerControls() : -QWidget() -{ - qDebug("[!] TrackerControls::TrackerControls()"); - hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(struct face_detect_shm), fd_shm_name); - shm = (struct face_detect_shm*) MapViewOfFile(hMapFile, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, sizeof(struct face_detect_shm)); - hMutex = CreateMutex(NULL, false, fd_mutex_name); - ui.setupUi( this ); - - load_settings(&shm->settings); - - ui.redetect_ms->setValue(shm->settings.redetect_ms); - ui.cameraId->setValue(shm->settings.camera_id); - ui.videoWidget->setChecked(shm->settings.widgetp); - - settingsDirty = false; - - // what a load of boilerplate... - QObject::connect(ui.okButton, SIGNAL(clicked()), this, SLOT(doOK())); - QObject::connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(doCancel())); - QObject::connect(ui.redetect_ms, SIGNAL(valueChanged(int)), this, SLOT(doSetRedetectMs(int))); - QObject::connect(ui.cameraId, SIGNAL(valueChanged(int)), this, SLOT(doSetCameraId(int))); - QObject::connect(ui.videoWidget, SIGNAL(toggled(bool)), this, SLOT(doSetVideoWidget(bool))); -} - -void TrackerControls::save() { - save_settings(&shm->settings); - settingsDirty = false; -} - -void TrackerControls::doSetCameraId(int val) { - settingsDirty = true; - WaitForSingleObject(hMutex, INFINITE); - shm->settings.camera_id = val; - ReleaseMutex(hMutex); -} - -void TrackerControls::doSetVideoWidget(bool val) { - settingsDirty = true; - WaitForSingleObject(hMutex, INFINITE); - shm->settings.widgetp = val; - ReleaseMutex(hMutex); -} - -void TrackerControls::doSetRedetectMs(int val) { - settingsDirty = true; - WaitForSingleObject(hMutex, INFINITE); - shm->settings.redetect_ms = val; - ReleaseMutex(hMutex); -} - -// -// Destructor for server-dialog -// -TrackerControls::~TrackerControls() { - UnmapViewOfFile(shm); - //CloseHandle(hMutex); - //CloseHandle(hMapFile); -} - -void TrackerControls::Release() -{ - delete this; -} - -// -// Initialize tracker-client-dialog -// -void TrackerControls::Initialize(QWidget *parent) { - - QPoint offsetpos(200, 200); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - -// -// OK clicked on server-dialog -// -void TrackerControls::doOK() { - save(); - this->close(); -} - -// -// Cancel clicked on server-dialog -// -void TrackerControls::doCancel() { - // - // Ask if changed Settings should be saved - // - if (settingsDirty) { - int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard ); - - switch (ret) { - case QMessageBox::Save: - save(); - this->close(); - break; - case QMessageBox::Discard: - this->close(); - break; - case QMessageBox::Cancel: - // Cancel was clicked - break; - default: - // should never be reached - break; - } - } - else { - this->close(); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Factory function that creates instances if the Tracker-settings dialog object. - -// Export both decorated and undecorated names. -// GetTrackerDialog - Undecorated name, which can be easily used with GetProcAddress -// Win32 API function. -// _GetTrackerDialog@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0") - -FTNOIR_TRACKER_BASE_EXPORT ITrackerDialogPtr __stdcall GetTrackerDialog( ) -{ - return new TrackerControls; -} -- cgit v1.2.3