summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_filter_accela
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-04-02 18:41:01 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-04-02 18:41:01 +0200
commit8303597a865400a363ae574ccde819302495f498 (patch)
treec83b383b3ec818f610cc6137f2b72ee7b4173b09 /ftnoir_filter_accela
parent8adf6b1650af6027f28db12ca2b4de92a3fac11d (diff)
Just put everything new in. Conflict resolution will be later
Diffstat (limited to 'ftnoir_filter_accela')
-rw-r--r--ftnoir_filter_accela/default-points.cpp38
-rw-r--r--ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui451
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp31
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.h65
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp23
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela_dll.cpp9
6 files changed, 544 insertions, 73 deletions
diff --git a/ftnoir_filter_accela/default-points.cpp b/ftnoir_filter_accela/default-points.cpp
new file mode 100644
index 00000000..2cebff6c
--- /dev/null
+++ b/ftnoir_filter_accela/default-points.cpp
@@ -0,0 +1,38 @@
+#include <QList>
+#include <QPointF>
+
+static QList<QPointF> EmptyList() {
+ return QList<QPointF>();
+}
+
+extern const QList<QPointF> defScaleRotation, defScaleTranslation;
+
+const QList<QPointF> defScaleRotation =
+ EmptyList()
+ << QPointF(0, 0)
+ << QPointF(0.308900523560209, 0.0666666666666667)
+ << QPointF(0.565445026178011, 0.226666666666667)
+ << QPointF(0.769633507853403, 0.506666666666667)
+ << QPointF(0.994764397905759, 1)
+ << QPointF(1.23560209424084, 1.61333333333333)
+ << QPointF(1.47643979057592, 2.37333333333333)
+ << QPointF(1.66492146596859, 3.12)
+ << QPointF(1.80628272251309, 3.92)
+ << QPointF(1.91623036649215, 4.70666666666667)
+ << QPointF(2.00523560209424, 5.44)
+ << QPointF(2.07329842931937, 6)
+;
+
+const QList<QPointF> defScaleTranslation =
+ EmptyList()
+ << QPointF(0, 0)
+ << QPointF(0.282722513089005, 0.08)
+ << QPointF(0.492146596858639, 0.306666666666667)
+ << QPointF(0.764397905759162, 0.84)
+ << QPointF(1.00523560209424, 1.62666666666667)
+ << QPointF(1.17277486910995, 2.78666666666667)
+ << QPointF(1.25130890052356, 3.6)
+ << QPointF(1.31937172774869, 4.29333333333333)
+ << QPointF(1.38219895287958, 4.90666666666667)
+ << QPointF(1.43455497382199, 5.65333333333333)
+;
diff --git a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui
new file mode 100644
index 00000000..9be0356b
--- /dev/null
+++ b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui
@@ -0,0 +1,451 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AccelaUICFilterControls</class>
+ <widget class="QWidget" name="AccelaUICFilterControls">
+ <property name="windowModality">
+ <enum>Qt::ApplicationModal</enum>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>880</width>
+ <height>673</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Filter settings</string>
+ </property>
+ <property name="windowIcon">
+ <iconset>
+ <normaloff>images/FaceTrackNoIR.png</normaloff>images/FaceTrackNoIR.png</iconset>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <layout class="QVBoxLayout" name="_vertical_layout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>850</width>
+ <height>574</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>300</width>
+ <height>574</height>
+ </size>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Rotation</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="scalingConfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>819</width>
+ <height>510</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>4</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>6</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>191</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>75</number>
+ </property>
+ <property name="gridDistEGU_Input" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="gridDistEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>192</red>
+ <green>192</green>
+ <blue>192</blue>
+ </color>
+ </property>
+ <property name="stringInputEGU" stdset="0">
+ <string>Input</string>
+ </property>
+ <property name="stringOutputEGU" stdset="0">
+ <string>Output</string>
+ </property>
+ <property name="stringCaption" stdset="0">
+ <string>Translation</string>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Translation</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="translationScalingConfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>819</width>
+ <height>510</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>4</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>6</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>191</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>75</number>
+ </property>
+ <property name="gridDistEGU_Input" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="gridDistEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>85</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>192</red>
+ <green>192</green>
+ <blue>192</blue>
+ </color>
+ </property>
+ <property name="stringInputEGU" stdset="0">
+ <string>Input</string>
+ </property>
+ <property name="stringOutputEGU" stdset="0">
+ <string>Output</string>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="lblSensYaw_4">
+ <property name="minimumSize">
+ <size>
+ <width>25</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>150</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color:#0;
+background:none;</string>
+ </property>
+ <property name="text">
+ <string>Reduction factor:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="slideReduction">
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>15</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="pageStep">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::NoTicks</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinReduction">
+ <property name="minimumSize">
+ <size>
+ <width>35</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lblSensYaw_5">
+ <property name="minimumSize">
+ <size>
+ <width>25</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>150</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color:#0;
+background:none;</string>
+ </property>
+ <property name="text">
+ <string>Zoom slowness:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="slideZoom">
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>15</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>200</number>
+ </property>
+ <property name="pageStep">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::NoTicks</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinZoom">
+ <property name="minimumSize">
+ <size>
+ <width>35</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>200</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="spacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnOK">
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnCancel">
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QFunctionConfigurator</class>
+ <extends>QWidget</extends>
+ <header>qfunctionconfigurator/qfunctionconfigurator.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>slideReduction</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>spinReduction</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>219</x>
+ <y>620</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>310</x>
+ <y>622</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>spinReduction</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>slideReduction</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>315</x>
+ <y>613</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>170</x>
+ <y>621</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>slideZoom</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>spinZoom</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>547</x>
+ <y>602</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>667</x>
+ <y>602</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>spinZoom</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>slideZoom</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>663</x>
+ <y>602</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>537</x>
+ <y>602</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <slot>startEngineClicked()</slot>
+ <slot>stopEngineClicked()</slot>
+ <slot>cameraSettingsClicked()</slot>
+ </slots>
+</ui>
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
index 3e4c3bf6..cb9fb0f5 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
@@ -10,11 +10,15 @@
Additional changes: I have added two parameters to the constructor of FunctionConfig and
renamed 3 member-functions (getFilterFullName is now called getFullName).
*/
-#include "ftnoir_filter_Accela.h"
+#include "ftnoir_filter_accela/ftnoir_filter_accela.h"
#include "math.h"
#include <QDebug>
-#include <windows.h>
#include <float.h>
+#include "facetracknoir/global-settings.h"
+
+#if !defined(_WIN32) && !defined(__WIN32)
+# define _isnan isnan
+#endif
FTNoIR_Filter::FTNoIR_Filter() :
functionConfig("Accela-Scaling-Rotation", 4, 6),
@@ -32,8 +36,6 @@ FTNoIR_Filter::~FTNoIR_Filter()
void FTNoIR_Filter::Initialize()
{
- loadSettings();
- return;
}
void FTNoIR_Filter::loadSettings() {
@@ -45,24 +47,29 @@ void FTNoIR_Filter::loadSettings() {
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
defPoints.clear();
- for (int i = 0; i < NUM_OF(defScaleRotation); i++) { // Get the default points (hardcoded!)
+ for (int i = 0; i < defScaleRotation.size(); i++) { // Get the default points (hardcoded!)
defPoints.append(defScaleRotation[i]);
}
functionConfig.loadSettings(iniFile, defPoints);
defPoints.clear();
- for (int i = 0; i < NUM_OF(defScaleTranslation); i++) { // Get the default points (hardcoded!)
+ for (int i = 0; i < defScaleTranslation.size(); i++) { // Get the default points (hardcoded!)
defPoints.append(defScaleTranslation[i]);
}
translationFunctionConfig.loadSettings(iniFile, defPoints);
iniFile.beginGroup ( "Accela" );
kMagicNumber = iniFile.value ( "Reduction", 100 ).toFloat();
+ kZoomSlowness = iniFile.value("zoom-slowness", 0).toFloat();
iniFile.endGroup ();
}
-void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget)
+void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position,
+ THeadPoseData *target_camera_position,
+ THeadPoseData *new_camera_position,
+ THeadPoseData *last_post_filter_values,
+ bool newTarget)
{
double target[6];
double prev_output[6];
@@ -130,10 +137,7 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T
// useful for filtering, as skipping them would result in jerky output.
// the magic "100" is the amount of calls to the filter by FTNOIR per sec.
// WVR: Added kMagicNumber for Patrick
- double velocity = foo / 100.0;
- if (kMagicNumber > 0.0f) {
- double velocity = foo / kMagicNumber;
- }
+ double velocity = foo / (kMagicNumber > 0 ? kMagicNumber : 100.0) * (1 / std::max(1.0, 1 + kZoomSlowness * -last_post_filter_values->z / 100));
double sum = start + velocity * sign;
bool done = (sign > 0 ? sum >= e2 : sum <= e2);
if (done) {
@@ -168,9 +172,8 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T
// GetFilter - Undecorated name, which can be easily used with GetProcAddress
// Win32 API function.
// _GetFilter@0 - Common name decoration for __stdcall functions in C language.
-#pragma comment(linker, "/export:GetFilter=_GetFilter@0")
-FTNOIR_FILTER_BASE_EXPORT IFilterPtr __stdcall GetFilter()
+extern "C" FTNOIR_FILTER_BASE_EXPORT void* CALLING_CONVENTION GetConstructor()
{
- return new FTNoIR_Filter;
+ return (IFilter*) new FTNoIR_Filter;
}
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h
index 77aa59ea..32cebf99 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.h
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.h
@@ -26,39 +26,16 @@
#ifndef INCLUDED_FTN_FILTER_H
#define INCLUDED_FTN_FILTER_H
-#include "..\ftnoir_filter_base\ftnoir_filter_base.h"
-#include "ui_FTNoIR_FilterControls.h"
-#include <FunctionConfig.h>
+#undef FTNOIR_TRACKER_BASE_LIB
+#define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_IMPORT
-const QPointF defScaleRotation[] =
-{
- QPointF(0, 0),
- QPointF(0.308900523560209, 0.0666666666666667),
- QPointF(0.565445026178011, 0.226666666666667),
- QPointF(0.769633507853403, 0.506666666666667),
- QPointF(0.994764397905759, 1),
- QPointF(1.23560209424084, 1.61333333333333),
- QPointF(1.47643979057592, 2.37333333333333),
- QPointF(1.66492146596859, 3.12),
- QPointF(1.80628272251309, 3.92),
- QPointF(1.91623036649215, 4.70666666666667),
- QPointF(2.00523560209424, 5.44),
- QPointF(2.07329842931937, 6)
-};
+#include "ftnoir_filter_base/ftnoir_filter_base.h"
+#include "ui_ftnoir_accela_filtercontrols.h"
+#include <qfunctionconfigurator/functionconfig.h>
+#include "facetracknoir/global-settings.h"
-const QPointF defScaleTranslation[] =
-{
- QPointF(0, 0),
- QPointF(0.282722513089005, 0.08),
- QPointF(0.492146596858639, 0.306666666666667),
- QPointF(0.764397905759162, 0.84),
- QPointF(1.00523560209424, 1.62666666666667),
- QPointF(1.17277486910995, 2.78666666666667),
- QPointF(1.25130890052356, 3.6),
- QPointF(1.31937172774869, 4.29333333333333),
- QPointF(1.38219895287958, 4.90666666666667),
- QPointF(1.43455497382199, 5.65333333333333)
-};
+extern const QList<QPointF> defScaleRotation;
+extern const QList<QPointF> defScaleTranslation;
//
// Macro to determine array-size
@@ -68,16 +45,14 @@ const QPointF defScaleTranslation[] =
//*******************************************************************************************************
// FaceTrackNoIR Filter class.
//*******************************************************************************************************
-class FTNoIR_Filter : public IFilter
+class FTNOIR_FILTER_BASE_EXPORT FTNoIR_Filter : public IFilter
{
public:
FTNoIR_Filter();
~FTNoIR_Filter();
- void Release();
void Initialize();
- void StartFilter();
- void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget);
+ void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, THeadPoseData *last_post_filter_values, bool newTarget);
private:
void loadSettings(); // Load the settings from the INI-file
@@ -86,7 +61,7 @@ private:
bool first_run;
double kFactor, kFactorTranslation;
double kSensitivity, kSensitivityTranslation;
- double kMagicNumber; // Stanislaws' magic number (should be 100 according to him...)
+ double kMagicNumber, kZoomSlowness; // Stanislaws' magic number (should be 100 according to him...)
FunctionConfig functionConfig;
FunctionConfig translationFunctionConfig;
@@ -97,7 +72,7 @@ private:
//*******************************************************************************************************
// Widget that has controls for FTNoIR protocol filter-settings.
-class FilterControls: public QWidget, Ui::UICFilterControls, public IFilterDialog
+class FTNOIR_FILTER_BASE_EXPORT FilterControls: public QWidget, Ui::AccelaUICFilterControls, public IFilterDialog
{
Q_OBJECT
public:
@@ -107,17 +82,17 @@ public:
void showEvent ( QShowEvent * event );
void Release(); // Member functions which are accessible from outside the DLL
- void Initialize(QWidget *parent, IFilterPtr ptr);
+ void Initialize(QWidget *parent, IFilter *ptr);
private:
- Ui::UICFilterControls ui;
+ Ui::AccelaUICFilterControls ui;
void loadSettings();
void save();
/** helper **/
bool settingsDirty;
- IFilterPtr pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance
+ IFilter* pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance
FunctionConfig functionConfig;
FunctionConfig translationFunctionConfig;
@@ -131,17 +106,17 @@ private slots:
//*******************************************************************************************************
// FaceTrackNoIR Filter DLL. Functions used to get general info on the Filter
//*******************************************************************************************************
-class FTNoIR_FilterDll : public IFilterDll
+class FTNoIR_FilterDll : public Metadata
{
public:
FTNoIR_FilterDll();
~FTNoIR_FilterDll();
- void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("Accela Filter Mk2"); };
- void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("Accela Mk2"); };
- void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Accela filter Mk2"); };
+ void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("Accela Filter Mk2"); }
+ void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("Accela Mk2"); }
+ void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Accela filter Mk2"); }
- void getIcon(QIcon *icon){ *icon = QIcon(":/images/filter-16.png"); };
+ void getIcon(QIcon *icon){ *icon = QIcon(":/images/filter-16.png"); }
};
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
index c230eed8..9970e962 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
@@ -26,9 +26,10 @@
Modifications (last one on top):
20130102 - WVR: Added 'reduction factor' to accommodate Patrick's need for speed.
*/
-#include "ftnoir_filter_Accela.h"
+#include "ftnoir_filter_accela/ftnoir_filter_accela.h"
#include "math.h"
#include <QDebug>
+#include "facetracknoir/global-settings.h"
//*******************************************************************************************************
// FaceTrackNoIR Filter Settings-dialog.
@@ -51,7 +52,7 @@ FilterControls::FilterControls() :
connect(ui.translationScalingConfig, SIGNAL(CurveChanged(bool)), this, SLOT(settingChanged(bool)));
// Connect slider for reduction
- connect(ui.slideReduction, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int)));
+ //connect(ui.slideReduction, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int)));
qDebug() << "FilterControls() says: started";
}
@@ -71,7 +72,7 @@ void FilterControls::Release()
//
// Initialize tracker-client-dialog
//
-void FilterControls::Initialize(QWidget *parent, IFilterPtr ptr) {
+void FilterControls::Initialize(QWidget *parent, IFilter* ptr) {
//
// The dialog can be opened, while the Tracker is running.
@@ -79,6 +80,7 @@ void FilterControls::Initialize(QWidget *parent, IFilterPtr ptr) {
// This can be used to update settings, while Tracking and may also be handy to display logging-data and such...
//
pFilter = ptr;
+ loadSettings();
QPoint offsetpos(100, 100);
if (parent) {
@@ -100,7 +102,6 @@ void FilterControls::doOK() {
// override show event
void FilterControls::showEvent ( QShowEvent * event ) {
- loadSettings();
}
//
@@ -150,16 +151,16 @@ QList<QPointF> defPoints;
qDebug() << "FTNoIR_Filter::loadSettings2 says: iniFile = " << currentFile;
- qDebug() << "FTNoIR_Filter::loadSettings2 says: size = " << NUM_OF(defScaleRotation);
+ //qDebug() << "FTNoIR_Filter::loadSettings2 says: size = " << NUM_OF(defScaleRotation);
defPoints.clear();
- for (int i = 0; i < NUM_OF(defScaleRotation); i++) { // Get the default points (hardcoded!)
+ for (int i = 0; i < defScaleRotation.size(); i++) { // Get the default points (hardcoded!)
defPoints.append(defScaleRotation[i]);
}
functionConfig.loadSettings(iniFile, defPoints);
defPoints.clear();
- for (int i = 0; i < NUM_OF(defScaleTranslation); i++) { // Get the default points (hardcoded!)
+ for (int i = 0; i < defScaleTranslation.size(); i++) { // Get the default points (hardcoded!)
defPoints.append(defScaleTranslation[i]);
}
translationFunctionConfig.loadSettings(iniFile, defPoints);
@@ -169,6 +170,7 @@ QList<QPointF> defPoints;
iniFile.beginGroup ( "Accela" );
ui.slideReduction->setValue (iniFile.value ( "Reduction", 100 ).toInt());
+ ui.slideZoom->setValue(iniFile.value("zoom-slowness", 0).toInt());
iniFile.endGroup ();
settingsDirty = false;
@@ -187,6 +189,7 @@ void FilterControls::save() {
iniFile.beginGroup ( "Accela" );
iniFile.setValue ( "Reduction", ui.slideReduction->value() );
+ iniFile.setValue("zoom-slowness", ui.slideZoom->value());
iniFile.endGroup ();
functionConfig.saveSettings(iniFile);
@@ -202,9 +205,9 @@ void FilterControls::save() {
// GetFilterDialog - Undecorated name, which can be easily used with GetProcAddress
// Win32 API function.
// _GetFilterDialog@0 - Common name decoration for __stdcall functions in C language.
-#pragma comment(linker, "/export:GetFilterDialog=_GetFilterDialog@0")
+//#pragma comment(linker, "/export:GetFilterDialog=_GetFilterDialog@0")
-FTNOIR_FILTER_BASE_EXPORT IFilterDialogPtr __stdcall GetFilterDialog( )
+extern "C" FTNOIR_FILTER_BASE_EXPORT void* CALLING_CONVENTION GetDialog()
{
- return new FilterControls;
+ return (IFilterDialog*) new FilterControls;
}
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela_dll.cpp b/ftnoir_filter_accela/ftnoir_filter_accela_dll.cpp
index e1452bf2..3ae273df 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela_dll.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela_dll.cpp
@@ -30,8 +30,9 @@
The FilterDll class solves this.
The functions to get the name(s) and icon were removed from the two other classes.
*/
-#include "ftnoir_filter_Accela.h"
+#include "ftnoir_filter_accela.h"
#include <QDebug>
+#include "facetracknoir/global-settings.h"
FTNoIR_FilterDll::FTNoIR_FilterDll() {
}
@@ -48,9 +49,9 @@ FTNoIR_FilterDll::~FTNoIR_FilterDll()
// GetFilterDll - Undecorated name, which can be easily used with GetProcAddress
// Win32 API function.
// _GetFilterDll@0 - Common name decoration for __stdcall functions in C language.
-#pragma comment(linker, "/export:GetFilterDll=_GetFilterDll@0")
+//#pragma comment(linker, "/export:GetFilterDll=_GetFilterDll@0")
-FTNOIR_FILTER_BASE_EXPORT IFilterDllPtr __stdcall GetFilterDll()
+extern "C" FTNOIR_FILTER_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata()
{
- return new FTNoIR_FilterDll;
+ return new FTNoIR_FilterDll;
}