Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rsjaffe committed Dec 11, 2019
2 parents ae6b78e + b94b0ce commit 0ac9f1f
Show file tree
Hide file tree
Showing 55 changed files with 11,058 additions and 302 deletions.
8 changes: 4 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# Visual Studio 2019 currently (October 2019) using clang-format v8. Options for later versions
# Visual Studio 2019 currently (December 2019) using clang-format v9. Options for later versions
# may be included but are commented out. Uncomment if used with a later version of clang-format.
# currently includes options for version 10.
AccessModifierOffset: -2
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
#AlignConsecutiveMacros: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
Expand All @@ -15,7 +15,7 @@ AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
#AllowShortLambdasOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
Expand Down Expand Up @@ -66,7 +66,7 @@ ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
#SpaceAfterLogicalNot: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
Expand Down
4 changes: 2 additions & 2 deletions Builds/MacOSX/Info-App.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>3.4.2.1</string>
<string>3.4.3.0</string>
<key>CFBundleVersion</key>
<string>3.4.2.1</string>
<string>3.4.3.0</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
Expand Down
21 changes: 17 additions & 4 deletions Builds/MacOSX/MIDI2LR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
isa = PBXBuildFile;
fileRef = 78C490E72B571C45E9BF65BE;
};
BC25302F3E7D28AEBB8B1FD0 = {
isa = PBXBuildFile;
fileRef = 2D22DEDAD3937109B1AE2127;
};
E84B9F94B2BDF252A535BB01 = {
isa = PBXBuildFile;
fileRef = BC2DEB32C59CF4720281C133;
Expand Down Expand Up @@ -291,6 +295,13 @@
path = "../../Source/LR_IPC_Out.cpp";
sourceTree = "SOURCE_ROOT";
};
2D22DEDAD3937109B1AE2127 = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.cpp.cpp;
name = format.cc;
path = ../../fmt/format.cc;
sourceTree = "SOURCE_ROOT";
};
334B209B53531AD494AD8132 = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.cpp.cpp;
Expand Down Expand Up @@ -819,6 +830,7 @@
55BA6062DF892191C9E9B3BE = {
isa = PBXGroup;
children = (
2D22DEDAD3937109B1AE2127,
BC2DEB32C59CF4720281C133,
F675B2D85B415E2C87CEF455,
0ED56980FCA5D40E4BCC5C8A,
Expand Down Expand Up @@ -989,8 +1001,8 @@
"DONT_SET_USING_JUCE_NAMESPACE=1",
"GSL_THROW_ON_CONTRACT_VIOLATION=1",
"JUCER_XCODE_MAC_F6D2F4CF=1",
"JUCE_APP_VERSION=3.4.2.1",
"JUCE_APP_VERSION_HEX=0x3040201",
"JUCE_APP_VERSION=3.4.3.0",
"JUCE_APP_VERSION_HEX=0x3040300",
"JucePlugin_Build_VST=0",
"JucePlugin_Build_VST3=0",
"JucePlugin_Build_AU=0",
Expand Down Expand Up @@ -1042,8 +1054,8 @@
"DONT_SET_USING_JUCE_NAMESPACE=1",
"GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1",
"JUCER_XCODE_MAC_F6D2F4CF=1",
"JUCE_APP_VERSION=3.4.2.1",
"JUCE_APP_VERSION_HEX=0x3040201",
"JUCE_APP_VERSION=3.4.3.0",
"JUCE_APP_VERSION_HEX=0x3040300",
"JucePlugin_Build_VST=0",
"JucePlugin_Build_VST3=0",
"JucePlugin_Build_AU=0",
Expand Down Expand Up @@ -1200,6 +1212,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BC25302F3E7D28AEBB8B1FD0,
E84B9F94B2BDF252A535BB01,
BFAB1A9B97A0C128DF41C02A,
FD5777A03748CDE3465E71D3,
Expand Down
5 changes: 3 additions & 2 deletions Builds/VisualStudio2019/MIDI2LR_App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../;../../asio/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_THROW_ON_CONTRACT_VIOLATION=1;_WIN32_WINNT=0x0601;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.4.2.1;JUCE_APP_VERSION_HEX=0x3040201;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_THROW_ON_CONTRACT_VIOLATION=1;_WIN32_WINNT=0x0601;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.4.3.0;JUCE_APP_VERSION_HEX=0x3040300;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
Expand Down Expand Up @@ -106,7 +106,7 @@
<ClCompile>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../;../../asio/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1;_WIN32_WINNT=0x0601;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.4.2.1;JUCE_APP_VERSION_HEX=0x3040201;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1;_WIN32_WINNT=0x0601;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.4.3.0;JUCE_APP_VERSION_HEX=0x3040300;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
Expand Down Expand Up @@ -139,6 +139,7 @@
<Lib/>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\fmt\format.cc"/>
<ClCompile Include="..\..\Source\TextButtonAligned.cpp"/>
<ClCompile Include="..\..\Source\CCoptions.cpp"/>
<ClCompile Include="..\..\Source\CommandMenu.cpp"/>
Expand Down
3 changes: 3 additions & 0 deletions Builds/VisualStudio2019/MIDI2LR_App.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\fmt\format.cc">
<Filter>MIDI2LR\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\TextButtonAligned.cpp">
<Filter>MIDI2LR\Source</Filter>
</ClCompile>
Expand Down
6 changes: 3 additions & 3 deletions Builds/VisualStudio2019/resources.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
#include <windows.h>

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,4,2,1
FILEVERSION 3,4,3,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "MIDI2LR\0"
VALUE "FileVersion", "3.4.2.1\0"
VALUE "FileVersion", "3.4.3.0\0"
VALUE "ProductName", "MIDI2LR\0"
VALUE "ProductVersion", "3.4.2.1\0"
VALUE "ProductVersion", "3.4.3.0\0"
END
END

Expand Down
2 changes: 1 addition & 1 deletion DoxyGen/Midi2lr.Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = MIDI2LR
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 3.4.2.1
PROJECT_NUMBER = 3.4.3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion Installer/MIDI2LR.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project>
<shortName>MIDI2LR</shortName>
<fullName>MIDI2LR</fullName>
<version>3.4.2.1</version>
<version>3.4.3.0</version>
<installerFilename>${product_shortname}-${product_version}-${debuglabel}${platform_name}-installer.${platform_exec_suffix}</installerFilename>
<readmeFile>../Source/LRPlugin/ReadMe.txt</readmeFile>
<licenseFile>../LICENSE.txt</licenseFile>
Expand Down
4 changes: 2 additions & 2 deletions JuceLibraryCode/JuceHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace ProjectInfo
{
const char* const projectName = "MIDI2LR";
const char* const companyName = "";
const char* const versionString = "3.4.2.1";
const int versionNumber = 0x3040201;
const char* const versionString = "3.4.3.0";
const int versionNumber = 0x3040300;
}
#endif
5 changes: 3 additions & 2 deletions MIDI2LR.jucer
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="jqaeel" name="MIDI2LR" projectType="guiapp" version="3.4.2.1"
<JUCERPROJECT id="jqaeel" name="MIDI2LR" projectType="guiapp" version="3.4.3.0"
bundleIdentifier="com.rsjaffe.MIDI2LR" includeBinaryInAppConfig="1"
jucerVersion="5.4.5" companyWebsite="http://rsjaffe.github.io/MIDI2LR/"
companyEmail="[email protected]" displaySplashScreen="0" reportAppUsage="0"
splashScreenColour="Dark" cppLanguageStandard="latest" companyCopyright=""
defines="DONT_SET_USING_JUCE_NAMESPACE=1" compilerFlagSchemes=""
headerPath="../../&#10;../../asio/">
headerPath="../../&#10;../../asio/&#10;">
<MAINGROUP id="XbT1lm" name="MIDI2LR">
<GROUP id="{FC911F9D-9F68-948C-ADEF-64BE6AA850ED}" name="Source">
<FILE id="K5h83d" name="format.cc" compile="1" resource="0" file="fmt/format.cc"/>
<FILE id="Dx8BIb" name="TextButtonAligned.cpp" compile="1" resource="0"
file="Source/TextButtonAligned.cpp"/>
<FILE id="SupFD5" name="TextButtonAligned.h" compile="0" resource="0"
Expand Down
7 changes: 4 additions & 3 deletions Source/CCoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ class ControlsModel;
Describe your class and how it works here!
//[/Comments]
*/
class CCoptions final : public juce::Component,
juce::TextEditor::Listener,
public juce::Button::Listener {
class CCoptions final :
public juce::Component,
juce::TextEditor::Listener,
public juce::Button::Listener {
public:
//==============================================================================
CCoptions();
Expand Down
3 changes: 2 additions & 1 deletion Source/CommandSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "CommandSet.h"

#include <exception>
#include <fmt/format.h>
#ifndef _WIN32
#include <AvailabilityMacros.h>
#if defined(MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 \
Expand Down Expand Up @@ -112,7 +113,7 @@ size_t CommandSet::CommandTextIndex(const std::string& command) const
try {
const auto found = cmd_idx_.find(command);
if (found == cmd_idx_.end()) {
rsj::Log("Command not found in CommandTextIndex: " + command);
rsj::Log(fmt::format("Command not found in CommandTextIndex: {}.", command));
return 0;
}
return found->second;
Expand Down
12 changes: 5 additions & 7 deletions Source/CommandSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <string>
#include <unordered_map>
#include <vector>
#include <fmt/format.h>

#include <cereal/access.hpp>
#include <cereal/types/utility.hpp>
Expand Down Expand Up @@ -83,14 +84,11 @@ class CommandSet {
archive(cereal::make_nvp("language", language_),
cereal::make_nvp("all_commands", allcommands_));
else {
const auto v = juce::String(version);
rsj::LogAndAlertError(juce::translate("The file, 'MenuTrans.xml', is marked as a "
"version not supported by the current version of "
"MIDI2LR, and won't be loaded. File version: ")
+ v,
constexpr auto msg =
"The file, 'MenuTrans.xml', is marked as a version not supported by the current "
"version of MIDI2LR, and won't be loaded. File version: "
+ v);
"version of MIDI2LR, and won't be loaded. File version: {}.";
rsj::LogAndAlertError(fmt::format(juce::translate(msg).toStdString(), version),
fmt::format(msg, version));
}
}
std::string language_;
Expand Down
12 changes: 4 additions & 8 deletions Source/CommandTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
#include "CommandTable.h"

#include <algorithm>
#include <exception>
#include <memory>

Expand Down Expand Up @@ -74,20 +75,15 @@ bool CommandTable::keyPressed(const juce::KeyPress& k)
}
if (key_pressed == juce::KeyPress::pageUpKey) {
if (juce::TableListBox::getNumRows() > 0) {
auto row = juce::ListBox::getSelectedRow() - 20;
if (row < 0)
row = 0;
juce::ListBox::selectRow(row);
juce::ListBox::selectRow(std::max(juce::ListBox::getSelectedRow() - 20, 0));
return true;
}
return false;
}
if (key_pressed == juce::KeyPress::pageDownKey) {
if (juce::TableListBox::getNumRows() > 0) {
auto row = juce::ListBox::getSelectedRow() + 20;
if (row >= juce::TableListBox::getNumRows())
row = juce::TableListBox::getNumRows() - 1;
juce::ListBox::selectRow(row);
juce::ListBox::selectRow(std::min(
juce::ListBox::getSelectedRow() + 20, juce::TableListBox::getNumRows() - 1));
return true;
}
return false;
Expand Down
25 changes: 12 additions & 13 deletions Source/CommandTableModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "CommandTableModel.h"

#include <exception>
#include <sstream>
#include <fmt/format.h>
#include <utility>

#include <gsl/gsl>
Expand All @@ -43,39 +43,38 @@ void CommandTableModel::paintCell(
if (profile_.Size() <= gsl::narrow_cast<size_t>(row_number)) {
/* error condition */
g.drawText("Unknown control", 0, 0, width, height, juce::Justification::centred);
rsj::Log("Unknown control CommandTableModel::paintCell. "
+ juce::String(profile_.Size())
+ " rows in profile, row number to be painted is " + juce::String(row_number)
+ '.');
rsj::Log(fmt::format("Unknown control CommandTableModel::paintCell. {} rows in "
"profile, row number to be painted is {}.",
profile_.Size(), row_number));
}
else {
std::ostringstream format_str;
std::string format_str;
switch (
const auto cmd = profile_.GetMessageForNumber(gsl::narrow_cast<size_t>(row_number));
cmd.msg_id_type) {
case rsj::MessageType::NoteOn:
format_str << cmd.channel << " | Note : " << cmd.control_number;
format_str = fmt::format("{} | Note : {}", cmd.channel, cmd.control_number);
break;
case rsj::MessageType::NoteOff:
format_str << cmd.channel << " | Note Off: " << cmd.control_number;
format_str = fmt::format("{} | Note Off: {}", cmd.channel, cmd.control_number);
break;
case rsj::MessageType::Cc:
format_str << cmd.channel << " | CC: " << cmd.control_number;
format_str = fmt::format("{} | CC: {}", cmd.channel, cmd.control_number);
break;
case rsj::MessageType::Pw:
format_str << cmd.channel << " | Pitch Bend";
format_str = fmt::format("{} | Pitch Bend", cmd.channel);
break;
case rsj::MessageType::KeyPressure:
format_str << cmd.channel << " | Key Pressure: " << cmd.control_number;
format_str = fmt::format("{} | Key Pressure: {}", cmd.channel, cmd.control_number);
break;
case rsj::MessageType::ChanPressure:
format_str << cmd.channel << " | Channel Pressure";
format_str = fmt::format("{} | Channel Pressure", cmd.channel);
break;
case rsj::MessageType::PgmChange: /* TODO: not handled currently */
case rsj::MessageType::System:
break;
}
g.drawText(format_str.str(), 0, 0, width, height, juce::Justification::centredLeft);
g.drawText(format_str, 0, 0, width, height, juce::Justification::centredLeft);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions Source/Concurrency.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <optional>
#include <type_traits>
extern "C" {
extern void _mm_pause(void);
extern void _mm_pause();
}

namespace rsj {
Expand Down Expand Up @@ -190,9 +190,9 @@ namespace rsj {
T pop()
{
auto lock{std::unique_lock(mutex_)};
condition_.wait(
lock, [this]() noexcept(
noexcept(std::declval<Container>().empty())) { return !queue_.empty(); });
condition_.wait(lock, [this]() noexcept(noexcept(std::declval<Container>().empty())) {
return !queue_.empty();
});
T rc{std::move(queue_.front())};
queue_.pop_front();
return rc;
Expand Down Expand Up @@ -237,7 +237,7 @@ namespace rsj {
noexcept(std::declval<Container>().clear()) && noexcept(std::declval<Container>().size()))
{
auto lock{std::scoped_lock(mutex_)};
auto ret = queue_.size();
const auto ret = queue_.size();
queue_.clear();
return ret;
}
Expand Down
Loading

0 comments on commit 0ac9f1f

Please sign in to comment.