Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
juce6_test2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
juce6_test2
Commits
7281f6f9
Commit
7281f6f9
authored
5 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
sample accurate, or not so sample accurate
parent
3a44af73
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Source/PluginEditor.cpp
+16
-1
16 additions, 1 deletion
Source/PluginEditor.cpp
Source/PluginEditor.h
+12
-1
12 additions, 1 deletion
Source/PluginEditor.h
Source/PluginProcessor.cpp
+2
-0
2 additions, 0 deletions
Source/PluginProcessor.cpp
Source/PluginProcessor.h
+3
-2
3 additions, 2 deletions
Source/PluginProcessor.h
with
33 additions
and
4 deletions
Source/PluginEditor.cpp
+
16
−
1
View file @
7281f6f9
...
@@ -18,7 +18,14 @@ Test2AudioProcessorEditor::Test2AudioProcessorEditor(Test2AudioProcessor &p)
...
@@ -18,7 +18,14 @@ Test2AudioProcessorEditor::Test2AudioProcessorEditor(Test2AudioProcessor &p)
addAndMakeVisible
(
positionLabel
);
addAndMakeVisible
(
positionLabel
);
// add a label that will display the current timecode and status..
// add a label that will display the current timecode and status..
addAndMakeVisible
(
timecodeDisplayLabel
);
addAndMakeVisible
(
timecodeDisplayLabel
);
// slider
addAndMakeVisible
(
posSlider
);
posSlider
.
setRange
(
50
,
5000.0
);
posSlider
.
setValue
(
500.0
);
timecodeDisplayLabel
.
setFont
(
juce
::
Font
(
juce
::
Font
::
getDefaultMonospacedFontName
(),
15.0
f
,
juce
::
Font
::
plain
));
timecodeDisplayLabel
.
setFont
(
juce
::
Font
(
juce
::
Font
::
getDefaultMonospacedFontName
(),
15.0
f
,
juce
::
Font
::
plain
));
posSlider
.
addListener
(
this
);
positionLabel
.
setText
(
"Text input:"
,
juce
::
dontSendNotification
);
positionLabel
.
setText
(
"Text input:"
,
juce
::
dontSendNotification
);
positionLabel
.
setColour
(
juce
::
Label
::
textColourId
,
juce
::
Colours
::
orange
);
positionLabel
.
setColour
(
juce
::
Label
::
textColourId
,
juce
::
Colours
::
orange
);
...
@@ -28,8 +35,11 @@ Test2AudioProcessorEditor::Test2AudioProcessorEditor(Test2AudioProcessor &p)
...
@@ -28,8 +35,11 @@ Test2AudioProcessorEditor::Test2AudioProcessorEditor(Test2AudioProcessor &p)
setResizeLimits
(
400
,
300
,
1024
,
1024
);
setResizeLimits
(
400
,
300
,
1024
,
1024
);
setSize
(
400
,
300
);
setSize
(
400
,
300
);
if
(
processor
.
m_flogger
)
if
(
processor
.
m_flogger
)
{
processor
.
m_flogger
->
logMessage
(
"Editor initialized"
);
processor
.
m_flogger
->
logMessage
(
"Editor initialized"
);
}
}
}
Test2AudioProcessorEditor
::~
Test2AudioProcessorEditor
()
Test2AudioProcessorEditor
::~
Test2AudioProcessorEditor
()
{
{
...
@@ -44,7 +54,7 @@ void Test2AudioProcessorEditor::paint(juce::Graphics &g)
...
@@ -44,7 +54,7 @@ void Test2AudioProcessorEditor::paint(juce::Graphics &g)
g
.
setColour
(
juce
::
Colours
::
white
);
g
.
setColour
(
juce
::
Colours
::
white
);
g
.
setFont
(
15.0
f
);
g
.
setFont
(
15.0
f
);
g
.
drawFittedText
(
"
9
) Position : "
+
std
::
to_string
(
processor
.
position
),
getLocalBounds
(),
juce
::
Justification
::
centred
,
1
);
g
.
drawFittedText
(
"
10
) Position : "
+
std
::
to_string
(
processor
.
position
),
getLocalBounds
(),
juce
::
Justification
::
centred
,
1
);
// if (processor.m_flogger)
// if (processor.m_flogger)
// processor.m_flogger->logMessage("paint called");
// processor.m_flogger->logMessage("paint called");
}
}
...
@@ -57,6 +67,11 @@ void Test2AudioProcessorEditor::resized()
...
@@ -57,6 +67,11 @@ void Test2AudioProcessorEditor::resized()
auto
bounds
=
getLocalBounds
();
auto
bounds
=
getLocalBounds
();
positionLabel
.
setBounds
(
bounds
.
removeFromBottom
(
30
).
withSizeKeepingCentre
(
50
,
24
));
positionLabel
.
setBounds
(
bounds
.
removeFromBottom
(
30
).
withSizeKeepingCentre
(
50
,
24
));
timecodeDisplayLabel
.
setBounds
(
bounds
.
removeFromTop
(
26
));
timecodeDisplayLabel
.
setBounds
(
bounds
.
removeFromTop
(
26
));
posSlider
.
setBounds
(
100
,
30
,
getWidth
()
-
120
,
20
);
if
(
processor
.
m_flogger
)
if
(
processor
.
m_flogger
)
{
processor
.
m_flogger
->
logMessage
(
bounds
.
toString
());
processor
.
m_flogger
->
logMessage
(
bounds
.
toString
());
processor
.
m_flogger
->
logMessage
(
std
::
to_string
(
processor
.
buf_size
));
}
}
}
This diff is collapsed.
Click to expand it.
Source/PluginEditor.h
+
12
−
1
View file @
7281f6f9
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
//==============================================================================
//==============================================================================
/**
/**
*/
*/
class
Test2AudioProcessorEditor
:
public
juce
::
AudioProcessorEditor
,
private
juce
::
Timer
class
Test2AudioProcessorEditor
:
public
juce
::
AudioProcessorEditor
,
public
juce
::
Slider
::
Listener
,
private
juce
::
Timer
{
{
public:
public:
Test2AudioProcessorEditor
(
Test2AudioProcessor
&
);
Test2AudioProcessorEditor
(
Test2AudioProcessor
&
);
...
@@ -28,6 +28,17 @@ private:
...
@@ -28,6 +28,17 @@ private:
// This reference is provided as a quick way for your editor to
// This reference is provided as a quick way for your editor to
// access the processor object that created it.
// access the processor object that created it.
Test2AudioProcessor
&
processor
;
Test2AudioProcessor
&
processor
;
juce
::
Slider
posSlider
;
void
sliderValueChanged
(
juce
::
Slider
*
slider
)
override
{
if
(
slider
==
&
posSlider
)
{
if
(
processor
.
m_flogger
)
processor
.
m_flogger
->
logMessage
(
"slider changed"
);
}
}
// is this the way
// is this the way
juce
::
Label
positionLabel
,
timecodeDisplayLabel
;
// = juce::Label("Position", "Position : 0");
juce
::
Label
positionLabel
,
timecodeDisplayLabel
;
// = juce::Label("Position", "Position : 0");
// or something like
// or something like
...
...
This diff is collapsed.
Click to expand it.
Source/PluginProcessor.cpp
+
2
−
0
View file @
7281f6f9
...
@@ -129,6 +129,8 @@ void Test2AudioProcessor::processBlock(juce::AudioBuffer<float> &buffer, juce::M
...
@@ -129,6 +129,8 @@ void Test2AudioProcessor::processBlock(juce::AudioBuffer<float> &buffer, juce::M
auto
totalNumInputChannels
=
getTotalNumInputChannels
();
auto
totalNumInputChannels
=
getTotalNumInputChannels
();
auto
totalNumOutputChannels
=
getTotalNumOutputChannels
();
auto
totalNumOutputChannels
=
getTotalNumOutputChannels
();
buf_size
=
buffer
.
getNumSamples
();
// In case we have more outputs than inputs, this code clears any output
// In case we have more outputs than inputs, this code clears any output
// channels that didn't contain input data, (because these aren't
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
// guaranteed to be empty - they may contain garbage).
...
...
This diff is collapsed.
Click to expand it.
Source/PluginProcessor.h
+
3
−
2
View file @
7281f6f9
...
@@ -58,6 +58,7 @@ public:
...
@@ -58,6 +58,7 @@ public:
// this keeps a copy of the last set of time info that was acquired during an audio
// this keeps a copy of the last set of time info that was acquired during an audio
// callback - the UI component will read this and display it.
// callback - the UI component will read this and display it.
juce
::
AudioPlayHead
::
CurrentPositionInfo
lastPosInfo
;
juce
::
AudioPlayHead
::
CurrentPositionInfo
lastPosInfo
;
int
buf_size
;
private:
private:
//==============================================================================
//==============================================================================
...
@@ -72,8 +73,8 @@ private:
...
@@ -72,8 +73,8 @@ private:
if
(
ph
->
getCurrentPosition
(
newTime
))
if
(
ph
->
getCurrentPosition
(
newTime
))
{
{
lastPosInfo
=
newTime
;
// Successfully got the current time from the host..
lastPosInfo
=
newTime
;
// Successfully got the current time from the host..
if
(
m_flogger
)
//
if (m_flogger)
m_flogger
->
logMessage
(
"Got Pos from host"
);
//
m_flogger->logMessage("Got Pos from host");
return
;
return
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment