Skip to content
Snippets Groups Projects
Commit 775e39ed authored by Per Lindgren's avatar Per Lindgren
Browse files

midi log works 2

parent 5c9bb332
Branches
No related tags found
No related merge requests found
......@@ -3,6 +3,74 @@
"mylog"
],
"files.associations": {
"*.mm": "cpp"
"*.mm": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp"
}
}
\ No newline at end of file
......@@ -33,7 +33,8 @@ void Test2AudioProcessorEditor::paint(juce::Graphics &g)
g.setColour(juce::Colours::white);
g.setFont(15.0f);
g.drawFittedText("Hello Per6!", getLocalBounds(), juce::Justification::centred, 1);
g.drawFittedText("Hello Per 10 !", getLocalBounds(), juce::Justification::centred, 1);
g.drawFittedText("Hello Per 10 !", getLocalBounds(), juce::Justification::centred, 1);
if (processor.m_flogger)
processor.m_flogger->logMessage("paint called");
}
......@@ -45,6 +46,6 @@ void Test2AudioProcessorEditor::resized()
auto bounds = getLocalBounds();
//if (m_flogger)
// m_flogger->logMessage(bounds.toString());
if (processor.m_flogger)
processor.m_flogger->logMessage(bounds.toString());
}
......@@ -23,6 +23,9 @@ Test2AudioProcessor::Test2AudioProcessor()
#endif
{
m_flogger = std::unique_ptr<juce::FileLogger>(juce::FileLogger::createDateStampedLogger("foo", "mylog", ".txt", "Welcome to plugin"));
position = 0;
if (m_flogger)
m_flogger->logMessage("PluginProcessor");
}
......@@ -153,22 +156,35 @@ 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))
for (const auto metadata : midiMessages)
{
auto msg = metadata.getMessage();
if (msg.isController())
{
//const auto *name = msg.getDescription();
//::MidiMessage::getControllerName(msg.getControllerNumber());
//const auto *name = juce::MidiMessage::getControllerName(msg.getControllerNumber());
if (msg.getRawData()[1] == 30)
{
switch (msg.getRawData()[2])
{
case 1:
position--;
break;
case 127:
position++;
break;
}
};
if (m_flogger)
{
m_flogger->logMessage(msg.getDescription());
}
}
m_flogger->logMessage("pos " + std::to_string(position));
//for (int i = 0; i < msg.getRawDataSize(); i++)
//{
// juce::uint8 val = msg.getRawData()[i];
// m_flogger->logMessage(std::to_string(val));
//};
};
};
};
}
//==============================================================================
......
......@@ -54,6 +54,7 @@ public:
void setStateInformation(const void *data, int sizeInBytes) override;
std::unique_ptr<juce::FileLogger> m_flogger;
int position;
private:
//==============================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment