Zoadian 11 سال پیش
والد
کامیت
79b741e572
4فایلهای تغییر یافته به همراه20 افزوده شده و 20 حذف شده
  1. 7 7
      drumduino/channel.cpp
  2. 4 4
      drumduino/channel.ui
  3. 7 7
      drumduino/drumduino.cpp
  4. 2 2
      drumduino/settings.h

+ 7 - 7
drumduino/channel.cpp

@@ -33,8 +33,8 @@ Channel::Channel(int channel, ChannelSettings& channelSettings, QWidget* parent)
 	_curvePlot->yAxis->setRange(0, 127);
 	_curvePlot->setMinimumHeight(60);
 
-	//auto thresoldCurve = _curvePlot->addGraph(_curvePlot->xAxis, _curvePlot->yAxis);
-	//thresoldCurve->setPen(QPen(Qt::red));
+	//auto thresholdCurve = _curvePlot->addGraph(_curvePlot->xAxis, _curvePlot->yAxis);
+	//thresholdCurve->setPen(QPen(Qt::red));
 
 	_curvePlot->axisRect()->setAutoMargins(QCP::msNone);
 	_curvePlot->axisRect()->setMargins(QMargins(1, 1, 1, 1));
@@ -47,7 +47,7 @@ Channel::Channel(int channel, ChannelSettings& channelSettings, QWidget* parent)
 
 	connect(ui.cbNote, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this](int index) {_channelSettings.note = index; update(); });
 
-	connect(ui.dialThresold, &QDial::valueChanged, [this](int value) {_channelSettings.thresold = value; update(); });
+	connect(ui.dialThreshold, &QDial::valueChanged, [this](int value) {_channelSettings.threshold = value; update(); });
 
 	connect(ui.dialScanTime, &QDial::valueChanged, [this](int value) {_channelSettings.scanTime = value; update(); });
 
@@ -74,8 +74,8 @@ void Channel::update()
 
 	ui.cbNote->setCurrentIndex(_channelSettings.note);
 
-	//ui.labelThresold->setText(QString::number(_channelSettings.thresold));
-	ui.dialThresold->setValue(_channelSettings.thresold);
+	//ui.labelThreshold->setText(QString::number(_channelSettings.threshold));
+	ui.dialThreshold->setValue(_channelSettings.threshold);
 
 	//ui.labelScanTime->setText(QString::number(_channelSettings.scanTime));
 	ui.dialScanTime->setValue(_channelSettings.scanTime);
@@ -112,8 +112,8 @@ void Channel::update()
 	//
 	//  x[0] = 0;
 	//  x[1] = 127;
-	//  y[0] = _channelSettings.thresold;
-	//  y[1] = _channelSettings.thresold;
+	//  y[0] = _channelSettings.threshold;
+	//  y[1] = _channelSettings.threshold;
 
 	//  _curvePlot->graph(1)->setData(x, y);
 	//}

+ 4 - 4
drumduino/channel.ui

@@ -81,7 +81,7 @@
      </property>
      <layout class="QGridLayout" name="gridLayout_3">
       <item row="1" column="0">
-       <widget class="QDial" name="dialThresold">
+       <widget class="QDial" name="dialThreshold">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
           <horstretch>0</horstretch>
@@ -133,7 +133,7 @@
       <item row="0" column="0">
        <widget class="QLabel" name="label_21">
         <property name="text">
-         <string>Thresold</string>
+         <string>Threshold</string>
         </property>
         <property name="alignment">
          <set>Qt::AlignCenter</set>
@@ -187,7 +187,7 @@
       </item>
      </layout>
      <zorder>label_21</zorder>
-     <zorder>dialThresold</zorder>
+     <zorder>dialThreshold</zorder>
      <zorder>label_8</zorder>
      <zorder>dialScanTime</zorder>
      <zorder>dialMaskTime</zorder>
@@ -285,7 +285,7 @@
       <item row="1" column="0">
        <widget class="QLabel" name="label_3">
         <property name="text">
-         <string>Value</string>
+         <string>Form</string>
         </property>
         <property name="alignment">
          <set>Qt::AlignCenter</set>

+ 7 - 7
drumduino/drumduino.cpp

