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
5c9bb332
Commit
5c9bb332
authored
5 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
midi log works
parent
c79f6d21
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Source/PluginEditor.cpp
+6
-8
6 additions, 8 deletions
Source/PluginEditor.cpp
Source/PluginProcessor.cpp
+20
-0
20 additions, 0 deletions
Source/PluginProcessor.cpp
Source/PluginProcessor.h
+33
-31
33 additions, 31 deletions
Source/PluginProcessor.h
with
59 additions
and
39 deletions
Source/PluginEditor.cpp
+
6
−
8
View file @
5c9bb332
...
...
@@ -15,8 +15,8 @@ Test2AudioProcessorEditor::Test2AudioProcessorEditor(Test2AudioProcessor &p)
{
// Make sure that before the constructor has finished, you've set the
// editor's size to whatever you need it to be.
m_flogger
=
std
::
unique_ptr
<
juce
::
FileLogger
>
(
juce
::
FileLogger
::
createDateStampedLogger
(
"foo"
,
"mylog"
,
".txt"
,
"Welcome to plugin"
));
// m_flogger = std::unique_ptr<juce::FileLogger>(juce::FileLogger::createDateStampedLogger("foo", "mylog", ".txt", "Welcome to plugin"));
setResizable
(
true
,
true
);
setSize
(
400
,
300
);
}
...
...
@@ -33,20 +33,18 @@ void Test2AudioProcessorEditor::paint(juce::Graphics &g)
g
.
setColour
(
juce
::
Colours
::
white
);
g
.
setFont
(
15.0
f
);
g
.
drawFittedText
(
"Hello Per
5
!"
,
getLocalBounds
(),
juce
::
Justification
::
centred
,
1
);
if
(
m_flogger
)
m_flogger
->
logMessage
(
"paint called"
);
g
.
drawFittedText
(
"Hello Per
6
!"
,
getLocalBounds
(),
juce
::
Justification
::
centred
,
1
);
if
(
processor
.
m_flogger
)
processor
.
m_flogger
->
logMessage
(
"paint called"
);
}
void
Test2AudioProcessorEditor
::
resized
()
{
// This is generally where you'll want to lay out the positions of any
// subcomponents in your editor..
if
(
m_flogger
)
m_flogger
->
logMessage
(
"resized called"
);
auto
bounds
=
getLocalBounds
();
if
(
m_flogger
)
m_flogger
->
logMessage
(
bounds
.
toString
());
//
if (m_flogger)
//
m_flogger->logMessage(bounds.toString());
}
This diff is collapsed.
Click to expand it.
Source/PluginProcessor.cpp
+
20
−
0
View file @
5c9bb332
...
...
@@ -22,6 +22,9 @@ Test2AudioProcessor::Test2AudioProcessor()
)
#endif
{
m_flogger
=
std
::
unique_ptr
<
juce
::
FileLogger
>
(
juce
::
FileLogger
::
createDateStampedLogger
(
"foo"
,
"mylog"
,
".txt"
,
"Welcome to plugin"
));
if
(
m_flogger
)
m_flogger
->
logMessage
(
"PluginProcessor"
);
}
Test2AudioProcessor
::~
Test2AudioProcessor
()
...
...
@@ -149,6 +152,23 @@ void Test2AudioProcessor::processBlock(juce::AudioBuffer<float> &buffer, juce::M
// ..do something to the data...
}
// auto iterator = midiMessages.Iterator;
auto
iterator
=
juce
::
MidiBuffer
::
Iterator
(
midiMessages
);
juce
::
MidiMessage
msg
;
int
sampleNum
;
while
(
iterator
.
getNextEvent
(
msg
,
sampleNum
))
{
if
(
msg
.
isController
())
{
//const auto *name = msg.getDescription();
//::MidiMessage::getControllerName(msg.getControllerNumber());
//const auto *name = juce::MidiMessage::getControllerName(msg.getControllerNumber());
if
(
m_flogger
)
m_flogger
->
logMessage
(
msg
.
getDescription
());
}
}
}
//==============================================================================
...
...
This diff is collapsed.
Click to expand it.
Source/PluginProcessor.h
+
33
−
31
View file @
5c9bb332
...
...
@@ -53,6 +53,8 @@ public:
void
getStateInformation
(
juce
::
MemoryBlock
&
destData
)
override
;
void
setStateInformation
(
const
void
*
data
,
int
sizeInBytes
)
override
;
std
::
unique_ptr
<
juce
::
FileLogger
>
m_flogger
;
private:
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
Test2AudioProcessor
)
...
...
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