Skip to content

Commit acd8c5d

Browse files
committed
LinearSmoothedValueAtomic:class splitted on .h and .cpp files.
1 parent 6b6f515 commit acd8c5d

10 files changed

Lines changed: 130 additions & 65 deletions

File tree

Builds/Linux/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ OBJECTS := \
5757
$(OBJDIR)/AudioComponent_521bd9c9.o \
5858
$(OBJDIR)/PlaceholderProcessorEditor_7b4cbcf7.o \
5959
$(OBJDIR)/PlaceholderProcessor_167f09aa.o \
60+
$(OBJDIR)/LinearSmoothedValueAtomic_df1e5b97.o \
6061
$(OBJDIR)/Bessel_7e54cb27.o \
6162
$(OBJDIR)/Biquad_622c856b.o \
6263
$(OBJDIR)/Butterworth_6aca939b.o \
@@ -196,6 +197,11 @@ $(OBJDIR)/PlaceholderProcessor_167f09aa.o: ../../Source/Processors/PlaceholderPr
196197
@echo "Compiling PlaceholderProcessor.cpp"
197198
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
198199

200+
$(OBJDIR)/LinearSmoothedValueAtomic_df1e5b97.o: ../../Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp
201+
-@mkdir -p $(OBJDIR)
202+
@echo "Compiling LinearSmoothedValueAtomic.cpp"
203+
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
204+
199205
$(OBJDIR)/Bessel_7e54cb27.o: ../../Source/Processors/Dsp/Bessel.cpp
200206
-@mkdir -p $(OBJDIR)
201207
@echo "Compiling Bessel.cpp"

Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
0AE243437B40602D35435C32 = {isa = PBXBuildFile; fileRef = B04D87ED6AA4897B6CD3CCF6; };
2727
B04B9CA1E59D544793808F25 = {isa = PBXBuildFile; fileRef = 524466E331502DEC89862D66; };
2828
28B77947820CAE30A5E2DE22 = {isa = PBXBuildFile; fileRef = 9AD7314174B2AB01FBF7E1E1; };
29+
CB568964BDF3E65207B81CCA = {isa = PBXBuildFile; fileRef = 72D50E371901970C428D9E8B; };
2930
9252537C12447F047243DEE9 = {isa = PBXBuildFile; fileRef = 041038F6E67FE0409D8ECC74; };
3031
B081F3F4FA6D8C35E2EEE778 = {isa = PBXBuildFile; fileRef = CB5C14E82DE06F767EAD62F9; };
3132
7398C5E00B9093F78C697706 = {isa = PBXBuildFile; fileRef = 777D9B0FE3C110ADA980BD09; };
@@ -605,6 +606,7 @@
605606
71CF8F6995DF1BA2038C21D6 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_AlertWindow.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/windows/juce_AlertWindow.h"; sourceTree = "SOURCE_ROOT"; };
606607
7291F19253205B1A5138908E = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_DynamicObject.cpp"; path = "../../JuceLibraryCode/modules/juce_core/containers/juce_DynamicObject.cpp"; sourceTree = "SOURCE_ROOT"; };
607608
72C33BA70B9EE82E39F1EC6C = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_MP3AudioFormat.h"; path = "../../JuceLibraryCode/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h"; sourceTree = "SOURCE_ROOT"; };
609+
72D50E371901970C428D9E8B = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LinearSmoothedValueAtomic.cpp; path = ../../Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp; sourceTree = "SOURCE_ROOT"; };
608610
72FCE41894123FC5DB01566B = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGL_win32.h"; path = "../../JuceLibraryCode/modules/juce_opengl/native/juce_OpenGL_win32.h"; sourceTree = "SOURCE_ROOT"; };
609611
7346D1276C3289FD68C8592B = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_FileFilter.h"; path = "../../JuceLibraryCode/modules/juce_core/files/juce_FileFilter.h"; sourceTree = "SOURCE_ROOT"; };
610612
7387114E34496F4606550863 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_HyperlinkButton.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -1327,6 +1329,7 @@
13271329
9AD7314174B2AB01FBF7E1E1,
13281330
E46FFF196BAA78472FF1C0B4, ); name = PlaceholderProcessor; sourceTree = "<group>"; };
13291331
F74BE11F6446ACF243895BFF = {isa = PBXGroup; children = (
1332+
72D50E371901970C428D9E8B,
13301333
148FE750B55B2F7EA3899408,
13311334
041038F6E67FE0409D8ECC74,
13321335
AAF5C27D2EEDD254A3652717,
@@ -2735,6 +2738,7 @@
27352738
0AE243437B40602D35435C32,
27362739
B04B9CA1E59D544793808F25,
27372740
28B77947820CAE30A5E2DE22,
2741+
CB568964BDF3E65207B81CCA,
27382742
9252537C12447F047243DEE9,
27392743
B081F3F4FA6D8C35E2EEE778,
27402744
7398C5E00B9093F78C697706,

Builds/VisualStudio2012/open-ephys.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
<ClCompile Include="..\..\Source\Audio\AudioComponent.cpp"/>
262262
<ClCompile Include="..\..\Source\Processors\PlaceholderProcessor\PlaceholderProcessorEditor.cpp"/>
263263
<ClCompile Include="..\..\Source\Processors\PlaceholderProcessor\PlaceholderProcessor.cpp"/>
264+
<ClCompile Include="..\..\Source\Processors\Dsp\LinearSmoothedValueAtomic.cpp"/>
264265
<ClCompile Include="..\..\Source\Processors\Dsp\Bessel.cpp"/>
265266
<ClCompile Include="..\..\Source\Processors\Dsp\Biquad.cpp"/>
266267
<ClCompile Include="..\..\Source\Processors\Dsp\Butterworth.cpp"/>

Builds/VisualStudio2012/open-ephys.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@
421421
<ClCompile Include="..\..\Source\Processors\PlaceholderProcessor\PlaceholderProcessor.cpp">
422422
<Filter>open-ephys\Source\Processors\PlaceholderProcessor</Filter>
423423
</ClCompile>
424+
<ClCompile Include="..\..\Source\Processors\Dsp\LinearSmoothedValueAtomic.cpp">
425+
<Filter>open-ephys\Source\Processors\Dsp</Filter>
426+
</ClCompile>
424427
<ClCompile Include="..\..\Source\Processors\Dsp\Bessel.cpp">
425428
<Filter>open-ephys\Source\Processors\Dsp</Filter>
426429
</ClCompile>

Builds/VisualStudio2013/open-ephys.sln

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 11.00
22
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.40629.0
4-
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
3+
Project("{5A05F353-1D63-394C-DFB0-981BB2309002}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
64
EndProject
75
Global
86
GlobalSection(SolutionConfigurationPlatforms) = preSolution
97
Debug|Win32 = Debug|Win32
10-
Debug|x64 = Debug|x64
11-
Debug64|Win32 = Debug64|Win32
12-
Debug64|x64 = Debug64|x64
138
Release|Win32 = Release|Win32
14-
Release|x64 = Release|x64
15-
Release64|Win32 = Release64|Win32
9+
Debug64|x64 = Debug64|x64
1610
Release64|x64 = Release64|x64
1711
EndGlobalSection
1812
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1913
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.ActiveCfg = Debug|Win32
2014
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.Build.0 = Debug|Win32
21-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|x64.ActiveCfg = Debug|Win32
22-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|Win32.ActiveCfg = Debug64|x64
23-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.ActiveCfg = Debug64|x64
24-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.Build.0 = Debug64|x64
2515
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
2616
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
27-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|x64.ActiveCfg = Release|Win32
28-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|Win32.ActiveCfg = Release64|x64
17+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.ActiveCfg = Debug64|x64
18+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.Build.0 = Debug64|x64
2919
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.ActiveCfg = Release64|x64
3020
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.Build.0 = Release64|x64
3121
EndGlobalSection

Builds/VisualStudio2013/open-ephys.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@
265265
<ClCompile Include="..\..\Source\Audio\AudioComponent.cpp"/>
266266
<ClCompile Include="..\..\Source\Processors\PlaceholderProcessor\PlaceholderProcessorEditor.cpp"/>
267267
<ClCompile Include="..\..\Source\Processors\PlaceholderProcessor\PlaceholderProcessor.cpp"/>
268+
<ClCompile Include="..\..\Source\Processors\Dsp\LinearSmoothedValueAtomic.cpp"/>
268269
<ClCompile Include="..\..\Source\Processors\Dsp\Bessel.cpp"/>
269270
<ClCompile Include="..\..\Source\Processors\Dsp\Biquad.cpp"/>
270271
<ClCompile Include="..\..\Source\Processors\Dsp\Butterworth.cpp"/>

Builds/VisualStudio2013/open-ephys.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@
421421
<ClCompile Include="..\..\Source\Processors\PlaceholderProcessor\PlaceholderProcessor.cpp">
422422
<Filter>open-ephys\Source\Processors\PlaceholderProcessor</Filter>
423423
</ClCompile>
424+
<ClCompile Include="..\..\Source\Processors\Dsp\LinearSmoothedValueAtomic.cpp">
425+
<Filter>open-ephys\Source\Processors\Dsp</Filter>
426+
</ClCompile>
424427
<ClCompile Include="..\..\Source\Processors\Dsp\Bessel.cpp">
425428
<Filter>open-ephys\Source\Processors\Dsp</Filter>
426429
</ClCompile>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
==============================================================================
3+
4+
This file is part of the JUCE library.
5+
Copyright (c) 2015 - ROLI Ltd.
6+
7+
Permission is granted to use this software under the terms of either:
8+
a) the GPL v2 (or any later version)
9+
b) the Affero GPL v3
10+
11+
Details of these licenses can be found at: www.gnu.org/licenses
12+
13+
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15+
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16+
17+
------------------------------------------------------------------------------
18+
19+
To release a closed-source product which uses JUCE, commercial licenses are
20+
available: visit www.juce.com for more information.
21+
22+
==============================================================================
23+
*/
24+
25+
#include "LinearSmoothedValueAtomic.h"
26+
27+
28+
// Explicit instantiations
29+
template class LinearSmoothedValueAtomic<float>;
30+
template class LinearSmoothedValueAtomic<double>;
31+
32+
33+
template <typename FloatType>
34+
LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic() noexcept
35+
: currentValue (0)
36+
, target (0)
37+
, step (0)
38+
, countdown (0)
39+
, stepsToTarget (0)
40+
{
41+
}
42+
43+
44+
template <typename FloatType>
45+
LinearSmoothedValueAtomic<FloatType>::LinearSmoothedValueAtomic (FloatType initialValue) noexcept
46+
47+
: currentValue (initialValue)
48+
, target (initialValue)
49+
, step (0)
50+
, countdown (0)
51+
, stepsToTarget (0)
52+
{
53+
}
54+
55+
56+
template<typename FloatType>
57+
void LinearSmoothedValueAtomic<FloatType>::reset (double sampleRate, double rampLengthInSeconds) noexcept
58+
{
59+
jassert (sampleRate > 0 && rampLengthInSeconds >= 0);
60+
stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate);
61+
currentValue = target;
62+
countdown = 0;
63+
}
64+
65+
66+
template<typename FloatType>
67+
void LinearSmoothedValueAtomic<FloatType>::setValue (FloatType newValue) noexcept
68+
{
69+
target.store (newValue);
70+
}
71+
72+
73+
template<typename FloatType>
74+
void LinearSmoothedValueAtomic<FloatType>::updateTarget() noexcept
75+
{
76+
FloatType newTarget = target.load();
77+
if (newTarget != currentTarget)
78+
{
79+
currentTarget = newTarget;
80+
countdown = stepsToTarget;
81+
82+
if (countdown <= 0)
83+
currentValue = currentTarget;
84+
else
85+
step = (currentTarget - currentValue) / (FloatType) countdown;
86+
}
87+
}
88+
89+
90+
template<typename FloatType>
91+
FloatType LinearSmoothedValueAtomic<FloatType>::getNextValue() noexcept
92+
{
93+
if (countdown <= 0)
94+
return currentTarget;
95+
96+
--countdown;
97+
currentValue += step;
98+
return currentValue;
99+
}