@@ -80,7 +80,7 @@ void processFrame(std::shared_ptr<MidiOut>& midiOut, DrumduinoProc& proc, const
 					case StateAwait: {
 STATE_AGAIN:
 
-						if(currentValue < lastValue + channelSettings.thresold) {
+						if(currentValue < lastValue + channelSettings.threshold) {
 							break;
 						}
 
@@ -305,7 +305,7 @@ Drumduino::Drumduino(QWidget* parent)
 		table->setColumnCount(9);
 
 		QStringList headers;
-		headers << "type" << "note" << "thresold" << "scanTime" << "maskTime" << "CurveType" << "CurveValue" << "CurveForm" << "Graph";
+		headers << "type" << "note" << "threshold" << "scanTime" << "maskTime" << "CurveType" << "CurveValue" << "CurveForm" << "Graph";
 		table->setHorizontalHeaderLabels(headers);
 	}
 
@@ -337,7 +337,7 @@ Drumduino::Drumduino(QWidget* parent)
 
 		auto wgtType = new QComboBox(table);
 		auto wgtNote = new QSpinBox(table);
-		auto wgtThresold = new QSpinBox(table);
+		auto wgtThreshold = new QSpinBox(table);
 		auto wgtScanTime = new QSpinBox(table);
 		auto wgtMaskTime = new QSpinBox(table);
 		auto wgtCurveType = new QComboBox(table);
@@ -358,7 +358,7 @@ Drumduino::Drumduino(QWidget* parent)
 
 		table->setCellWidget(channel % 8, 0, wgtType);
 		table->setCellWidget(channel % 8, 1, wgtNote);
-		table->setCellWidget(channel % 8, 2, wgtThresold);
+		table->setCellWidget(channel % 8, 2, wgtThreshold);
 		table->setCellWidget(channel % 8, 3, wgtScanTime);
 		table->setCellWidget(channel % 8, 4, wgtMaskTime);
 		table->setCellWidget(channel % 8, 5, wgtCurveType);
@@ -370,7 +370,7 @@ Drumduino::Drumduino(QWidget* parent)
 
 		wgtType->setCurrentIndex(_settings.channelSettings[channel].type);
 		wgtNote->setValue(_settings.channelSettings[channel].note);
-		wgtThresold->setValue(_settings.channelSettings[channel].thresold);
+		wgtThreshold->setValue(_settings.channelSettings[channel].threshold);
 		wgtScanTime->setValue(_settings.channelSettings[channel].scanTime);
 		wgtMaskTime->setValue(_settings.channelSettings[channel].maskTime);
 		wgtCurveType->setCurrentIndex(_settings.channelSettings[channel].curveType);
@@ -394,7 +394,7 @@ Drumduino::Drumduino(QWidget* parent)
 
 		connect(wgtType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this, channel](int i) mutable { _settings.channelSettings[channel].type = (Type)i; });
 		connect(wgtNote, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this, channel](int i) mutable { _settings.channelSettings[channel].note = i; });
-		connect(wgtThresold, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this, channel](int i) mutable { _settings.channelSettings[channel].thresold = i; });
+		connect(wgtThreshold, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this, channel](int i) mutable { _settings.channelSettings[channel].threshold = i; });
 		connect(wgtScanTime, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this, channel](int i) mutable { _settings.channelSettings[channel].scanTime = i; });
 		connect(wgtMaskTime, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this, channel](int i) mutable { _settings.channelSettings[channel].maskTime = i; });
 		connect(wgtCurveType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this, channel, curveForm, fnReplotCurveForm](int v) mutable {
@@ -558,7 +558,7 @@ void Drumduino::handleFrame(const std::array<byte, PORT_CNT* CHAN_CNT>& frame, c
 				switch(state) {
 					// In this state we wait for a signal to trigger
 					case StateAwait: {
-						if(newValue > lastValue + channelSettings.thresold) {
+						if(newValue > lastValue + channelSettings.threshold) {
 							state = StateScan;
 							triggerFrame = curTime;
 							maxValue = newValue;

+ 2 - 2
drumduino/settings.h

@@ -36,7 +36,7 @@ struct CurveSettings {
 struct ChannelSettings {
 	Type type;
 	uint8_t note;
-	uint8_t thresold;
+	uint8_t threshold;
 	qint64 scanTime;
 	qint64 maskTime;
 	CurveSettings curve;
@@ -44,7 +44,7 @@ struct ChannelSettings {
 	ChannelSettings()
 		: type(TypeDisabled)
 		, note(35)
-		, thresold(25)
+		, threshold(25)
 		, scanTime(4)
 		, maskTime(10)
 	{}