Improved: Switched to stricter code formatter (Uncrustify) for better consistency across all source files.
This commit is contained in:
1 parent
a1be4cc70f
commit
57e8158efd
202 files changed
+4595
-4284
No files matched your search
+25
-25
@@ -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 "stdafx.h"
|
||||
@@ -33,37 +33,37 @@ GainIterator::GainIterator(const vector<FilterNode>& nodes)
|
||||
|
||||
double GainIterator::gainAt(double freq)
|
||||
{
|
||||
if(nodeLeft == NULL && nodeRight == NULL || nodeLeft != NULL && freq < nodeLeft->freq)
|
||||
if (nodeLeft == NULL && nodeRight == NULL || nodeLeft != NULL && freq < nodeLeft->freq)
|
||||
{
|
||||
FilterNode findNode(freq, 0);
|
||||
vector<FilterNode>::iterator it = lower_bound(nodes.begin(), nodes.end(), findNode);
|
||||
if(it != nodes.begin())
|
||||
if (it != nodes.begin())
|
||||
nodeLeft = &*(it - 1);
|
||||
if(it != nodes.end())
|
||||
if (it != nodes.end())
|
||||
nodeRight = &*it;
|
||||
|
||||
if(nodeLeft != NULL && nodeRight != NULL)
|
||||
if (nodeLeft != NULL && nodeRight != NULL)
|
||||
{
|
||||
logLeft = log(nodeLeft->freq);
|
||||
logRightMinusLeft = log(nodeRight->freq) - logLeft;
|
||||
}
|
||||
}
|
||||
else if(nodeRight != NULL && freq > nodeRight->freq)
|
||||
else if (nodeRight != NULL && freq > nodeRight->freq)
|
||||
{
|
||||
vector<FilterNode>::iterator it = nodes.begin() + (nodeRight - &*nodes.begin());
|
||||
while(it != nodes.end() && freq > it->freq)
|
||||
while (it != nodes.end() && freq > it->freq)
|
||||
{
|
||||
it++;
|
||||
}
|
||||
if(it == nodes.end())
|
||||
if (it == nodes.end())
|
||||
nodeRight = NULL;
|
||||
else
|
||||
nodeRight = &*it;
|
||||
|
||||
if(it != nodes.begin())
|
||||
if (it != nodes.begin())
|
||||
nodeLeft = &*(it - 1);
|
||||
|
||||
if(nodeLeft != NULL && nodeRight != NULL)
|
||||
if (nodeLeft != NULL && nodeRight != NULL)
|
||||
{
|
||||
logLeft = log(nodeLeft->freq);
|
||||
logRightMinusLeft = log(nodeRight->freq) - logLeft;
|
||||
@@ -71,14 +71,14 @@ double GainIterator::gainAt(double freq)
|
||||
}
|
||||
|
||||
double dbGain;
|
||||
if(nodeLeft == NULL)
|
||||
if (nodeLeft == NULL)
|
||||
{
|
||||
if(nodeRight == NULL)
|
||||
if (nodeRight == NULL)
|
||||
dbGain = 0.0;
|
||||
else
|
||||
dbGain = nodeRight->dbGain;
|
||||
}
|
||||
else if(nodeRight == NULL)
|
||||
else if (nodeRight == NULL)
|
||||
{
|
||||
dbGain = nodeLeft->dbGain;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user