Source/Processors/Dsp/LinearSmoothedValueAtomic.h

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -52,69 +52,25 @@ class PLUGIN_API LinearSmoothedValueAtomic
5252
{
5353
public:
5454
/** Constructor. */
55-
LinearSmoothedValueAtomic() noexcept
56-
: currentValue (0)
57-
, target (0)
58-
, step (0)
59-
, countdown (0)
60-
, stepsToTarget (0)
61-
{
62-
}
55+
LinearSmoothedValueAtomic() noexcept;
6356

6457
/** Constructor. */
65-
LinearSmoothedValueAtomic (FloatType initialValue) noexcept
66-
: currentValue (initialValue)
67-
, target (initialValue)
68-
, step (0)
69-
, countdown (0)
70-
, stepsToTarget (0)
71-
{
72-
}
58+
LinearSmoothedValueAtomic (FloatType initialValue) noexcept;
7359

7460
//==========================================================================
7561
/** Reset to a new sample rate and ramp length. */
76-
void reset (double sampleRate, double rampLengthInSeconds) noexcept
77-
{
78-
jassert (sampleRate > 0 && rampLengthInSeconds >= 0);
79-
stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate);
80-
currentValue = target;
81-
countdown = 0;
82-
}
62+
void reset (double sampleRate, double rampLengthInSeconds) noexcept;
8363

