summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-06-13 09:01:04 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-06-13 09:01:04 +0200
commit146540da2d1427a4172eb422cff94d89f03ce891 (patch)
tree0d94991540dd5ae97e2bc84c2ac96f3f1ea455db /facetracknoir
parente9a6c723cc80317e205b05eb9f406dff9e55a825 (diff)
Ding!
Issue: #34
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/facetracknoir.cpp7
-rw-r--r--facetracknoir/ftnoir_keyboardshortcuts.ui125
-rw-r--r--facetracknoir/main-settings.hpp5
-rw-r--r--facetracknoir/shortcuts.cpp2
4 files changed, 76 insertions, 63 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp
index 98c8c2c2..893e79cd 100644
--- a/facetracknoir/facetracknoir.cpp
+++ b/facetracknoir/facetracknoir.cpp
@@ -679,7 +679,8 @@ void FaceTrackNoIR::bindKeyboardShortcuts()
void FaceTrackNoIR::shortcutRecentered()
{
- QApplication::beep();
+ if (s.dingp)
+ QApplication::beep();
qDebug() << "Center";
if (tracker)
@@ -688,7 +689,9 @@ void FaceTrackNoIR::shortcutRecentered()
void FaceTrackNoIR::shortcutToggled()
{
- QApplication::beep();
+ if (s.dingp)
+ QApplication::beep();
+
qDebug() << "Toggle";
if (tracker)
tracker->enabled = !tracker->enabled;
diff --git a/facetracknoir/ftnoir_keyboardshortcuts.ui b/facetracknoir/ftnoir_keyboardshortcuts.ui
index 94d11734..5bdc3334 100644
--- a/facetracknoir/ftnoir_keyboardshortcuts.ui
+++ b/facetracknoir/ftnoir_keyboardshortcuts.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>371</width>
- <height>131</height>
+ <height>125</height>
</rect>
</property>
<property name="sizePolicy">
@@ -30,27 +30,37 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="4">
- <widget class="QLabel" name="textLabel2_4">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="chkToggleShift">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
</property>
<property name="text">
- <string>Keyboard</string>
+ <string>Shift</string>
</property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QComboBox" name="cbxToggleKey">
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
</property>
- <property name="wordWrap">
- <bool>false</bool>
+ <property name="toolTip">
+ <string>Select Number</string>
+ </property>
+ <property name="insertPolicy">
+ <enum>QComboBox::InsertAlphabetically</enum>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="textLabel2_3">
+ <item row="2" column="0">
+ <widget class="QLabel" name="textLabel2_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -58,15 +68,15 @@
</sizepolicy>
</property>
<property name="text">
- <string>Center</string>
+ <string>Toggle</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="chkCenterShift">
+ <item row="1" column="3">
+ <widget class="QCheckBox" name="chkCenterAlt">
<property name="maximumSize">
<size>
<width>50</width>
@@ -74,7 +84,7 @@
</size>
</property>
<property name="text">
- <string>Shift</string>
+ <string>Alt</string>
</property>
</widget>
</item>
@@ -91,19 +101,6 @@
</property>
</widget>
</item>
- <item row="1" column="3">
- <widget class="QCheckBox" name="chkCenterAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
<item row="1" column="4">
<widget class="QComboBox" name="cbxCenterKey">
<property name="minimumSize">
@@ -120,8 +117,8 @@
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="textLabel2_5">
+ <item row="0" column="4">
+ <widget class="QLabel" name="textLabel2_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -129,23 +126,20 @@
</sizepolicy>
</property>
<property name="text">
- <string>Toggle</string>
+ <string>Keyboard</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="chkToggleShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
+ <item row="4" column="3" colspan="2">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
@@ -162,6 +156,22 @@
</property>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="textLabel2_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Center</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
<item row="2" column="3">
<widget class="QCheckBox" name="chkToggleAlt">
<property name="maximumSize">
@@ -175,26 +185,23 @@
</property>
</widget>
</item>
- <item row="2" column="4">
- <widget class="QComboBox" name="cbxToggleKey">
- <property name="minimumSize">
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="chkCenterShift">
+ <property name="maximumSize">
<size>
- <width>90</width>
- <height>0</height>
+ <width>50</width>
+ <height>16777215</height>
</size>
</property>
- <property name="toolTip">
- <string>Select Number</string>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::InsertAlphabetically</enum>
+ <property name="text">
+ <string>Shift</string>
</property>
</widget>
</item>
- <item row="3" column="3" colspan="2">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <item row="3" column="0" colspan="2">
+ <widget class="QCheckBox" name="ding">
+ <property name="text">
+ <string>Ding!</string>
</property>
</widget>
</item>
diff --git a/facetracknoir/main-settings.hpp b/facetracknoir/main-settings.hpp
index c9b5ff66..8e93bd24 100644
--- a/facetracknoir/main-settings.hpp
+++ b/facetracknoir/main-settings.hpp
@@ -35,7 +35,7 @@ struct main_settings {
key_opts toggle_key;
value<QString> tracker_dll, tracker2_dll, filter_dll, protocol_dll;
axis_opts a_x, a_y, a_z, a_yaw, a_pitch, a_roll;
- value<bool> tcomp_p, tcomp_tz;
+ value<bool> tcomp_p, tcomp_tz, dingp;
main_settings(pbundle b) :
b(b),
center_key(b, "center"),
@@ -51,6 +51,7 @@ struct main_settings {
a_pitch(b, "pitch"),
a_roll(b, "roll"),
tcomp_p(b, "compensate-translation", true),
- tcomp_tz(b, "compensate-translation-disable-z-axis", false)
+ tcomp_tz(b, "compensate-translation-disable-z-axis", false),
+ dingp(b, "ding", true)
{}
};
diff --git a/facetracknoir/shortcuts.cpp b/facetracknoir/shortcuts.cpp
index a905be57..601bbcc6 100644
--- a/facetracknoir/shortcuts.cpp
+++ b/facetracknoir/shortcuts.cpp
@@ -29,6 +29,8 @@ KeyboardShortcutDialog::KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *
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);
+
+ tie_setting(mainApp->s.dingp, ui.ding);
}
//