Improved: Switched to stricter code formatter (Uncrustify) for better consistency across all source files.

This commit is contained in:
jthedering committed 2015-11-23 21:17:34 +00:00
1 parent a1be4cc70f
commit 57e8158efd
202 files changed
+4595 -4284

No files matched your search

+57 -57
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define _USE_MATH_DEFINES
@@ -30,8 +30,8 @@ static const double dialQSteps = 1000;
static const double dialQMin = 0.3333;
static const double dialQMax = 33.3333;
BiQuadFilterGUI::BiQuadFilterGUI(BiQuadFilter* filter) :
ui(new Ui::BiQuadFilterGUI)
BiQuadFilterGUI::BiQuadFilterGUI(BiQuadFilter* filter)
: ui(new Ui::BiQuadFilterGUI)
{
ui->setupUi(this);
@@ -46,22 +46,22 @@ BiQuadFilterGUI::BiQuadFilterGUI(BiQuadFilter* filter) :
BiQuad::Type type = filter->getType();
int typeIndex = ui->typeComboBox->findData(type);
if(typeIndex != -1)
if (typeIndex != -1)
ui->typeComboBox->setCurrentIndex(typeIndex);
if(type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF )
if (type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
ui->freqComboBox->setCurrentIndex(filter->getIsCornerFreq() ? 1 : 0);
ui->freqSpinBox->setValue(filter->getFreq());
if(type == BiQuad::PEAKING )
if (type == BiQuad::PEAKING)
ui->qComboBox->setCurrentIndex(filter->getIsBandwidth() ? 1 : 0);
else if(type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::BAND_PASS)
else if (type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::BAND_PASS)
ui->qComboBox->setCurrentIndex(filter->getBandwidthOrQOrS() == M_SQRT1_2 ? 0 : 1);
else if((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && !filter->getIsCornerFreq())
else if ((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && !filter->getIsCornerFreq())
ui->qComboBox->setCurrentIndex(filter->getBandwidthOrQOrS() == 0.9 ? 0 : 1);
if((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && filter->getBandwidthOrQOrS() != 0.9)
if ((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && filter->getBandwidthOrQOrS() != 0.9)
ui->qSpinBox->setValue(filter->getBandwidthOrQOrS() * 12.0);
else
ui->qSpinBox->setValue(filter->getBandwidthOrQOrS());
@@ -82,19 +82,19 @@ void BiQuadFilterGUI::store(QString& command, QString& parameters)
command = "Filter";
parameters = "ON ";
switch(type)
switch (type)
{
case BiQuad::PEAKING:
parameters += "PK";
break;
case BiQuad::LOW_PASS:
if(mode == 'F')
if (mode == 'F')
parameters += "LP";
else
parameters += "LPQ";
break;
case BiQuad::HIGH_PASS:
if(mode == 'F')
if (mode == 'F')
parameters += "HP";
else
parameters += "HPQ";
@@ -103,13 +103,13 @@ void BiQuadFilterGUI::store(QString& command, QString& parameters)
parameters += "BP";
break;
case BiQuad::LOW_SHELF:
if(freqMode == 'E' && mode == 'S')
if (freqMode == 'E' && mode == 'S')
parameters += "LSC";
else
parameters += "LS";
break;
case BiQuad::HIGH_SHELF:
if(freqMode == 'E' && mode == 'S')
if (freqMode == 'E' && mode == 'S')
parameters += "HSC";
else
parameters += "HS";
@@ -122,18 +122,18 @@ void BiQuadFilterGUI::store(QString& command, QString& parameters)
break;
}
if((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && mode == 'S')
if ((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && mode == 'S')
parameters += QString(" %1 dB").arg(ui->qSpinBox->value());
parameters += QString(" Fc %1 Hz").arg(ui->freqSpinBox->value());
if(type == BiQuad::PEAKING || type == BiQuad::LOW_SHELF
|| type == BiQuad::HIGH_SHELF)
if (type == BiQuad::PEAKING || type == BiQuad::LOW_SHELF
|| type == BiQuad::HIGH_SHELF)
parameters += QString(" Gain %1 dB").arg(ui->gainSpinBox->value());
if(mode == 'Q')
if (mode == 'Q')
parameters += QString(" Q %1").arg(ui->qSpinBox->value());
else if(mode == 'B')
else if (mode == 'B')
parameters += QString(" BW Oct %1").arg(ui->qSpinBox->value());
}
@@ -187,13 +187,13 @@ void BiQuadFilterGUI::on_typeComboBox_currentIndexChanged(int index)
QChar freqMode = ui->freqComboBox->currentData().toChar();
double freqValue = ui->freqSpinBox->value();
ui->freqComboBox->clear();
if(type == BiQuad::PEAKING || type == BiQuad::BAND_PASS || type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF || type == BiQuad::NOTCH || type == BiQuad::ALL_PASS )
if (type == BiQuad::PEAKING || type == BiQuad::BAND_PASS || type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF || type == BiQuad::NOTCH || type == BiQuad::ALL_PASS)
ui->freqComboBox->addItem(tr("Center frequency"), 'E');
if(type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
if (type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
ui->freqComboBox->addItem(tr("Corner frequency"), 'O');
ui->freqComboBox->setEnabled(ui->freqComboBox->count() > 1);
int freqIndex = ui->freqComboBox->findData(freqMode);
if(freqIndex != -1 && sameTypeCategory)
if (freqIndex != -1 && sameTypeCategory)
{
ui->freqComboBox->setCurrentIndex(freqIndex);
ui->freqSpinBox->setValue(freqValue);
@@ -206,30 +206,30 @@ void BiQuadFilterGUI::on_typeComboBox_currentIndexChanged(int index)
QChar mode = ui->qComboBox->currentData().toChar();
double qValue = ui->qSpinBox->value();
ui->qComboBox->clear();
if(type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::BAND_PASS || type == BiQuad::NOTCH )
if (type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::BAND_PASS || type == BiQuad::NOTCH)
ui->qComboBox->addItem(tr("Fixed Q"), 'F');
else if((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && freqMode == 'E')
else if ((type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF) && freqMode == 'E')
ui->qComboBox->addItem(tr("Fixed S"), 'F');
if(type == BiQuad::PEAKING || type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::ALL_PASS || type == BiQuad::BAND_PASS || type == BiQuad::NOTCH)
if (type == BiQuad::PEAKING || type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::ALL_PASS || type == BiQuad::BAND_PASS || type == BiQuad::NOTCH)
ui->qComboBox->addItem(tr("Q factor"), 'Q');
if(type == BiQuad::PEAKING)
if (type == BiQuad::PEAKING)
ui->qComboBox->addItem(tr("Bandwidth"), 'B');
if(type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
if (type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
ui->qComboBox->addItem(tr("Slope"), 'S');
ui->qComboBox->setEnabled(ui->qComboBox->count() > 1);
int qIndex = ui->qComboBox->findData(mode);
if(qIndex != -1 && sameTypeCategory)
if (qIndex != -1 && sameTypeCategory)
{
ui->qComboBox->setCurrentIndex(qIndex);
ui->qSpinBox->setValue(qValue);
}
else if(type == BiQuad::PEAKING || type == BiQuad::ALL_PASS)
else if (type == BiQuad::PEAKING || type == BiQuad::ALL_PASS)
{
ui->qSpinBox->setValue(10);
}
bool gainVisible = type == BiQuad::PEAKING || type == BiQuad::LOW_SHELF
|| type == BiQuad::HIGH_SHELF;
|| type == BiQuad::HIGH_SHELF;
ui->gainDial->setVisible(gainVisible);
ui->gainLabel->setVisible(gainVisible);
ui->gainSpinBox->setVisible(gainVisible);
@@ -243,17 +243,17 @@ void BiQuadFilterGUI::on_freqComboBox_currentIndexChanged(int index)
{
BiQuad::Type type = (BiQuad::Type)ui->typeComboBox->currentData().toInt();
QChar freqMode = ui->freqComboBox->itemData(index).toChar();
if(type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
if (type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
{
QChar mode = ui->qComboBox->currentData().toChar();
double qValue = ui->qSpinBox->value();
ui->qComboBox->clear();
if(freqMode == 'E')
if (freqMode == 'E')
ui->qComboBox->addItem(tr("Fixed S"), 'F');
ui->qComboBox->addItem(tr("Slope"), 'S');
ui->qComboBox->setEnabled(ui->qComboBox->count() > 1);
int qIndex = ui->qComboBox->findData(mode);
if(qIndex != -1)
if (qIndex != -1)
{
ui->qComboBox->setCurrentIndex(qIndex);
ui->qSpinBox->setValue(qValue);
@@ -261,7 +261,7 @@ void BiQuadFilterGUI::on_freqComboBox_currentIndexChanged(int index)
double centerFreqFactor = pow(10.0, abs(ui->gainSpinBox->value()) / 80.0 / (ui->qSpinBox->value() / 12.0));
double freq = ui->freqSpinBox->value();
if((freqMode == 'E') == (type == BiQuad::LOW_SHELF) )
if ((freqMode == 'E') == (type == BiQuad::LOW_SHELF))
freq *= centerFreqFactor;
else
freq /= centerFreqFactor;
@@ -272,27 +272,27 @@ void BiQuadFilterGUI::on_freqComboBox_currentIndexChanged(int index)
void BiQuadFilterGUI::on_qComboBox_currentIndexChanged(int index)
{
QChar mode = ui->qComboBox->currentData().toChar();
if(mode == 'F' || mode == 'Q')
if (mode == 'F' || mode == 'Q')
ui->qSpinBox->setSuffix("");
else if(mode == 'B')
else if (mode == 'B')
ui->qSpinBox->setSuffix(" Oct");
else if(mode == 'S')
else if (mode == 'S')
ui->qSpinBox->setSuffix(" dB/Oct");
ui->qDial->setEnabled(mode != 'F');
ui->qSpinBox->setEnabled(mode != 'F');
if(mode == 'F')
if (mode == 'F')
{
BiQuad::Type type = (BiQuad::Type)ui->typeComboBox->currentData().toInt();
if(type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::BAND_PASS)
if (type == BiQuad::LOW_PASS || type == BiQuad::HIGH_PASS || type == BiQuad::BAND_PASS)
ui->qSpinBox->setValue(M_SQRT1_2);
else if(type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
else if (type == BiQuad::LOW_SHELF || type == BiQuad::HIGH_SHELF)
ui->qSpinBox->setValue(0.9);
else if(type == BiQuad::NOTCH)
else if (type == BiQuad::NOTCH)
ui->qSpinBox->setValue(30);
}
else if(qIsBw && mode == 'Q')
else if (qIsBw && mode == 'Q')
{
double n = ui->qSpinBox->value();
double p2n = pow(2.0, n);
@@ -300,14 +300,14 @@ void BiQuadFilterGUI::on_qComboBox_currentIndexChanged(int index)
ui->qSpinBox->setValue(q);
qIsBw = false;
}
else if(!qIsBw && mode == 'B')
else if (!qIsBw && mode == 'B')
{
double q = ui->qSpinBox->value();
double n = 2.0 / M_LN2 * asinh(1.0 / (2.0 * q));
ui->qSpinBox->setValue(n);
qIsBw = true;
}
else if(mode == 'S')
else if (mode == 'S')
{
ui->qSpinBox->setValue(12.0);
}
@@ -317,7 +317,7 @@ void BiQuadFilterGUI::on_qComboBox_currentIndexChanged(int index)
int BiQuadFilterGUI::getTypeCategory(BiQuad::Type type)
{
switch(type)
switch (type)
{
case BiQuad::PEAKING:
return 0;
+14 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -22,8 +22,7 @@
#include "Editor/IFilterGUI.h"
#include <filters/BiQuadFilter.h>
namespace Ui
{
namespace Ui {
class BiQuadFilterGUI;
}
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "BiQuadFilterGUI.h"
@@ -43,17 +43,17 @@ IFilterGUI* BiQuadFilterGUIFactory::createFilterGUI(QString& command, QString& p
{
BiQuadFilterGUI* result = NULL;
if(command.startsWith("Filter"))
if (command.startsWith("Filter"))
{
BiQuadFilterFactory factory;
std::vector<IFilter*> filters = factory.createFilter(L"", command.toStdWString(), parameters.toStdWString());
if(!filters.empty())
if (!filters.empty())
{
BiQuadFilter* filter = (BiQuadFilter*)filters[0];
result = new BiQuadFilterGUI(filter);
}
for(IFilter* f : filters)
for (IFilter* f : filters)
{
f->~IFilter();
MemoryHelper::free(f);
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+18 -18
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ChannelFilterGUI.h"
@@ -23,8 +23,8 @@
using namespace std;
ChannelFilterGUI::ChannelFilterGUI(const QString& parameters, int selectedChannelMask) :
ui(new Ui::ChannelFilterGUI)
ChannelFilterGUI::ChannelFilterGUI(const QString& parameters, int selectedChannelMask)
: ui(new Ui::ChannelFilterGUI)
{
ui->setupUi(this);
@@ -38,8 +38,8 @@ ChannelFilterGUI::ChannelFilterGUI(const QString& parameters, int selectedChanne
selectedChannels.clear();
QStringList words = parameters.trimmed().split(' ', QString::SkipEmptyParts);
for(QString word : words)
if(word.length() > 0)
for (QString word : words)
if (word.length() > 0)
selectedChannels.append(word.toUpper());
}
@@ -66,7 +66,7 @@ void ChannelFilterGUI::store(QString& command, QString& parameters)
void ChannelFilterGUI::on_pushButton_clicked()
{
ChannelFilterGUIDialog dialog(this, selectedChannels, selectedChannelMask, channelNames);
if(dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
selectedChannels = dialog.getSelectedChannels();
refreshGui();
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -43,7 +43,7 @@ private slots:
private:
void refreshGui();
Ui::ChannelFilterGUI *ui;
Ui::ChannelFilterGUI* ui;
QStringList selectedChannels;
int selectedChannelMask;
std::vector<std::wstring> channelNames;
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <QPainter>
@@ -22,8 +22,8 @@
#include "ChannelFilterGUIScene.h"
#include "ChannelFilterGUIChannelItem.h"
ChannelFilterGUIChannelItem::ChannelFilterGUIChannelItem(const QString& name) :
ChannelGraphItem(name)
ChannelFilterGUIChannelItem::ChannelFilterGUIChannelItem(const QString& name)
: ChannelGraphItem(name)
{
setFlag(ItemIsSelectable);
}
@@ -32,7 +32,7 @@ void ChannelFilterGUIChannelItem::paint(QPainter* painter, const QStyleOptionGra
{
QColor color;
if(isSelected())
if (isSelected())
{
color = QColor(176, 229, 255);
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -26,7 +26,7 @@ class ChannelFilterGUIChannelItem : public ChannelGraphItem
public:
ChannelFilterGUIChannelItem(const QString& name);
enum { Type = UserType + 2 };
enum {Type = UserType + 2};
virtual int type() const
{
return Type;
+29 -29
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <algorithm>
@@ -30,8 +30,8 @@
using namespace std;
ChannelFilterGUIDialog::ChannelFilterGUIDialog(QWidget *parent, QStringList selectedChannels, int selectedChannelMask, const vector<wstring>& channelNames) :
QDialog(parent),
ChannelFilterGUIDialog::ChannelFilterGUIDialog(QWidget* parent, QStringList selectedChannels, int selectedChannelMask, const vector<wstring>& channelNames)
: QDialog(parent),
ui(new Ui::ChannelFilterGUIDialog)
{
ui->setupUi(this);
@@ -68,26 +68,26 @@ ChannelFilterGUIDialog::ChannelFilterGUIDialog(QWidget *parent, QStringList sele
vector<wstring> remainingChannelNames = channelNames;
QStringList remainingSelectedChannels = selectedChannels;
if(selectedChannels.contains("ALL"))
if (selectedChannels.contains("ALL"))
{
ui->allChannelsCheckBox->setChecked(true);
remainingSelectedChannels.clear();
}
int channelIndex = 0;
for(QCheckBox* checkBox : checkBoxes)
for (QCheckBox* checkBox : checkBoxes)
{
int channelPos = checkBox->property(PROPERTY_POSITION).toInt();
QString channelName = checkBox->property(PROPERTY_NAME).toString();
bool exists = selectedChannelMask & channelPos;
checkBox->setVisible(exists);
if(exists)
if (exists)
{
channelIndex++;
bool checked = false;
remainingChannelNames.erase(remove(remainingChannelNames.begin(), remainingChannelNames.end(), channelName.toStdWString()), remainingChannelNames.end());
if(remainingSelectedChannels.removeOne(channelName))
if (remainingSelectedChannels.removeOne(channelName))
checked = true;
if(remainingSelectedChannels.removeOne(QString(channelIndex)))
if (remainingSelectedChannels.removeOne(QString(channelIndex)))
checked = true;
checkBox->setChecked(checked);
}
@@ -98,18 +98,18 @@ ChannelFilterGUIDialog::ChannelFilterGUIDialog(QWidget *parent, QStringList sele
}
ui->listWidget->clear();
for(wstring channelName : remainingChannelNames)
for (wstring channelName : remainingChannelNames)
{
QListWidgetItem* item = new QListWidgetItem(QString::fromStdWString(channelName));
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
if(remainingSelectedChannels.removeOne(QString::fromStdWString(channelName)))
if (remainingSelectedChannels.removeOne(QString::fromStdWString(channelName)))
item->setCheckState(Qt::Checked);
else
item->setCheckState(Qt::Unchecked);
ui->listWidget->addItem(item);
}
for(QString c : remainingSelectedChannels)
for (QString c : remainingSelectedChannels)
{
QListWidgetItem* item = new QListWidgetItem(c);
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
@@ -143,28 +143,28 @@ QStringList ChannelFilterGUIDialog::getSelectedChannels() const
{
QStringList selectedChannels;
if(ui->allChannelsCheckBox->isChecked())
if (ui->allChannelsCheckBox->isChecked())
{
selectedChannels.append("ALL");
}
else
{
for(QCheckBox* checkBox : checkBoxes)
for (QCheckBox* checkBox : checkBoxes)
{
if(checkBox->isChecked())
if (checkBox->isChecked())
{
QString channelName = checkBox->property(PROPERTY_NAME).toString();
selectedChannels.append(channelName);
}
}
for(int i = 0; i < ui->listWidget->count(); i++)
for (int i = 0; i < ui->listWidget->count(); i++)
{
QListWidgetItem* item = ui->listWidget->item(i);
if(item->checkState() == Qt::Checked)
if (item->checkState() == Qt::Checked)
{
QString text = item->text().trimmed();
if(text.length() > 0)
if (text.length() > 0)
selectedChannels.append(text.toUpper());
}
}
+15 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -31,7 +31,7 @@ class ChannelFilterGUIDialog : public QDialog
Q_OBJECT
public:
explicit ChannelFilterGUIDialog(QWidget *parent, QStringList selectedChannels, int selectedChannelMask, const std::vector<std::wstring>& channelNames);
explicit ChannelFilterGUIDialog(QWidget* parent, QStringList selectedChannels, int selectedChannelMask, const std::vector<std::wstring>& channelNames);
~ChannelFilterGUIDialog();
QStringList getSelectedChannels() const;
@@ -44,6 +44,6 @@ private slots:
void on_allChannelsCheckBox_toggled(bool checked);
private:
Ui::ChannelFilterGUIDialog *ui;
Ui::ChannelFilterGUIDialog* ui;
QList<QCheckBox*> checkBoxes;
};
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Editor/FilterTable.h"
@@ -41,7 +41,7 @@ IFilterGUI* ChannelFilterGUIFactory::createFilterGUI(QString& command, QString&
{
ChannelFilterGUI* result = NULL;
if(command == "Channel")
if (command == "Channel")
{
result = new ChannelFilterGUI(parameters, filterTable->getSelectedChannelMask());
}
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+20 -20
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ChannelFilterGUIChannelItem.h"
@@ -37,7 +37,7 @@ void ChannelFilterGUIScene::load(vector<wstring> channelNames, QStringList selec
channelNames.push_back(L"ALL");
for(unsigned i = 0; i < channelNames.size(); i++)
for (unsigned i = 0; i < channelNames.size(); i++)
{
QString c = QString::fromStdWString(channelNames[i]);
@@ -46,15 +46,15 @@ void ChannelFilterGUIScene::load(vector<wstring> channelNames, QStringList selec
addItem(item);
channelMap.insert(c, item);
if(c != "ALL")
if (c != "ALL")
channelMap.insert(QString().setNum(i), item);
lastItem = item;
}
for(QString c : selectedChannels)
for (QString c : selectedChannels)
{
ChannelFilterGUIChannelItem* item = channelMap.value(c.toUpper());
if(item == NULL)
if (item == NULL)
{
item = new ChannelFilterGUIChannelItem(c);
item->setPos(getNextChannelPoint(lastItem, false));
@@ -74,12 +74,12 @@ QStringList ChannelFilterGUIScene::getSelectedChannels()
{
QStringList selectedChannels;
for(QGraphicsItem* item : items(Qt::AscendingOrder))
for (QGraphicsItem* item : items(Qt::AscendingOrder))
{
ChannelFilterGUIChannelItem* channelItem = qgraphicsitem_cast<ChannelFilterGUIChannelItem*>(item);
if(channelItem != NULL)
if (channelItem != NULL)
{
if(channelItem->isSelected())
if (channelItem->isSelected())
selectedChannels.append(channelItem->getName());
}
}
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+15 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "CommentFilterGUI.h"
@@ -49,7 +49,7 @@ CommentFilterGUI::~CommentFilterGUI()
void CommentFilterGUI::configureChannels(vector<wstring>& channelNames)
{
if(ui->actionPowerOn->isChecked())
if (ui->actionPowerOn->isChecked())
{
child->configureChannels(channelNames);
}
@@ -65,7 +65,7 @@ void CommentFilterGUI::store(QString& command, QString& parameters)
{
child->store(command, parameters);
if(!ui->actionPowerOn->isChecked())
if (!ui->actionPowerOn->isChecked())
command = "# " + command;
}
+14 -15
View File
@@ -1,28 +1,27 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "Editor/IFilterGUI.h"
namespace Ui
{
namespace Ui {
class CommentFilterGUI;
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "helpers/StringHelper.h"
@@ -37,7 +37,7 @@ QList<FilterTemplate> CommentFilterGUIFactory::createFilterTemplates()
IFilterGUI* CommentFilterGUIFactory::createFilterGUI(QString& command, QString& parameters)
{
lastWasComment = command.length() > 0 && command[0] == '#';
if(lastWasComment)
if (lastWasComment)
command = command.mid(1).trimmed();
return NULL;
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+23 -23
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <QFileDialog>
@@ -24,8 +24,8 @@
#include "ConvolutionFilterGUI.h"
#include "ui_ConvolutionFilterGUI.h"
ConvolutionFilterGUI::ConvolutionFilterGUI(const QString& configPath, unsigned deviceSampleRate, const QString& path) :
ui(new Ui::ConvolutionFilterGUI), deviceSampleRate(deviceSampleRate)
ConvolutionFilterGUI::ConvolutionFilterGUI(const QString& configPath, unsigned deviceSampleRate, const QString& path)
: ui(new Ui::ConvolutionFilterGUI), deviceSampleRate(deviceSampleRate)
{
ui->setupUi(this);
@@ -51,19 +51,19 @@ void ConvolutionFilterGUI::on_selectFileToolButton_clicked()
QFileInfo fileInfo(configPath);
QDir configDir = fileInfo.absoluteDir();
QString path = ui->pathLineEdit->text();
if(path.length() > 0)
if (path.length() > 0)
fileInfo.setFile(configDir, path);
QFileDialog dialog(this, tr("Select impulse response file"), fileInfo.absolutePath(), "*.wav;*.flac;*.ogg");
dialog.setFileMode(QFileDialog::ExistingFile);
dialog.setNameFilter(tr("Impulse response (*.wav *.flac *.ogg)"));
if(path.length() > 0)
if (path.length() > 0)
dialog.selectFile(fileInfo.fileName());
if(dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
QString absolutePath = dialog.selectedFiles().first();
QString relativePath = configDir.relativeFilePath(absolutePath);
if(relativePath.startsWith("../../"))
if (relativePath.startsWith("../../"))
relativePath = absolutePath;
ui->pathLineEdit->setText(QDir::toNativeSeparators(relativePath));
updateFileInfo();
@@ -85,7 +85,7 @@ void ConvolutionFilterGUI::updateFileInfo()
QString error = "";
QString path = ui->pathLineEdit->text();
if(path.length() == 0)
if (path.length() == 0)
{
error = tr("No file selected");
labelsVisible = false;
@@ -95,7 +95,7 @@ void ConvolutionFilterGUI::updateFileInfo()
QFileInfo fileInfo(configPath);
QDir configDir = fileInfo.absoluteDir();
fileInfo.setFile(configDir, path);
if(!fileInfo.exists())
if (!fileInfo.exists())
{
error = tr("File not found");
labelsVisible = false;
@@ -106,7 +106,7 @@ void ConvolutionFilterGUI::updateFileInfo()
SF_INFO info;
SNDFILE* file = sf_wchar_open(path.toStdWString().c_str(), SFM_READ, &info);
if(file == NULL)
if (file == NULL)
{
error = tr("Unsupported file format");
labelsVisible = false;
@@ -120,7 +120,7 @@ void ConvolutionFilterGUI::updateFileInfo()
ui->labelSampleRateValue->setText(tr("%0 Hz").arg(sampleRate));
sf_close(file);
if(sampleRate != deviceSampleRate)
if (sampleRate != deviceSampleRate)
{
error = tr("The file sample rate does not match the device sample rate (%0 Hz)!\nSelect a different file or change the device configuration.").arg(deviceSampleRate);
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -43,7 +43,7 @@ private slots:
private:
void updateFileInfo();
Ui::ConvolutionFilterGUI *ui;
Ui::ConvolutionFilterGUI* ui;
QString configPath;
unsigned deviceSampleRate;
};
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "DeviceAPOInfo.h"
@@ -47,7 +47,7 @@ IFilterGUI* ConvolutionFilterGUIFactory::createFilterGUI(QString& command, QStri
{
ConvolutionFilterGUI* result = NULL;
if(command == "Convolution")
if (command == "Convolution")
{
result = new ConvolutionFilterGUI(configPath, deviceSampleRate, parameters.trimmed());
}
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+39 -39
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Editor/widgets/ResizeCorner.h"
@@ -27,8 +27,8 @@ static const int DEFAULT_HEIGHT = 88;
using namespace std;
CopyFilterGUI::CopyFilterGUI(CopyFilter* filter, FilterTable* filterTable) :
ui(new Ui::CopyFilterGUI)
CopyFilterGUI::CopyFilterGUI(CopyFilter* filter, FilterTable* filterTable)
: ui(new Ui::CopyFilterGUI)
{
ui->setupUi(this);
@@ -40,10 +40,10 @@ CopyFilterGUI::CopyFilterGUI(CopyFilter* filter, FilterTable* filterTable) :
ResizeCorner* cornerWidget = new ResizeCorner(filterTable,
QSize(0, 50), QSize(0, INT_MAX),
[this]() {
[this]() {
return QSize(0, ui->scrollArea->height());
},
[this](QSize size) {
[this](QSize size) {
ui->scrollArea->setFixedHeight(size.height());
}, ui->scrollArea);
cornerWidget->setCursor(Qt::SizeVerCursor);
@@ -66,7 +66,7 @@ void CopyFilterGUI::configureChannels(vector<wstring>& channelNames)
{
vector<Assignment> assignments = ui->form->buildAssignments();
if(channelNames != inputChannelNames)
if (channelNames != inputChannelNames)
{
inputChannelNames = channelNames;
@@ -74,24 +74,24 @@ void CopyFilterGUI::configureChannels(vector<wstring>& channelNames)
ui->form->setChannelNames(channelNames);
}
for(Assignment assignment : assignments)
for (Assignment assignment : assignments)
{
if(assignment.targetChannel == L"")
if (assignment.targetChannel == L"")
continue;
bool hasSummand = false;
for(Assignment::Summand summand : assignment.sourceSum)
for (Assignment::Summand summand : assignment.sourceSum)
{
if(summand.channel != L" ")
if (summand.channel != L" ")
{
hasSummand = true;
break;
}
}
if(!hasSummand)
if (!hasSummand)
continue;
int channelIndex = ChannelHelper::getChannelIndex(assignment.targetChannel, channelNames, true);
if(channelIndex == -1)
if (channelIndex == -1)
channelNames.push_back(assignment.targetChannel);
}
}
@@ -102,29 +102,29 @@ void CopyFilterGUI::store(QString& command, QString& parameters)
std::vector<Assignment> assignments;
if(ui->tabWidget->currentIndex() == 0)
if (ui->tabWidget->currentIndex() == 0)
assignments = scene->buildAssignments();
else
assignments = ui->form->buildAssignments();
bool firstAssignment = true;
for(const Assignment& assignment : assignments)
for (const Assignment& assignment : assignments)
{
if(assignment.targetChannel == L"")
if (assignment.targetChannel == L"")
continue;
bool firstSummand = true;
for(const Assignment::Summand& summand : assignment.sourceSum)
for (const Assignment::Summand& summand : assignment.sourceSum)
{
// skip not yet filled row
if(summand.channel == L" ")
if (summand.channel == L" ")
continue;
if(firstSummand)
if (firstSummand)
{
firstSummand = false;
if(firstAssignment)
if (firstAssignment)
firstAssignment = false;
else
parameters += " ";
@@ -140,25 +140,25 @@ void CopyFilterGUI::store(QString& command, QString& parameters)
bool hasChannel = summand.channel != L"";
bool hasFactor = !hasChannel || summand.factor != 1.0 || summand.isDecibel;
if(hasFactor)
if (hasFactor)
{
QString factorString;
factorString.setNum(summand.factor);
if(factorString != "0" && !factorString.contains('.'))
if (factorString != "0" && !factorString.contains('.'))
factorString += ".0";
parameters += factorString;
if(summand.isDecibel)
if (summand.isDecibel)
parameters += "dB";
}
if(hasFactor && hasChannel)
if (hasFactor && hasChannel)
parameters += "*";
if(hasChannel)
if (hasChannel)
parameters += QString::fromStdWString(summand.channel);
}
if(ui->tabWidget->currentIndex() == 0)
if (ui->tabWidget->currentIndex() == 0)
ui->form->load(assignments);
else
scene->load(inputChannelNames, assignments);
@@ -173,8 +173,8 @@ void CopyFilterGUI::loadPreferences(const QVariantMap& prefs)
void CopyFilterGUI::storePreferences(QVariantMap& prefs)
{
if(ui->scrollArea->height() != DEFAULT_HEIGHT)
if (ui->scrollArea->height() != DEFAULT_HEIGHT)
prefs.insert("height", ui->scrollArea->height());
if(ui->tabWidget->currentIndex() != 0)
if (ui->tabWidget->currentIndex() != 0)
prefs.insert("tabIndex", ui->tabWidget->currentIndex());
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -44,7 +44,7 @@ public:
void storePreferences(QVariantMap& prefs) override;
private:
Ui::CopyFilterGUI *ui;
Ui::CopyFilterGUI* ui;
CopyFilterGUIScene* scene;
std::vector<std::wstring> inputChannelNames;
+35 -35
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <QGraphicsScene>
@@ -22,8 +22,8 @@
#include "CopyFilterGUIScene.h"
#include "CopyFilterGUIChannelItem.h"
CopyFilterGUIChannelItem::CopyFilterGUIChannelItem(const QString& name, bool output) :
ChannelGraphItem(name), output(output)
CopyFilterGUIChannelItem::CopyFilterGUIChannelItem(const QString& name, bool output)
: ChannelGraphItem(name), output(output)
{
setZValue(-1);
}
@@ -31,19 +31,19 @@ CopyFilterGUIChannelItem::CopyFilterGUIChannelItem(const QString& name, bool out
void CopyFilterGUIChannelItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
QColor color;
if(output)
if (output)
color = QColor(255, 194, 194);
else
color = QColor(176, 255, 176);
ChannelGraphItem::paint(painter, color) ;
ChannelGraphItem::paint(painter, color);
}
QPointF CopyFilterGUIChannelItem::getPerimeterPointTo(QPointF oppositePoint)
{
QRectF rect = boundingRect();
if(output)
if (output)
return scenePos() + QPointF(rect.center().x(), rect.top());
else
return scenePos() + QPointF(rect.center().x(), rect.top() + rect.height());
@@ -54,10 +54,10 @@ CopyFilterGUIChannelItem* CopyFilterGUIChannelItem::findAt(QPointF mousePos)
CopyFilterGUIChannelItem* result = NULL;
QList<QGraphicsItem*> items = scene()->items(mousePos);
for(QGraphicsItem* item : items)
for (QGraphicsItem* item : items)
{
CopyFilterGUIChannelItem* channelItem = qgraphicsitem_cast<CopyFilterGUIChannelItem*>(item);
if(channelItem != NULL && channelItem->output != output)
if (channelItem != NULL && channelItem->output != output)
{
result = channelItem;
break;
@@ -74,7 +74,7 @@ QLineF CopyFilterGUIChannelItem::getLineTo(CopyFilterGUIChannelItem* item)
QPointF startPoint = getPerimeterPointTo(endPoint);
QLineF line;
if(output)
if (output)
line = QLineF(endPoint, startPoint);
else
line = QLineF(startPoint, endPoint);
@@ -88,23 +88,23 @@ void CopyFilterGUIChannelItem::mousePressEvent(QGraphicsSceneMouseEvent* event)
void CopyFilterGUIChannelItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
{
if(currentConnection == NULL)
if (currentConnection == NULL)
{
if( !boundingRect().contains(event->pos()))
if (!boundingRect().contains(event->pos()))
{
currentConnection = new CopyFilterGUIConnectionItem();
scene()->addItem(currentConnection);
}
}
if(currentConnection != NULL)
if (currentConnection != NULL)
{
CopyFilterGUIChannelItem* item = findAt(event->scenePos());
if(item == NULL)
if (item == NULL)
{
QLineF line;
if(output)
if (output)
line = QLineF(event->scenePos(), getPerimeterPointTo(event->scenePos()));
else
line = QLineF(getPerimeterPointTo(event->scenePos()), event->scenePos());
@@ -119,14 +119,14 @@ void CopyFilterGUIChannelItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
void CopyFilterGUIChannelItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
{
if(currentConnection != NULL)
if (currentConnection != NULL)
{
CopyFilterGUIChannelItem* item = findAt(event->scenePos());
if(item != NULL)
if (item != NULL)
{
CopyFilterGUIChannelItem* source;
CopyFilterGUIChannelItem* target;
if(output)
if (output)
{
source = item;
target = this;
@@ -138,13 +138,13 @@ void CopyFilterGUIChannelItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* event
}
double factor = 1.0;
if(source->getName() == "")
if (source->getName() == "")
factor = 0.0;
scene()->addItem(new CopyFilterGUIConnectionItem(source, target, factor, false));
emit ((CopyFilterGUIScene*)scene())->updateModel();
emit ((CopyFilterGUIScene*)scene())->updateChannels();
emit((CopyFilterGUIScene*)scene())->updateModel();
emit((CopyFilterGUIScene*)scene())->updateChannels();
}
scene()->removeItem(currentConnection);
@@ -155,12 +155,12 @@ void CopyFilterGUIChannelItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* event
{
scene()->clearSelection();
QList<QGraphicsItem*> items = scene()->items();
for(QGraphicsItem* item : items)
for (QGraphicsItem* item : items)
{
CopyFilterGUIConnectionItem* connItem = qgraphicsitem_cast<CopyFilterGUIConnectionItem*>(item);
if(connItem != NULL)
if (connItem != NULL)
{
if(connItem->getSource() == this || connItem->getTarget() == this)
if (connItem->getSource() == this || connItem->getTarget() == this)
connItem->setSelected(true);
}
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -30,7 +30,7 @@ class CopyFilterGUIChannelItem : public ChannelGraphItem
public:
CopyFilterGUIChannelItem(const QString& name, bool output);
enum { Type = UserType + 2 };
enum {Type = UserType + 2};
virtual int type() const
{
return Type;
+25 -25
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <QGraphicsScene>
@@ -64,7 +64,7 @@ QPainterPath CopyFilterGUIConnectionItem::shape() const
QPainterPath path;
path.setFillRule(Qt::WindingFill);
double length = line().length();
if(length > 0)
if (length > 0)
{
double offset = min(length, maxArrowSize);
QLineF unit = l.unitVector();
@@ -89,13 +89,13 @@ QPainterPath CopyFilterGUIConnectionItem::shape() const
polygon2.append(p1 + 3 * n);
path.addPolygon(polygon2);
if(factor != 1.0 || isDecibel)
if (factor != 1.0 || isDecibel)
{
QFont font;
font.setPixelSize(10);
QPointF center = (l.p1() + l.p2()) / 2;
QString text = QString("%1").arg(factor);
if(isDecibel)
if (isDecibel)
text += " dB";
QFontMetrics fontMetrics(font);
@@ -119,10 +119,10 @@ bool CopyFilterGUIConnectionItem::contains(const QPointF& point) const
void CopyFilterGUIConnectionItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
QLineF l = line();
if(!l.isNull())
if (!l.isNull())
{
painter->setBrush(Qt::black);
if(isSelected())
if (isSelected())
{
painter->setBrush(Qt::blue);
painter->setPen(QPen(Qt::blue, 1.5));
@@ -146,14 +146,14 @@ void CopyFilterGUIConnectionItem::paint(QPainter* painter, const QStyleOptionGra
painter->drawPolygon(polygon);
if(factor != 1.0 || isDecibel)
if (factor != 1.0 || isDecibel)
{
QFont font = painter->font();
font.setPixelSize(10);
painter->setFont(font);
QPointF center = (l.p1() + l.p2()) / 2;
QString text = QString("%1").arg(factor);
if(isDecibel)
if (isDecibel)
text += " dB";
QSizeF size = painter->fontMetrics().size(0, text);
@@ -171,7 +171,7 @@ void CopyFilterGUIConnectionItem::paint(QPainter* painter, const QStyleOptionGra
void CopyFilterGUIConnectionItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
{
QString text = QString("%1").arg(factor);
if(isDecibel)
if (isDecibel)
text += " dB";
ResizingLineEdit* lineEdit = new ResizingLineEdit("");
@@ -199,7 +199,7 @@ void CopyFilterGUIConnectionItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* even
QVariant CopyFilterGUIConnectionItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant& value)
{
if(change == ItemSelectedHasChanged)
if (change == ItemSelectedHasChanged)
{
setZValue(isSelected() ? 1 : 0);
}
@@ -211,7 +211,7 @@ void CopyFilterGUIConnectionItem::lineEditEditingFinished()
{
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(QObject::sender());
// might be called twice
if(!lineEdit->isVisible())
if (!lineEdit->isVisible())
return;
QString text = lineEdit->text();
@@ -220,7 +220,7 @@ void CopyFilterGUIConnectionItem::lineEditEditingFinished()
int lengthBefore = text.length();
text.replace("db", "", Qt::CaseInsensitive);
double value = text.toDouble(&ok);
if(ok)
if (ok)
{
factor = value;
isDecibel = text.length() < lengthBefore;
@@ -229,7 +229,7 @@ void CopyFilterGUIConnectionItem::lineEditEditingFinished()
lineEdit->setVisible(false);
lineEdit->deleteLater();
emit ((CopyFilterGUIScene*)scene())->updateModel();
emit((CopyFilterGUIScene*)scene())->updateModel();
}
CopyFilterGUIChannelItem* CopyFilterGUIConnectionItem::getSource() const
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -31,7 +31,7 @@ public:
CopyFilterGUIConnectionItem();
CopyFilterGUIConnectionItem(CopyFilterGUIChannelItem* source, CopyFilterGUIChannelItem* target, double factor, bool isDecibel);
enum { Type = UserType + 1 };
enum {Type = UserType + 1};
virtual int type() const
{
return Type;
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "filters/CopyFilter.h"
@@ -42,17 +42,17 @@ IFilterGUI* CopyFilterGUIFactory::createFilterGUI(QString& command, QString& par
{
CopyFilterGUI* result = NULL;
if(command == "Copy")
if (command == "Copy")
{
CopyFilterFactory factory;
std::vector<IFilter*> filters = factory.createFilter(L"", command.toStdWString(), parameters.toStdWString());
if(!filters.empty())
if (!filters.empty())
{
CopyFilter* filter = (CopyFilter*)filters[0];
result = new CopyFilterGUI(filter, filterTable);
}
for(IFilter* f : filters)
for (IFilter* f : filters)
{
f->~IFilter();
MemoryHelper::free(f);
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+33 -33
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <algorithm>
@@ -29,20 +29,20 @@
using namespace std;
CopyFilterGUIForm::CopyFilterGUIForm(QWidget *parent) :
QWidget(parent)
CopyFilterGUIForm::CopyFilterGUIForm(QWidget* parent)
: QWidget(parent)
{
}
void CopyFilterGUIForm::load(vector<Assignment> assignments)
{
if(gridLayout != NULL)
if (gridLayout != NULL)
delete gridLayout;
for(QObject* object : children())
for (QObject* object : children())
{
QWidget* widget = qobject_cast<QWidget*>(object);
if(widget != NULL)
if (widget != NULL)
widget->setVisible(false);
object->deleteLater();
}
@@ -55,20 +55,20 @@ void CopyFilterGUIForm::load(vector<Assignment> assignments)
gridLayout->setColumnStretch(5, 1);
int row = 0;
for(Assignment assignment : assignments)
for (Assignment assignment : assignments)
{
QString oc = QString::fromStdWString(assignment.targetChannel);
bool firstSummand = true;
for(Assignment::Summand summand : assignment.sourceSum)
for (Assignment::Summand summand : assignment.sourceSum)
{
if(firstSummand)
if (firstSummand)
{
gridLayout->addWidget(new QLabel(tr("Channel"), this), row, 0);
QComboBox* targetComboBox = new QComboBox(this);
targetComboBox->setEditable(true);
for(wstring channelName : inputChannelNames)
for (wstring channelName : inputChannelNames)
targetComboBox->addItem(QString::fromStdWString(channelName));
targetComboBox->setEditText(oc);
connect(targetComboBox, SIGNAL(editTextChanged(QString)), this, SIGNAL(updateModel()));
@@ -96,7 +96,7 @@ void CopyFilterGUIForm::load(vector<Assignment> assignments)
connect(addSummandButton, SIGNAL(pressed()), this, SLOT(addSummand()));
QPushButton* removeButton = new QPushButton(this);
if(assignment.sourceSum.size() == 1)
if (assignment.sourceSum.size() == 1)
removeButton->setText(tr("Remove assignment"));
else
removeButton->setText(tr("Remove summand"));
@@ -122,16 +122,16 @@ void CopyFilterGUIForm::setChannelNames(const vector<wstring>& channelNames)
{
inputChannelNames = channelNames;
for(int row = 0; row < gridLayout->rowCount() - 1; row++)
for (int row = 0; row < gridLayout->rowCount() - 1; row++)
{
QLayoutItem* item = gridLayout->itemAtPosition(row, 1);
if(item != NULL)
if (item != NULL)
{
QComboBox* targetComboBox = qobject_cast<QComboBox*>(item->widget());
targetComboBox->blockSignals(true);
QString text = targetComboBox->currentText();
targetComboBox->clear();
for(wstring channelName : channelNames)
for (wstring channelName : channelNames)
targetComboBox->addItem(QString::fromStdWString(channelName));
targetComboBox->setEditText(text);
targetComboBox->blockSignals(false);
@@ -148,10 +148,10 @@ vector<Assignment> CopyFilterGUIForm::buildAssignments(QWidget* pressedButton)
vector<Assignment> assignments;
Assignment* currentAssignment = NULL;
for(int row = 0; row < gridLayout->rowCount() - 1; row++)
for (int row = 0; row < gridLayout->rowCount() - 1; row++)
{
QLayoutItem* item = gridLayout->itemAtPosition(row, 1);
if(item != NULL)
if (item != NULL)
{
QComboBox* targetComboBox = qobject_cast<QComboBox*>(item->widget());
QString oc = targetComboBox->currentText().trimmed();
@@ -160,12 +160,12 @@ vector<Assignment> CopyFilterGUIForm::buildAssignments(QWidget* pressedButton)
currentAssignment->targetChannel = oc.toStdWString();
}
if(currentAssignment != NULL)
if (currentAssignment != NULL)
{
if(pressedButton != NULL)
if (pressedButton != NULL)
{
QWidget* removeButton = gridLayout->itemAtPosition(row, 5)->widget();
if(removeButton == pressedButton)
if (removeButton == pressedButton)
{
continue;
}
@@ -175,10 +175,10 @@ vector<Assignment> CopyFilterGUIForm::buildAssignments(QWidget* pressedButton)
CopyFilterGUIRow* summandWidget = qobject_cast<CopyFilterGUIRow*>(summandItem->widget());
currentAssignment->sourceSum.push_back(summandWidget->buildSummand());
if(pressedButton != NULL)
if (pressedButton != NULL)
{
QWidget* addSummandButton = gridLayout->itemAtPosition(row, 4)->widget();
if(addSummandButton == pressedButton)
if (addSummandButton == pressedButton)
{
Assignment::Summand newSummand;
newSummand.channel = L" ";
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -29,7 +29,7 @@ class CopyFilterGUIForm : public QWidget
{
Q_OBJECT
public:
explicit CopyFilterGUIForm(QWidget *parent = 0);
explicit CopyFilterGUIForm(QWidget* parent = 0);
void load(std::vector<Assignment> assignments);
void setChannelNames(const std::vector<std::wstring>& channelNames);
+24 -24
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "CopyFilterGUIRow.h"
@@ -22,8 +22,8 @@
using namespace std;
CopyFilterGUIRow::CopyFilterGUIRow(Assignment::Summand summand, std::vector<wstring> channelNames, QWidget *parent) :
QWidget(parent),
CopyFilterGUIRow::CopyFilterGUIRow(Assignment::Summand summand, std::vector<wstring> channelNames, QWidget* parent)
: QWidget(parent),
ui(new Ui::CopyFilterGUIRow)
{
ui->setupUi(this);
@@ -34,11 +34,11 @@ CopyFilterGUIRow::CopyFilterGUIRow(Assignment::Summand summand, std::vector<wstr
ui->modeComboBox->addItem(tr("Constant value"), 'v');
QChar mode;
if(summand.channel == L"")
if (summand.channel == L"")
mode = 'v';
else if(summand.isDecibel)
else if (summand.isDecibel)
mode = 'd';
else if(summand.factor != 1.0)
else if (summand.factor != 1.0)
mode = 'f';
else
mode = 'c';
@@ -47,7 +47,7 @@ CopyFilterGUIRow::CopyFilterGUIRow(Assignment::Summand summand, std::vector<wstr
ui->factorSpinBox->setValue(summand.factor);
for(wstring channelName : channelNames)
for (wstring channelName : channelNames)
ui->channelComboBox->addItem(QString::fromStdWString(channelName));
ui->channelComboBox->setEditText(QString::fromStdWString(summand.channel).trimmed());
@@ -67,7 +67,7 @@ void CopyFilterGUIRow::setChannelNames(const vector<wstring>& channelNames)
ui->channelComboBox->blockSignals(true);
QString text = ui->channelComboBox->currentText();
ui->channelComboBox->clear();
for(wstring channelName : channelNames)
for (wstring channelName : channelNames)
ui->channelComboBox->addItem(QString::fromStdWString(channelName));
ui->channelComboBox->setEditText(text);
ui->channelComboBox->blockSignals(false);
@@ -78,18 +78,18 @@ Assignment::Summand CopyFilterGUIRow::buildSummand()
Assignment::Summand summand;
QChar mode = ui->modeComboBox->currentData().toChar();
if(mode != 'c')
if (mode != 'c')
summand.factor = ui->factorSpinBox->value();
else
summand.factor = 1.0;
// fix for rounding error when using the spin buttons
if(abs(summand.factor) < 1e-10)
if (abs(summand.factor) < 1e-10)
summand.factor = 0.0;
if(mode != 'v')
if (mode != 'v')
summand.channel = ui->channelComboBox->currentText().trimmed().toStdWString();
// allow channel mode to be remembered when reloading
if(mode == 'c' && summand.channel == L"")
if (mode == 'c' && summand.channel == L"")
summand.channel = L" ";
summand.isDecibel = mode == 'd';
+15 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -32,7 +32,7 @@ class CopyFilterGUIRow : public QWidget
Q_OBJECT
public:
explicit CopyFilterGUIRow(Assignment::Summand summand, std::vector<std::wstring> channelNames, QWidget *parent = 0);
explicit CopyFilterGUIRow(Assignment::Summand summand, std::vector<std::wstring> channelNames, QWidget* parent = 0);
~CopyFilterGUIRow();
void setChannelNames(const std::vector<std::wstring>& channelNames);
@@ -46,5 +46,5 @@ private slots:
void on_modeComboBox_currentIndexChanged(int index);
private:
Ui::CopyFilterGUIRow *ui;
Ui::CopyFilterGUIRow* ui;
};
+30 -30
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <algorithm>
@@ -39,7 +39,7 @@ void CopyFilterGUIScene::load(const vector<wstring>& channelNames, vector<Assign
QGraphicsItem* lastInputItem = NULL;
lastOutputItem = NULL;
for(unsigned i = 0; i < channelNames.size(); i++)
for (unsigned i = 0; i < channelNames.size(); i++)
{
QString c = QString::fromStdWString(channelNames[i]);
@@ -65,13 +65,13 @@ void CopyFilterGUIScene::load(const vector<wstring>& channelNames, vector<Assign
addItem(noChannelItem);
inputChannelMap.insert("", noChannelItem);
for(Assignment assignment : assignments)
for (Assignment assignment : assignments)
{
QString oc = QString::fromStdWString(assignment.targetChannel);
if(oc == "")
if (oc == "")
continue;
CopyFilterGUIChannelItem* outputItem = outputChannelMap.value(oc.toUpper());
if(outputItem == NULL)
if (outputItem == NULL)
{
outputItem = new CopyFilterGUIChannelItem(oc, true);
outputItem->setPos(getNextChannelPoint(lastOutputItem, true));
@@ -80,13 +80,13 @@ void CopyFilterGUIScene::load(const vector<wstring>& channelNames, vector<Assign
outputChannelMap.insert(oc, outputItem);
lastOutputItem = outputItem;
}
for(Assignment::Summand summand : assignment.sourceSum)
for (Assignment::Summand summand : assignment.sourceSum)
{
QString ic = QString::fromStdWString(summand.channel);
if(ic == " ")
if (ic == " ")
continue;
CopyFilterGUIChannelItem* inputItem = inputChannelMap.value(ic.toUpper());
if(inputItem == NULL)
if (inputItem == NULL)
{
inputItem = new CopyFilterGUIChannelItem(ic, false);
inputItem->setPos(getNextChannelPoint(lastInputItem, false));
@@ -114,19 +114,19 @@ std::vector<Assignment> CopyFilterGUIScene::buildAssignments()
{
std::vector<CopyFilterGUIConnectionItem*> connItems;
for(QGraphicsItem* item : items())
for (QGraphicsItem* item : items())
{
CopyFilterGUIConnectionItem* connItem = qgraphicsitem_cast<CopyFilterGUIConnectionItem*>(item);
if(connItem != NULL && connItem->getTarget() != NULL)
if (connItem != NULL && connItem->getTarget() != NULL)
{
connItems.push_back(connItem);
}
}
std::sort(connItems.begin(), connItems.end(), [](CopyFilterGUIConnectionItem * a, CopyFilterGUIConnectionItem * b)
std::sort(connItems.begin(), connItems.end(), [](CopyFilterGUIConnectionItem* a, CopyFilterGUIConnectionItem* b)
{
double diff = a->getTarget()->x() - b->getTarget()->x();
if(diff == 0.0)
if (diff == 0.0)
diff = a->getSource()->x() - b->getSource()->x();
return diff < 0;
@@ -134,11 +134,11 @@ std::vector<Assignment> CopyFilterGUIScene::buildAssignments()
std::vector<Assignment> assignments;
QHash<QString, Assignment*> channelAssignmentMap;
for(CopyFilterGUIConnectionItem* connItem : connItems)
for (CopyFilterGUIConnectionItem* connItem : connItems)
{
QString oc = connItem->getTarget()->getName();
Assignment* assignment = channelAssignmentMap.value(oc);
if(assignment == NULL)
if (assignment == NULL)
{
Assignment newAssignment;
newAssignment.targetChannel = oc.toStdWString();
@@ -177,7 +177,7 @@ void CopyFilterGUIScene::lineEditEditingFinished()
{
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(QObject::sender());
// might be called twice
if(!lineEdit->isVisible())
if (!lineEdit->isVisible())
return;
QString text = lineEdit->text();
@@ -197,12 +197,12 @@ void CopyFilterGUIScene::lineEditEditingFinished()
void CopyFilterGUIScene::keyPressEvent(QKeyEvent* event)
{
// focusItem != NULL means that the cursor is inside a line edit
if(event->key() == Qt::Key_Delete && focusItem() == NULL)
if (event->key() == Qt::Key_Delete && focusItem() == NULL)
{
for(QGraphicsItem* item : selectedItems())
for (QGraphicsItem* item : selectedItems())
{
CopyFilterGUIConnectionItem* connectionItem = qgraphicsitem_cast<CopyFilterGUIConnectionItem*>(item);
if(connectionItem != NULL)
if (connectionItem != NULL)
{
removeItem(connectionItem);
delete connectionItem;
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "DelayFilterGUI.h"
@@ -24,8 +24,8 @@ static const double dialSteps = 1000;
static const double dialMin = 1.0;
static const double dialMax = 10000.0;
DelayFilterGUI::DelayFilterGUI(double delay, bool isMs) :
ui(new Ui::DelayFilterGUI)
DelayFilterGUI::DelayFilterGUI(double delay, bool isMs)
: ui(new Ui::DelayFilterGUI)
{
ui->setupUi(this);
@@ -42,7 +42,7 @@ void DelayFilterGUI::store(QString& command, QString& parameters)
{
command = "Delay";
parameters = QString("%0").arg(ui->delaySpinBox->value());
if(ui->unitComboBox->currentIndex() == 0)
if (ui->unitComboBox->currentIndex() == 0)
parameters += " ms";
else
parameters += " samples";
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -43,5 +43,5 @@ private slots:
void on_delaySpinBox_valueChanged(double value);
private:
Ui::DelayFilterGUI *ui;
Ui::DelayFilterGUI* ui;
};
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "filters/DelayFilter.h"
@@ -37,17 +37,17 @@ IFilterGUI* DelayFilterGUIFactory::createFilterGUI(QString& command, QString& pa
{
DelayFilterGUI* result = NULL;
if(command == "Delay")
if (command == "Delay")
{
DelayFilterFactory factory;
std::vector<IFilter*> filters = factory.createFilter(L"", command.toStdWString(), parameters.toStdWString());
if(!filters.empty())
if (!filters.empty())
{
DelayFilter* filter = (DelayFilter*)filters[0];
result = new DelayFilterGUI(filter->getDelay(), filter->getIsMs());
}
for(IFilter* f : filters)
for (IFilter* f : filters)
{
f->~IFilter();
MemoryHelper::free(f);
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -29,5 +29,5 @@ public:
explicit DelayFilterGUIFactory();
QList<FilterTemplate> createFilterTemplates() override;
IFilterGUI*createFilterGUI(QString& command, QString& parameters) override;;
IFilterGUI* createFilterGUI(QString& command, QString& parameters) override;;
};
+25 -25
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <string>
@@ -25,8 +25,8 @@
using namespace std;
DeviceFilterGUI::DeviceFilterGUI(DeviceFilterGUIFactory* factory):
ui(new Ui::DeviceFilterGUI)
DeviceFilterGUI::DeviceFilterGUI(DeviceFilterGUIFactory* factory)
: ui(new Ui::DeviceFilterGUI)
{
ui->setupUi(this);
this->factory = factory;
@@ -52,7 +52,7 @@ void DeviceFilterGUI::load(const QString& parameters)
QTreeWidgetItem* lastItem = NULL;
if(parameters.trimmed() == "all")
if (parameters.trimmed() == "all")
{
QStringList values;
values.append("");
@@ -64,23 +64,23 @@ void DeviceFilterGUI::load(const QString& parameters)
else
{
const QList<DeviceAPOInfo>& devices = factory->getDevices();
for(const DeviceAPOInfo& apoInfo : devices)
for (const DeviceAPOInfo& apoInfo : devices)
{
if(!apoInfo.isInstalled)
if (!apoInfo.isInstalled)
continue;
wstring deviceString = apoInfo.connectionName + L" " + apoInfo.deviceName + L" " + apoInfo.deviceGuid;
if(DeviceFilterFactory::matchDevice(deviceString, pattern.toStdWString()))
if (DeviceFilterFactory::matchDevice(deviceString, pattern.toStdWString()))
{
QStringList values;
if(apoInfo.isInput)
if (apoInfo.isInput)
values.append(tr("Capture"));
else
values.append(tr("Playback"));
values.append(QString::fromStdWString(apoInfo.connectionName));
values.append(QString::fromStdWString(apoInfo.deviceName));
QString state;
if(apoInfo.isInstalled)
if (apoInfo.isInstalled)
state = tr("APO installed");
else
state = tr("APO not installed");
@@ -89,7 +89,7 @@ void DeviceFilterGUI::load(const QString& parameters)
}
}
if(ui->treeWidget->topLevelItemCount() == 0)
if (ui->treeWidget->topLevelItemCount() == 0)
{
QStringList values;
values.append("");
@@ -102,12 +102,12 @@ void DeviceFilterGUI::load(const QString& parameters)
}
}
for(int i = 0; i < ui->treeWidget->columnCount(); i++)
for (int i = 0; i < ui->treeWidget->columnCount(); i++)
ui->treeWidget->resizeColumnToContents(i);
int headerHeight = ui->treeWidget->header()->height();
int itemAreaHeight = 0;
if(lastItem != NULL)
if (lastItem != NULL)
itemAreaHeight = ui->treeWidget->visualItemRect(lastItem).bottom() + 1;
ui->treeWidget->setFixedHeight(headerHeight + itemAreaHeight + 3);
}
@@ -121,7 +121,7 @@ void DeviceFilterGUI::store(QString& command, QString& parameters)
void DeviceFilterGUI::on_pushButton_clicked()
{
DeviceFilterGUIDialog dialog(this, factory, pattern);
if(dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
load(dialog.getPattern());
emit updateModel();
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -40,7 +40,7 @@ private slots:
void on_pushButton_clicked();
private:
Ui::DeviceFilterGUI *ui;
Ui::DeviceFilterGUI* ui;
DeviceFilterGUIFactory* factory;
QString pattern;
};
+28 -28
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "DeviceFilterGUIDialog.h"
@@ -24,8 +24,8 @@
using namespace std;
DeviceFilterGUIDialog::DeviceFilterGUIDialog(DeviceFilterGUI* gui, DeviceFilterGUIFactory* factory, const QString& pattern) :
QDialog(gui),
DeviceFilterGUIDialog::DeviceFilterGUIDialog(DeviceFilterGUI* gui, DeviceFilterGUIFactory* factory, const QString& pattern)
: QDialog(gui),
ui(new Ui::DeviceFilterGUIDialog)
{
ui->setupUi(this);
@@ -43,13 +43,13 @@ DeviceFilterGUIDialog::DeviceFilterGUIDialog(DeviceFilterGUI* gui, DeviceFilterG
QTreeWidgetItem* inputNode = new QTreeWidgetItem(ui->treeWidget, QStringList(tr("Capture devices")));
inputNode->setExpanded(true);
const QList<DeviceAPOInfo>& devices = factory->getDevices();
for(const DeviceAPOInfo& apoInfo : devices)
for (const DeviceAPOInfo& apoInfo : devices)
{
QStringList values;
values.append(QString::fromStdWString(apoInfo.connectionName));
values.append(QString::fromStdWString(apoInfo.deviceName));
QString state;
if(apoInfo.isInstalled)
if (apoInfo.isInstalled)
state = tr("APO installed");
else
state = tr("APO not installed");
@@ -61,12 +61,12 @@ DeviceFilterGUIDialog::DeviceFilterGUIDialog(DeviceFilterGUI* gui, DeviceFilterG
item->setCheckState(0, matches ? Qt::Checked : Qt::Unchecked);
item->setData(0, Qt::UserRole, QVariant::fromValue(&apoInfo));
item->setHidden(!matches && !apoInfo.isInstalled && ui->showOnlyInstalledCheckBox->isChecked());
if(!apoInfo.isInstalled)
for(int i = 0; i < ui->treeWidget->columnCount(); i++)
if (!apoInfo.isInstalled)
for (int i = 0; i < ui->treeWidget->columnCount(); i++)
item->setForeground(i, QBrush(Qt::gray));
}
for(int i = 0; i < ui->treeWidget->columnCount(); i++)
for (int i = 0; i < ui->treeWidget->columnCount(); i++)
ui->treeWidget->resizeColumnToContents(i);
}
@@ -77,22 +77,22 @@ DeviceFilterGUIDialog::~DeviceFilterGUIDialog()
QString DeviceFilterGUIDialog::getPattern()
{
if(ui->allDevicesCheckBox->isChecked())
if (ui->allDevicesCheckBox->isChecked())
{
return "all";
}
else
{
QString pattern = "";
for(int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
{
QTreeWidgetItem* groupItem = ui->treeWidget->topLevelItem(i);
for(int j = 0; j < groupItem->childCount(); j++)
for (int j = 0; j < groupItem->childCount(); j++)
{
QTreeWidgetItem* item = groupItem->child(j);
if(item->checkState(0) == Qt::Checked)
if (item->checkState(0) == Qt::Checked)
{
if(pattern != "")
if (pattern != "")
pattern += "; ";
const DeviceAPOInfo* apoInfo = item->data(0, Qt::UserRole).value<const DeviceAPOInfo*>();
wstring deviceString = apoInfo->connectionName + L" " + apoInfo->deviceName + L" " + apoInfo->deviceGuid;
@@ -112,10 +112,10 @@ void DeviceFilterGUIDialog::on_allDevicesCheckBox_toggled(bool checked)
void DeviceFilterGUIDialog::on_showOnlyInstalledCheckBox_toggled(bool checked)
{
for(int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
{
QTreeWidgetItem* groupItem = ui->treeWidget->topLevelItem(i);
for(int j = 0; j < groupItem->childCount(); j++)
for (int j = 0; j < groupItem->childCount(); j++)
{
QTreeWidgetItem* item = groupItem->child(j);
const DeviceAPOInfo* apoInfo = item->data(0, Qt::UserRole).value<const DeviceAPOInfo*>();
@@ -123,6 +123,6 @@ void DeviceFilterGUIDialog::on_showOnlyInstalledCheckBox_toggled(bool checked)
}
}
for(int i = 0; i < ui->treeWidget->columnCount(); i++)
for (int i = 0; i < ui->treeWidget->columnCount(); i++)
ui->treeWidget->resizeColumnToContents(i);
}
+15 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -33,7 +33,7 @@ class DeviceFilterGUIDialog : public QDialog
Q_OBJECT
public:
explicit DeviceFilterGUIDialog( DeviceFilterGUI* gui, DeviceFilterGUIFactory* factory, const QString& pattern);
explicit DeviceFilterGUIDialog(DeviceFilterGUI* gui, DeviceFilterGUIFactory* factory, const QString& pattern);
~DeviceFilterGUIDialog();
QString getPattern();
@@ -44,7 +44,7 @@ private slots:
void on_showOnlyInstalledCheckBox_toggled(bool checked);
private:
Ui::DeviceFilterGUIDialog *ui;
Ui::DeviceFilterGUIDialog* ui;
};
Q_DECLARE_METATYPE(const DeviceAPOInfo*)
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Editor/FilterTable.h"
@@ -42,7 +42,7 @@ IFilterGUI* DeviceFilterGUIFactory::createFilterGUI(QString& command, QString& p
{
DeviceFilterGUI* result = NULL;
if(command == "Device")
if (command == "Device")
{
result = new DeviceFilterGUI(this);
result->load(parameters);
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ExpressionFilterGUIFactory.h"
@@ -22,7 +22,7 @@
IFilterGUI* ExpressionFilterGUIFactory::createFilterGUI(QString& command, QString& parameters)
{
// do not create a gui if parameters contain expressions
if(parameters.contains('`'))
if (parameters.contains('`'))
command = "";
return NULL;
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+59 -59
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <vector>
@@ -36,8 +36,8 @@ using namespace std;
QRegularExpression GraphicEQFilterGUI::numberRegEx("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?");
GraphicEQFilterGUI::GraphicEQFilterGUI(GraphicEQFilter* filter, QString configPath, FilterTable* filterTable) :
ui(new Ui::GraphicEQFilterGUI), configPath(configPath)
GraphicEQFilterGUI::GraphicEQFilterGUI(GraphicEQFilter* filter, QString configPath, FilterTable* filterTable)
: ui(new Ui::GraphicEQFilterGUI), configPath(configPath)
{
ui->setupUi(this);
@@ -46,10 +46,10 @@ GraphicEQFilterGUI::GraphicEQFilterGUI(GraphicEQFilter* filter, QString configPa
ResizeCorner* cornerWidget = new ResizeCorner(filterTable,
QSize(0, ui->graphicsView->minimumHeight()), QSize(10000 - ui->tableWidget->minimumWidth(), INT_MAX),
[this]() {
[this]() {
return QSize(10000 - ui->tableWidget->width(), ui->graphicsView->height());
},
[this](QSize size) {
[this](QSize size) {
ui->tableWidget->setFixedWidth(10000 - size.width());
ui->graphicsView->setFixedHeight(size.height());
}, ui->graphicsView);
@@ -71,7 +71,7 @@ GraphicEQFilterGUI::GraphicEQFilterGUI(GraphicEQFilter* filter, QString configPa
scene->setNodes(filter->getNodes());
int bandCount = scene->verifyBands(filter->getNodes());
switch(bandCount)
switch (bandCount)
{
case 15:
ui->radioButton15->click();
@@ -91,14 +91,14 @@ GraphicEQFilterGUI::~GraphicEQFilterGUI()
delete ui;
}
void GraphicEQFilterGUI::store(QString & command, QString & parameters)
void GraphicEQFilterGUI::store(QString& command, QString& parameters)
{
command = "GraphicEQ";
bool first = true;
for(FilterNode node : scene->getNodes())
for (FilterNode node : scene->getNodes())
{
if(first)
if (first)
first = false;
else
parameters += "; ";
@@ -113,7 +113,7 @@ void GraphicEQFilterGUI::loadPreferences(const QVariantMap& prefs)
ui->graphicsView->setFixedHeight(prefs.value("viewHeight", DEFAULT_VIEW_HEIGHT).toInt());
double zoomX = prefs.value("zoomX", 1.0).toDouble();
double zoomY = prefs.value("zoomY", 1.0).toDouble();
if(zoomX != 1.0 || zoomY != 1.0)
if (zoomX != 1.0 || zoomY != 1.0)
scene->setZoom(zoomX, zoomY);
int scrollX = prefs.value("scrollX", round(scene->hzToX(20))).toInt();
int scrollY = prefs.value("scrollY", round(scene->dbToY(22))).toInt();
@@ -122,21 +122,21 @@ void GraphicEQFilterGUI::loadPreferences(const QVariantMap& prefs)
void GraphicEQFilterGUI::storePreferences(QVariantMap& prefs)
{
if(ui->tableWidget->width() != DEFAULT_TABLE_WIDTH)
if (ui->tableWidget->width() != DEFAULT_TABLE_WIDTH)
prefs.insert("tableWidth", ui->tableWidget->width());
if(ui->graphicsView->height() != DEFAULT_VIEW_HEIGHT)
if (ui->graphicsView->height() != DEFAULT_VIEW_HEIGHT)
prefs.insert("viewHeight", ui->graphicsView->height());
if(scene->getZoomX() != 1.0)
if (scene->getZoomX() != 1.0)
prefs.insert("zoomX", scene->getZoomX());
if(scene->getZoomY() != 1.0)
if (scene->getZoomY() != 1.0)
prefs.insert("zoomY", scene->getZoomY());
QScrollBar* hScrollBar = ui->graphicsView->horizontalScrollBar();
int value = hScrollBar->value();
if(value != round(scene->hzToX(20)))
if (value != round(scene->hzToX(20)))
prefs.insert("scrollX", value);
QScrollBar* vScrollBar = ui->graphicsView->verticalScrollBar();
value = vScrollBar->value();
if(value != round(scene->dbToY(22)))
if (value != round(scene->dbToY(22)))
prefs.insert("scrollY", value);
}
@@ -180,7 +180,7 @@ void GraphicEQFilterGUI::moveRow(int fromIndex, int toIndex)
ui->tableWidget->insertRow(toIndex);
ui->tableWidget->setItem(toIndex, 0, freqItem);
ui->tableWidget->setItem(toIndex, 1, gainItem);
if(selected)
if (selected)
{
QModelIndex modelIndex = ui->tableWidget->model()->index(toIndex, 0);
ui->tableWidget->selectionModel()->select(modelIndex, QItemSelectionModel::Rows | QItemSelectionModel::Select);
@@ -193,7 +193,7 @@ void GraphicEQFilterGUI::selectRow(int index, bool select)
{
ui->tableWidget->blockSignals(true);
QItemSelectionModel::SelectionFlags command = QItemSelectionModel::Rows;
if(select)
if (select)
command |= QItemSelectionModel::Select;
else
command |= QItemSelectionModel::Deselect;
@@ -205,12 +205,12 @@ void GraphicEQFilterGUI::selectRow(int index, bool select)
void GraphicEQFilterGUI::on_tableWidget_cellChanged(int row, int column)
{
if(column == 0)
if (column == 0)
{
QTableWidgetItem* freqItem = ui->tableWidget->item(row, 0);
bool ok;
double freq = freqItem->text().toDouble(&ok);
if(ok)
if (ok)
{
double gain = scene->getNodes()[row].dbGain;
scene->setNode(row, freq, gain);
@@ -221,12 +221,12 @@ void GraphicEQFilterGUI::on_tableWidget_cellChanged(int row, int column)
freqItem->setText(QString("%0").arg(freq));
}
}
else if(column == 1)
else if (column == 1)
{
QTableWidgetItem* gainItem = ui->tableWidget->item(row, 1);
bool ok;
double gain = gainItem->text().toDouble(&ok);
if(ok)
if (ok)
{
double freq = scene->getNodes()[row].freq;
scene->setNode(row, freq, gain);
@@ -242,7 +242,7 @@ void GraphicEQFilterGUI::on_tableWidget_cellChanged(int row, int column)
void GraphicEQFilterGUI::on_tableWidget_itemSelectionChanged()
{
QSet<int> selectedRows;
for(QTableWidgetItem* item : ui->tableWidget->selectedItems())
for (QTableWidgetItem* item : ui->tableWidget->selectedItems())
selectedRows.insert(item->row());
scene->setSelectedNodes(selectedRows);
@@ -250,7 +250,7 @@ void GraphicEQFilterGUI::on_tableWidget_itemSelectionChanged()
void GraphicEQFilterGUI::on_radioButton15_toggled(bool checked)
{
if(checked)
if (checked)
{
scene->setBandCount(15);
setFreqEditable(false);
@@ -259,7 +259,7 @@ void GraphicEQFilterGUI::on_radioButton15_toggled(bool checked)
void GraphicEQFilterGUI::on_radioButton31_toggled(bool checked)
{
if(checked)
if (checked)
{
scene->setBandCount(31);
setFreqEditable(false);
@@ -268,7 +268,7 @@ void GraphicEQFilterGUI::on_radioButton31_toggled(bool checked)
void GraphicEQFilterGUI::on_radioButtonVar_toggled(bool checked)
{
if(checked)
if (checked)
{
scene->setBandCount(-1);
setFreqEditable(true);
@@ -278,10 +278,10 @@ void GraphicEQFilterGUI::on_radioButtonVar_toggled(bool checked)
void GraphicEQFilterGUI::setFreqEditable(bool editable)
{
ui->tableWidget->blockSignals(true);
for(int i = 0; i < ui->tableWidget->rowCount(); i++)
for (int i = 0; i < ui->tableWidget->rowCount(); i++)
{
QTableWidgetItem* item = ui->tableWidget->item(i, 0);
if(editable)
if (editable)
item->setFlags(item->flags() | Qt::ItemIsEditable | Qt::ItemIsEnabled);
else
item->setFlags(item->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsEnabled));
@@ -298,32 +298,32 @@ void GraphicEQFilterGUI::on_actionImport_triggered()
nameFilters.append(tr("Frequency response (*.csv)"));
nameFilters.append(tr("All files (*.*)"));
dialog.setNameFilters(nameFilters);
if(dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
vector<FilterNode> newNodes;
for(QString path : dialog.selectedFiles())
for (QString path : dialog.selectedFiles())
{
QFile file(path);
if(file.open(QFile::ReadOnly))
if (file.open(QFile::ReadOnly))
{
QTextStream stream(&file);
QString text = stream.readAll();
if(!text.contains('.'))
if (!text.contains('.'))
text = text.replace(',', '.');
QRegularExpressionMatchIterator it = numberRegEx.globalMatch(text);
while(it.hasNext())
while (it.hasNext())
{
QRegularExpressionMatch match = it.next();
QString freqString = match.captured();
bool ok;
double freq = freqString.toDouble(&ok);
if(ok && it.hasNext())
if (ok && it.hasNext())
{
match = it.next();
QString gainString = match.captured();
double gain = gainString.toDouble(&ok);
if(ok)
if (ok)
newNodes.push_back(FilterNode(freq, gain));
}
}
@@ -334,9 +334,9 @@ void GraphicEQFilterGUI::on_actionImport_triggered()
scene->setNodes(newNodes);
int bandCount = scene->verifyBands(newNodes);
if(bandCount != scene->getBandCount())
if (bandCount != scene->getBandCount())
{
switch(bandCount)
switch (bandCount)
{
case 15:
ui->radioButton15->click();
@@ -367,15 +367,15 @@ void GraphicEQFilterGUI::on_actionExport_triggered()
dialog.setNameFilters(nameFilters);
dialog.setDefaultSuffix(".csv");
if(dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
QString savePath = dialog.selectedFiles().first();
QFile file(savePath);
if(file.open(QFile::WriteOnly | QFile::Truncate))
if (file.open(QFile::WriteOnly | QFile::Truncate))
{
QTextStream stream(&file);
for(FilterNode node : scene->getNodes())
for (FilterNode node : scene->getNodes())
{
stream << node.freq << '\t' << node.dbGain << '\n';
}
@@ -387,7 +387,7 @@ void GraphicEQFilterGUI::on_actionExport_triggered()
void GraphicEQFilterGUI::on_actionInvertResponse_triggered()
{
vector<FilterNode> newNodes = scene->getNodes();
for(FilterNode& node : newNodes)
for (FilterNode& node : newNodes)
node.dbGain = -node.dbGain;
scene->setNodes(newNodes);
@@ -399,15 +399,15 @@ void GraphicEQFilterGUI::on_actionNormalizeResponse_triggered()
vector<FilterNode> newNodes = scene->getNodes();
double maxGain = -DBL_MAX;
for(FilterNode node : newNodes)
for (FilterNode node : newNodes)
{
if(node.dbGain > maxGain)
if (node.dbGain > maxGain)
maxGain = node.dbGain;
}
if(maxGain != 0)
if (maxGain != 0)
{
for(FilterNode& node : newNodes)
for (FilterNode& node : newNodes)
node.dbGain -= maxGain;
scene->setNodes(newNodes);
@@ -421,9 +421,9 @@ void GraphicEQFilterGUI::on_actionResetResponse_triggered()
QSet<int> selectedIndices = scene->getSelectedIndices();
int index = 0;
for(FilterNode& node : newNodes)
for (FilterNode& node : newNodes)
{
if(selectedIndices.isEmpty() || selectedIndices.contains(index))
if (selectedIndices.isEmpty() || selectedIndices.contains(index))
node.dbGain = 0.0;
index++;
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -67,7 +67,7 @@ private slots:
private:
void setFreqEditable(bool editable);
Ui::GraphicEQFilterGUI *ui;
Ui::GraphicEQFilterGUI* ui;
GraphicEQFilterGUIScene* scene;
QString configPath;
static QRegularExpression numberRegEx;
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "filters/GraphicEQFilter.h"
@@ -49,17 +49,17 @@ IFilterGUI* GraphicEQFilterGUIFactory::createFilterGUI(QString& command, QString
{
GraphicEQFilterGUI* result = NULL;
if(command == "GraphicEQ")
if (command == "GraphicEQ")
{
GraphicEQFilterFactory factory;
std::vector<IFilter*> filters = factory.createFilter(L"", command.toStdWString(), parameters.toStdWString());
if(!filters.empty())
if (!filters.empty())
{
GraphicEQFilter* filter = (GraphicEQFilter*)filters[0];
result = new GraphicEQFilterGUI(filter, configPath, filterTable);
}
for(IFilter* f : filters)
for (IFilter* f : filters)
{
f->~IFilter();
MemoryHelper::free(f);
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+20 -20
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <QPainter>
@@ -46,12 +46,12 @@ QPainterPath GraphicEQFilterGUIItem::shape() const
void GraphicEQFilterGUIItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
painter->setBrush(Qt::white);
if(isSelected())
if (isSelected())
painter->setBrush(QColor(38, 147, 255));
painter->drawPath(shape());
if(index < 99)
if (index < 99)
{
if(isSelected())
if (isSelected())
painter->setPen(Qt::white);
QFont font;
@@ -68,20 +68,20 @@ QVariant GraphicEQFilterGUIItem::itemChange(QGraphicsItem::GraphicsItemChange ch
{
QVariant result = QGraphicsItem::itemChange(change, value);
if(change == ItemScenePositionHasChanged)
if (change == ItemScenePositionHasChanged)
{
GraphicEQFilterGUIScene* s = qobject_cast<GraphicEQFilterGUIScene*>(scene());
s->itemMoved(index);
}
else if(change == ItemSelectedHasChanged)
else if (change == ItemSelectedHasChanged)
{
GraphicEQFilterGUIScene* s = qobject_cast<GraphicEQFilterGUIScene*>(scene());
s->itemSelectionChanged(index, value.toBool());
}
else if(change == ItemPositionChange)
else if (change == ItemPositionChange)
{
GraphicEQFilterGUIScene* s = qobject_cast<GraphicEQFilterGUIScene*>(scene());
if(s->getBandCount() != -1)
if (s->getBandCount() != -1)
{
QPointF newPos = value.toPointF();
newPos.setX(s->hzToX(getHz()));
+15 -15
View File
@@ -1,32 +1,32 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "Editor/widgets/FrequencyPlotItem.h"
class GraphicEQFilterGUIItem: public FrequencyPlotItem
class GraphicEQFilterGUIItem : public FrequencyPlotItem
{
public:
GraphicEQFilterGUIItem(int index, double hz, double db);
enum { Type = UserType + 2 };
enum {Type = UserType + 2};
virtual int type() const
{
return Type;
+67 -67
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <algorithm>
@@ -26,8 +26,8 @@
using namespace std;
GraphicEQFilterGUIScene::GraphicEQFilterGUIScene(QObject* parent) :
FrequencyPlotScene(parent)
GraphicEQFilterGUIScene::GraphicEQFilterGUIScene(QObject* parent)
: FrequencyPlotScene(parent)
{
}
@@ -35,13 +35,13 @@ void GraphicEQFilterGUIScene::setNodes(const std::vector<FilterNode>& nodes)
{
noUpdateModel = true;
for(int i = (int)this->nodes.size() - 1; i >= 0; i--)
for (int i = (int)this->nodes.size() - 1; i >= 0; i--)
removeNode(i);
this->nodes = nodes;
int i = 0;
for(FilterNode node : nodes)
for (FilterNode node : nodes)
{
GraphicEQFilterGUIItem* item = new GraphicEQFilterGUIItem(i, node.freq, node.dbGain);
addItem(item);
@@ -67,20 +67,20 @@ void GraphicEQFilterGUIScene::addNode(double hz, double db)
addItem(item);
item->updatePos();
items.insert(index, item);
for(int i = index + 1; i < items.size(); i++)
for (int i = index + 1; i < items.size(); i++)
items[i]->setIndex(i);
emit nodeInserted(index, hz, db);
QRectF rect = sceneRect();
if(index > 0)
if (index > 0)
rect.setLeft(items[index - 1]->x());
if(index + 1 < items.size())
if (index + 1 < items.size())
rect.setRight(items[index + 1]->x());
update(rect);
for(int i = index + 1; i < items.size(); i++)
for (int i = index + 1; i < items.size(); i++)
items[i]->update();
if(!noUpdateModel)
if (!noUpdateModel)
emit updateModel();
}
@@ -90,20 +90,20 @@ void GraphicEQFilterGUIScene::removeNode(int index)
GraphicEQFilterGUIItem* item = items[index];
removeItem(item);
items.removeAt(index);
for(int i = index; i < items.size(); i++)
for (int i = index; i < items.size(); i++)
items[i]->setIndex(i);
emit nodeRemoved(index);
QRectF rect = sceneRect();
if(index > 0)
if (index > 0)
rect.setLeft(items[index - 1]->x());
if(index < items.size())
if (index < items.size())
rect.setRight(items[index]->x());
update(rect);
for(int i = index; i < items.size(); i++)
for (int i = index; i < items.size(); i++)
items[i]->update();
if(!noUpdateModel)
if (!noUpdateModel)
emit updateModel();
}
@@ -117,24 +117,24 @@ void GraphicEQFilterGUIScene::setNode(int index, double hz, double db)
FilterNode node(hz, db);
vector<FilterNode>::iterator it = lower_bound(nodes.begin(), nodes.end(), node);
int newIndex = it - nodes.begin();
if(newIndex > index)
if (newIndex > index)
newIndex--;
if(newIndex != index)
if (newIndex != index)
{
items.move(index, newIndex);
if(newIndex < index)
if (newIndex < index)
{
for(int i = index; i > newIndex; i--)
for (int i = index; i > newIndex; i--)
nodes[i] = nodes[i - 1];
for(int i = newIndex; i <= index; i++)
for (int i = newIndex; i <= index; i++)
items[i]->setIndex(i);
emit nodeMoved(index, newIndex);
}
else
{
for(int i = index; i < newIndex; i++)
for (int i = index; i < newIndex; i++)
nodes[i] = nodes[i + 1];
for(int i = index; i <= newIndex; i++)
for (int i = index; i <= newIndex; i++)
items[i]->setIndex(i);
emit nodeMoved(index, newIndex);
}
@@ -145,19 +145,19 @@ void GraphicEQFilterGUIScene::setNode(int index, double hz, double db)
QRectF rect = sceneRect();
int lowerIndex = min(index, newIndex);
int upperIndex = max(index, newIndex);
if(lowerIndex > 0)
if (lowerIndex > 0)
rect.setLeft(items[lowerIndex - 1]->x());
if(upperIndex + 1 < items.size())
if (upperIndex + 1 < items.size())
rect.setRight(items[upperIndex + 1]->x());
update(rect);
if(!noUpdateModel)
if (!noUpdateModel)
emit updateModel();
}
void GraphicEQFilterGUIScene::setSelectedNodes(QSet<int> indices)
{
for(GraphicEQFilterGUIItem* item : items)
for (GraphicEQFilterGUIItem* item : items)
item->setSelected(indices.contains(item->getIndex()));
}
@@ -165,8 +165,8 @@ QSet<int> GraphicEQFilterGUIScene::getSelectedIndices()
{
QSet<int> set;
for(GraphicEQFilterGUIItem* item : items)
if(item->isSelected())
for (GraphicEQFilterGUIItem* item : items)
if (item->isSelected())
set.insert(item->getIndex());
return set;
@@ -178,29 +178,29 @@ void GraphicEQFilterGUIScene::itemMoved(int index)
double db = yToDb(item->scenePos().y());
double oldHz = item->getHz();
double hz;
if(getBandCount() != -1)
if (getBandCount() != -1)
{
hz = oldHz;
}
else
{
hz = xToHz(item->scenePos().x());
if(hz >= 10000)
if (hz >= 10000)
hz = round(hz);
else
hz = round(hz * 10) / 10;
item->setHz(hz);
}
if(getZoomY() < 4)
if (getZoomY() < 4)
db = round(db * 10) / 10;
else
db = round(db * 100) / 100;
item->setDb(db);
int newIndex = index;
if(hz < oldHz)
if (hz < oldHz)
{
while(newIndex > 0 && nodes[newIndex - 1].freq > hz)
while (newIndex > 0 && nodes[newIndex - 1].freq > hz)
{
nodes[newIndex] = nodes[newIndex - 1];
items[newIndex] = items[newIndex - 1];
@@ -208,9 +208,9 @@ void GraphicEQFilterGUIScene::itemMoved(int index)
newIndex--;
}
}
else if(hz > oldHz)
else if (hz > oldHz)
{
while(newIndex < (int)nodes.size() - 1 && nodes[newIndex + 1].freq < hz)
while (newIndex < (int)nodes.size() - 1 && nodes[newIndex + 1].freq < hz)
{
nodes[newIndex] = nodes[newIndex + 1];
items[newIndex] = items[newIndex + 1];
@@ -219,7 +219,7 @@ void GraphicEQFilterGUIScene::itemMoved(int index)
}
}
nodes[newIndex] = FilterNode(hz, db);
if(newIndex != index)
if (newIndex != index)
{
items[newIndex] = item;
item->setIndex(newIndex);
@@ -230,13 +230,13 @@ void GraphicEQFilterGUIScene::itemMoved(int index)
QRectF rect = sceneRect();
int lowerIndex = min(index, newIndex);
int upperIndex = max(index, newIndex);
if(lowerIndex > 0)
if (lowerIndex > 0)
rect.setLeft(items[lowerIndex - 1]->x());
if(upperIndex + 1 < items.size())
if (upperIndex + 1 < items.size())
rect.setRight(items[upperIndex + 1]->x());
update(rect);
if(!noUpdateModel)
if (!noUpdateModel)
emit updateModel();
}
@@ -247,7 +247,7 @@ void GraphicEQFilterGUIScene::itemSelectionChanged(int index, bool selected)
void GraphicEQFilterGUIScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
{
if(getBandCount() != -1)
if (getBandCount() != -1)
return;
double hz = xToHz(event->scenePos().x());
@@ -257,15 +257,15 @@ void GraphicEQFilterGUIScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev
void GraphicEQFilterGUIScene::keyPressEvent(QKeyEvent* event)
{
switch(event->key())
switch (event->key())
{
case Qt::Key_Delete:
if(getBandCount() == -1)
if (getBandCount() == -1)
{
for(QGraphicsItem* item : selectedItems())
for (QGraphicsItem* item : selectedItems())
{
GraphicEQFilterGUIItem* plotItem = qgraphicsitem_cast<GraphicEQFilterGUIItem*>(item);
if(plotItem != NULL)
if (plotItem != NULL)
{
// this works for multiple items because the index of the other items is updated inside removeNode
int index = plotItem->getIndex();
@@ -279,14 +279,14 @@ void GraphicEQFilterGUIScene::keyPressEvent(QKeyEvent* event)
case Qt::Key_Down:
case Qt::Key_Left:
case Qt::Key_Right:
for(QGraphicsItem* item : selectedItems())
for (QGraphicsItem* item : selectedItems())
{
GraphicEQFilterGUIItem* plotItem = qgraphicsitem_cast<GraphicEQFilterGUIItem*>(item);
if(plotItem != NULL)
if (plotItem != NULL)
{
int index = plotItem->getIndex();
FilterNode node = nodes[index];
switch(event->key())
switch (event->key())
{
case Qt::Key_Up:
node.dbGain += 1;
@@ -307,7 +307,7 @@ void GraphicEQFilterGUIScene::keyPressEvent(QKeyEvent* event)
break;
case Qt::Key_A:
if(event->modifiers() & Qt::ControlModifier)
if (event->modifiers() & Qt::ControlModifier)
{
QPainterPath painterPath;
painterPath.addRect(sceneRect());
@@ -327,12 +327,12 @@ int GraphicEQFilterGUIScene::verifyBands(const std::vector<FilterNode>& nodes)
const vector<double>& bands = getBands((int)nodes.size());
int bandCount = -1;
if(!bands.empty())
if (!bands.empty())
{
bandCount = (int)nodes.size();
for(unsigned i = 0; i < nodes.size(); i++)
for (unsigned i = 0; i < nodes.size(); i++)
{
if(abs(nodes[i].freq - bands[i]) > 0.1)
if (abs(nodes[i].freq - bands[i]) > 0.1)
{
bandCount = -1;
break;
@@ -345,14 +345,14 @@ int GraphicEQFilterGUIScene::verifyBands(const std::vector<FilterNode>& nodes)
void GraphicEQFilterGUIScene::setBandCount(int value)
{
if(value != getBandCount())
if (value != getBandCount())
{
const vector<double>& bands = getBands(value);
if(!bands.empty())
if (!bands.empty())
{
vector<FilterNode> newNodes;
GainIterator gainIterator(nodes);
for(double band : bands)
for (double band : bands)
{
double dbGain = gainIterator.gainAt(band);
dbGain = round(dbGain * 100) / 100;
@@ -365,7 +365,7 @@ void GraphicEQFilterGUIScene::setBandCount(int value)
FrequencyPlotScene::setBandCount(value);
if(!noUpdateModel)
if (!noUpdateModel)
emit updateModel();
}
}
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -29,7 +29,7 @@ class GraphicEQFilterGUIScene : public FrequencyPlotScene
{
Q_OBJECT
public:
explicit GraphicEQFilterGUIScene(QObject *parent = 0);
explicit GraphicEQFilterGUIScene(QObject* parent = 0);
void setNodes(const std::vector<FilterNode>& nodes);
void addNode(double hz, double db);
void removeNode(int index);
+18 -18
View File
@@ -1,27 +1,27 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "GraphicEQFilterGUIScene.h"
#include "GraphicEQFilterGUIView.h"
GraphicEQFilterGUIView::GraphicEQFilterGUIView(QWidget *parent) :
FrequencyPlotView(parent)
GraphicEQFilterGUIView::GraphicEQFilterGUIView(QWidget* parent)
: FrequencyPlotView(parent)
{
}
@@ -36,15 +36,15 @@ void GraphicEQFilterGUIView::drawBackground(QPainter* painter, const QRectF& rec
QPainterPath path;
bool first = true;
double lastDb = -1000;
for(int x = rect.left() - 1; x <= rect.right() + 1; x++)
for (int x = rect.left() - 1; x <= rect.right() + 1; x++)
{
double hz = s->xToHz(x);
double db = gainIterator.gainAt(hz);
double y = s->dbToY(db);
if(db == lastDb)
if (db == lastDb)
y = floor(y) + 0.5;
lastDb = db;
if(first)
if (first)
{
path.moveTo(x, y);
first = false;
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -26,7 +26,7 @@ class GraphicEQFilterGUIView : public FrequencyPlotView
Q_OBJECT
public:
explicit GraphicEQFilterGUIView(QWidget *parent = 0);
explicit GraphicEQFilterGUIView(QWidget* parent = 0);
protected:
void drawBackground(QPainter* painter, const QRectF& rect) override;
+20 -20
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <QFileDialog>
@@ -22,8 +22,8 @@
#include "IncludeFilterGUI.h"
#include "ui_IncludeFilterGUI.h"
IncludeFilterGUI::IncludeFilterGUI(FilterTable* filterTable, const QString& path) :
ui(new Ui::IncludeFilterGUI), filterTable(filterTable)
IncludeFilterGUI::IncludeFilterGUI(FilterTable* filterTable, const QString& path)
: ui(new Ui::IncludeFilterGUI), filterTable(filterTable)
{
ui->setupUi(this);
@@ -46,19 +46,19 @@ void IncludeFilterGUI::on_selectFileToolButton_clicked()
QFileInfo fileInfo(filterTable->getConfigPath());
QDir configDir = fileInfo.absoluteDir();
QString path = ui->pathLineEdit->text();
if(path.length() > 0)
if (path.length() > 0)
fileInfo.setFile(configDir, path);
QFileDialog dialog(this, tr("Include file"), fileInfo.absolutePath(), "*.txt");
dialog.setFileMode(QFileDialog::ExistingFile);
dialog.setNameFilter(tr("E-APO configurations (*.txt)"));
if(path.length() > 0)
if (path.length() > 0)
dialog.selectFile(fileInfo.fileName());
if(dialog.exec() == QDialog::Accepted)
if (dialog.exec() == QDialog::Accepted)
{
QString absolutePath = dialog.selectedFiles().first();
QString relativePath = configDir.relativeFilePath(absolutePath);
if(relativePath.startsWith("../../"))
if (relativePath.startsWith("../../"))
relativePath = absolutePath;
ui->pathLineEdit->setText(QDir::toNativeSeparators(relativePath));
@@ -76,7 +76,7 @@ void IncludeFilterGUI::on_openFileToolButton_clicked()
QFileInfo fileInfo(filterTable->getConfigPath());
QDir configDir = fileInfo.absoluteDir();
QString path = ui->pathLineEdit->text();
if(path.length() > 0)
if (path.length() > 0)
{
fileInfo.setFile(configDir, path);
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -42,6 +42,6 @@ private slots:
void on_openFileToolButton_clicked();
private:
Ui::IncludeFilterGUI *ui;
Ui::IncludeFilterGUI* ui;
FilterTable* filterTable;
};
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "IncludeFilterGUI.h"
@@ -40,7 +40,7 @@ IFilterGUI* IncludeFilterGUIFactory::createFilterGUI(QString& command, QString&
{
IncludeFilterGUI* result = NULL;
if(command == "Include")
if (command == "Include")
{
result = new IncludeFilterGUI(filterTable, parameters.trimmed());
}
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+15 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <cmath>
@@ -24,8 +24,8 @@
using namespace std;
PreampFilterGUI::PreampFilterGUI(double dbGain):
ui(new Ui::PreampFilterGUI)
PreampFilterGUI::PreampFilterGUI(double dbGain)
: ui(new Ui::PreampFilterGUI)
{
ui->setupUi(this);
+14 -15
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -22,8 +22,7 @@
#include "Editor/IFilterGUI.h"
#include <filters/PreampFilter.h>
namespace Ui
{
namespace Ui {
class PreampFilterGUI;
}
+16 -16
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "PreampFilterGUI.h"
@@ -32,17 +32,17 @@ IFilterGUI* PreampFilterGUIFactory::createFilterGUI(QString& command, QString& p
{
PreampFilterGUI* result = NULL;
if(command == "Preamp")
if (command == "Preamp")
{
PreampFilterFactory factory;
std::vector<IFilter*> filters = factory.createFilter(L"", command.toStdWString(), parameters.toStdWString());
if(!filters.empty())
if (!filters.empty())
{
PreampFilter* filter = (PreampFilter*)filters[0];
result = new PreampFilterGUI(filter->getDbGain());
}
for(IFilter* f : filters)
for (IFilter* f : filters)
{
f->~IFilter();
MemoryHelper::free(f);
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2014 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
+18 -18
View File
@@ -1,27 +1,27 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "StageFilterGUI.h"
#include "ui_StageFilterGUI.h"
StageFilterGUI::StageFilterGUI(const QString& parameters) :
ui(new Ui::StageFilterGUI)
StageFilterGUI::StageFilterGUI(const QString& parameters)
: ui(new Ui::StageFilterGUI)
{
ui->setupUi(this);
@@ -40,11 +40,11 @@ void StageFilterGUI::store(QString& command, QString& parameters)
{
command = "Stage";
QStringList list;
if(ui->preMixCheckBox->isChecked())
if (ui->preMixCheckBox->isChecked())
list.append("pre-mix");
if(ui->postMixCheckBox->isChecked())
if (ui->postMixCheckBox->isChecked())
list.append("post-mix");
if(ui->captureCheckBox->isChecked())
if (ui->captureCheckBox->isChecked())
list.append("capture");
parameters = list.join(' ');
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
@@ -43,5 +43,5 @@ private slots:
void on_captureCheckBox_toggled(bool checked);
private:
Ui::StageFilterGUI *ui;
Ui::StageFilterGUI* ui;
};
+14 -14
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "StageFilterGUI.h"
@@ -31,7 +31,7 @@ IFilterGUI* StageFilterGUIFactory::createFilterGUI(QString& command, QString& pa
{
StageFilterGUI* result = NULL;
if(command == "Stage")
if (command == "Stage")
{
result = new StageFilterGUI(parameters);
}
+13 -13
View File
@@ -1,20 +1,20 @@
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once