8464
//==========================================================================
8565
/** Set a new target value. */
86-
void setValue (FloatType newValue) noexcept
87-
{
88-
target.store (newValue);
89-
}
66+
void setValue (FloatType newValue) noexcept;
9067

9168
//==========================================================================
92-
void updateTarget() noexcept
93-
{
94-
FloatType newTarget = target.load();
95-
if (newTarget != currentTarget)
96-
{
97-
currentTarget = newTarget;
98-
countdown = stepsToTarget;
99-
100-
if (countdown <= 0)
101-
currentValue = currentTarget;
102-
else
103-
step = (currentTarget - currentValue) / (FloatType) countdown;
104-
}
105-
}
69+
void updateTarget() noexcept;
10670

10771
//==========================================================================
10872
/** Compute the next value. */
109-
FloatType getNextValue() noexcept
110-
{
111-
if (countdown <= 0)
112-
return currentTarget;
113-
114-
--countdown;
115-
currentValue += step;
116-
return currentValue;
117-
}
73+
FloatType getNextValue() noexcept;
11874

11975

12076
private:

open-ephys.jucer

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@
292292
file="Source/Processors/PlaceholderProcessor/PlaceholderProcessor.h"/>
293293
</GROUP>
294294
<GROUP id="{9F37E2FD-6871-8370-4C11-5C97DF132390}" name="Dsp">
295+
<FILE id="g34Roi" name="LinearSmoothedValueAtomic.cpp" compile="1"
296+
resource="0" file="Source/Processors/Dsp/LinearSmoothedValueAtomic.cpp"/>
295297
<FILE id="mwFwwT" name="LinearSmoothedValueAtomic.h" compile="0" resource="0"
296298
file="Source/Processors/Dsp/LinearSmoothedValueAtomic.h"/>
297299
<FILE id="qWmKwI" name="Bessel.cpp" compile="1" resource="0" file="Source/Processors/Dsp/Bessel.cpp"/>

0 commit comments

Comments
 (0)