Skip to content

Commit

Permalink
Merge branch 'hotfix/delay-keyboard-map'
Browse files Browse the repository at this point in the history
  • Loading branch information
rsjaffe committed Mar 4, 2020
2 parents 1015887 + 45359ef commit 98c11b5
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 147 deletions.
8 changes: 8 additions & 0 deletions Builds/MacOSX/App.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
</dict>
</plist>
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.9.1</string>
<string>3.4.10.0</string>
<key>CFBundleVersion</key>
<string>3.4.9.1</string>
<string>3.4.10.0</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
Expand Down
28 changes: 15 additions & 13 deletions Builds/MacOSX/MIDI2LR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@
path = ../../Source/Translate.cpp;
sourceTree = "SOURCE_ROOT";
};
4DBBB1B379D37503D066D6C7 = {
isa = PBXFileReference;
lastKnownFileType = text.plist.xml;
name = App.entitlements;
path = App.entitlements;
sourceTree = "SOURCE_ROOT";
};
5205E1551934B25B9956903B = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.cpp.cpp;
Expand Down Expand Up @@ -572,13 +579,6 @@
path = ../../Source/ProfileManager.h;
sourceTree = "SOURCE_ROOT";
};
909A37E13D2D591340143ADC = {
isa = PBXFileReference;
lastKnownFileType = text.plist.xml;
name = MIDI2LR.entitlements;
path = MIDI2LR.entitlements;
sourceTree = "SOURCE_ROOT";
};
92C2D3FB1EEBAD3ABBBD265E = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.cpp.objcpp;
Expand Down Expand Up @@ -1014,7 +1014,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_LINK_OBJC_RUNTIME = NO;
CODE_SIGN_ENTITLEMENTS = "MIDI2LR.entitlements";
CODE_SIGN_ENTITLEMENTS = "App.entitlements";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/build/$(CONFIGURATION)";
Expand All @@ -1029,8 +1029,8 @@
"DONT_SET_USING_JUCE_NAMESPACE=1",
"GSL_THROW_ON_CONTRACT_VIOLATION=1",
"JUCER_XCODE_MAC_F6D2F4CF=1",
"JUCE_APP_VERSION=3.4.9.1",
"JUCE_APP_VERSION_HEX=0x3040901",
"JUCE_APP_VERSION=3.4.10.0",
"JUCE_APP_VERSION_HEX=0x3040a00",
"JucePlugin_Build_VST=0",
"JucePlugin_Build_VST3=0",
"JucePlugin_Build_AU=0",
Expand Down Expand Up @@ -1067,7 +1067,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_LINK_OBJC_RUNTIME = NO;
CODE_SIGN_ENTITLEMENTS = "MIDI2LR.entitlements";
CODE_SIGN_ENTITLEMENTS = "App.entitlements";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/build/$(CONFIGURATION)";
Expand All @@ -1082,8 +1082,8 @@
"DONT_SET_USING_JUCE_NAMESPACE=1",
"GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1",
"JUCER_XCODE_MAC_F6D2F4CF=1",
"JUCE_APP_VERSION=3.4.9.1",
"JUCE_APP_VERSION_HEX=0x3040901",
"JUCE_APP_VERSION=3.4.10.0",
"JUCE_APP_VERSION_HEX=0x3040a00",
"JucePlugin_Build_VST=0",
"JucePlugin_Build_VST3=0",
"JucePlugin_Build_AU=0",
Expand Down Expand Up @@ -1155,6 +1155,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PRODUCT_NAME = "MIDI2LR";
SDKROOT = macosx;
WARNING_CFLAGS = "-Wreorder";
ZERO_LINK = NO;
};
Expand Down Expand Up @@ -1200,6 +1201,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PRODUCT_NAME = "MIDI2LR";
SDKROOT = macosx;
WARNING_CFLAGS = "-Wreorder";
ZERO_LINK = NO;
};
Expand Down
7 changes: 5 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.9.1;JUCE_APP_VERSION_HEX=0x3040901;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.10.0;JUCE_APP_VERSION_HEX=0x3040a00;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.9.1;JUCE_APP_VERSION_HEX=0x3040901;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.10.0;JUCE_APP_VERSION_HEX=0x3040a00;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 @@ -575,6 +575,9 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\threads\juce_TimeSliceThread.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\threads\juce_WaitableEvent.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\time\juce_PerformanceCounter.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
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 @@ -766,6 +766,9 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\threads\juce_TimeSliceThread.cpp">
<Filter>JUCE Modules\juce_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\threads\juce_WaitableEvent.cpp">
<Filter>JUCE Modules\juce_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\time\juce_PerformanceCounter.cpp">
<Filter>JUCE Modules\juce_core\time</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,9,1
FILEVERSION 3,4,10,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "MIDI2LR\0"
VALUE "FileVersion", "3.4.9.1\0"
VALUE "FileVersion", "3.4.10.0\0"
VALUE "ProductName", "MIDI2LR\0"
VALUE "ProductVersion", "3.4.9.1\0"
VALUE "ProductVersion", "3.4.10.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.9.1
PROJECT_NUMBER = 3.4.10.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.9.1</version>
<version>3.4.10.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
6 changes: 3 additions & 3 deletions JuceLibraryCode/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

#define JUCE_USE_DARK_SPLASH_SCREEN 1

#define JUCE_PROJUCER_VERSION 0x50405
#define JUCE_PROJUCER_VERSION 0x50407

//==============================================================================
#define JUCE_MODULE_AVAILABLE_juce_audio_basics 1
Expand Down Expand Up @@ -153,8 +153,8 @@
//==============================================================================
// juce_events flags:

#ifndef JUCE_EXECUTE_APP_SUSPEND_ON_IOS_BACKGROUND_TASK
#define JUCE_EXECUTE_APP_SUSPEND_ON_IOS_BACKGROUND_TASK 0
#ifndef JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK
//#define JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 0
#endif

//==============================================================================
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.9.1";
const int versionNumber = 0x3040901;
const char* const versionString = "3.4.10.0";
const int versionNumber = 0x3040a00;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ namespace juce
/**
Maintains an ongoing measurement of the proportion of time which is being
spent inside an audio callback.
@tags{Audio}
*/
class JUCE_API AudioProcessLoadMeasurer
{
Expand Down Expand Up @@ -68,6 +70,8 @@ class JUCE_API AudioProcessLoadMeasurer
myCallback->doTheCallback();
}
@endcode
@tags{Audio}
*/
struct JUCE_API ScopedTimer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class JUCE_API DialogWindow : public DocumentWindow
//==============================================================================
/** Easy way of quickly showing a dialog box containing a given component.
Note: This method has been superceded by the DialogWindow::LaunchOptions structure,
Note: This method has been superseded by the DialogWindow::LaunchOptions structure,
which does the same job with some extra flexibility. The showDialog method is here
for backwards compatibility, but please use DialogWindow::LaunchOptions in new code.
Expand Down Expand Up @@ -199,7 +199,7 @@ class JUCE_API DialogWindow : public DocumentWindow
#if JUCE_MODAL_LOOPS_PERMITTED || DOXYGEN
/** Easy way of quickly showing a dialog box containing a given component.
Note: This method has been superceded by the DialogWindow::LaunchOptions structure,
Note: This method has been superseded by the DialogWindow::LaunchOptions structure,
which does the same job with some extra flexibility. The showDialog method is here
for backwards compatibility, but please use DialogWindow::LaunchOptions in new code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class JUCE_API ResizableWindow : public TopLevelWindow
A pointer to the object you pass in will be kept, but it won't be deleted
by this object, so it's the caller's responsibility to manage it.
If you pass a nullptr, then no contraints will be placed on the positioning of the window.
If you pass a nullptr, then no constraints will be placed on the positioning of the window.
*/
void setConstrainer (ComponentBoundsConstrainer* newConstrainer);

Expand Down
4 changes: 2 additions & 2 deletions MIDI2LR.jucer
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="jqaeel" name="MIDI2LR" projectType="guiapp" version="3.4.9.1"
<JUCERPROJECT id="jqaeel" name="MIDI2LR" projectType="guiapp" version="3.4.10.0"
bundleIdentifier="com.rsjaffe.MIDI2LR" includeBinaryInAppConfig="1"
jucerVersion="5.4.5" companyWebsite="http://rsjaffe.github.io/MIDI2LR/"
jucerVersion="5.4.7" companyWebsite="http://rsjaffe.github.io/MIDI2LR/"
companyEmail="rsjaffe@gmail.com" displaySplashScreen="0" reportAppUsage="0"
splashScreenColour="Dark" cppLanguageStandard="latest" companyCopyright=""
defines="DONT_SET_USING_JUCE_NAMESPACE=1" compilerFlagSchemes=""
Expand Down
60 changes: 28 additions & 32 deletions Source/DebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

#ifdef _WIN32
#include <array>
#include <fmt/format.h>
#include <string>
#include <unordered_map>

#include <fmt/format.h>

#include "WinDef.h"
#undef NOUSER
#include <Windows.h>
Expand Down Expand Up @@ -121,47 +122,41 @@ namespace {
{0x00040409, "United States-Dvorak for right hand"}, {0x00000409, "United States - English"},
{0x00000420, "Urdu"}, {0x00010480, "Uyghur (Legacy)"}, {0x00000843, "Uzbek Cyrillic"},
{0x0000042a, "Vietnamese"}, {0x00000488, "Wolof"}, {0x0000046a, "Yoruba"}};
} // namespace

std::string rsj::GetKeyboardLayout()
{
try {
static_assert(sizeof(CHAR) == sizeof(char), "Windows CHAR and char different sizes.");
std::array<CHAR, KL_NAMELENGTH> klid_ascii{};
if (GetKeyboardLayoutNameA(klid_ascii.data())) {
try {
const auto klid{std::stoul(std::string(klid_ascii.data()), nullptr, 16)};
if (const auto f = kKeyboardNames.find(klid); f != kKeyboardNames.end())
return f->second;
return fmt::format("KLID not in keyboard_names: 0x{}.", klid_ascii.data());
}
catch (...) {
const auto msg{
fmt::format("Exception when finding KLID name. KLID: 0x{}.", klid_ascii.data())};
rsj::Log(msg);
return msg;
std::string GetKeyboardLayout()
{
try {
static_assert(sizeof(CHAR) == sizeof(char), "Windows CHAR and char different sizes.");
std::array<CHAR, KL_NAMELENGTH> klid_ascii{};
if (GetKeyboardLayoutNameA(klid_ascii.data())) {
try {
const auto klid{std::stoul(std::string(klid_ascii.data()), nullptr, 16)};
if (const auto f = kKeyboardNames.find(klid); f != kKeyboardNames.end())
return f->second;
return fmt::format("KLID not in keyboard_names: 0x{}.", klid_ascii.data());
}
catch (...) {
const auto msg{
fmt::format("Exception when finding KLID name. KLID: 0x{}.", klid_ascii.data())};
rsj::Log(msg);
return msg;
}
}
return fmt::format("Unable to get KLID. Error {}.", GetLastError());
}
catch (const std::exception& e) {
rsj::ExceptionResponse("GetKeyboardLayout", MIDI2LR_FUNC, e);
throw;
}
return fmt::format("Unable to get KLID. Error {}.", GetLastError());
}
catch (const std::exception& e) {
rsj::ExceptionResponse("rsj", MIDI2LR_FUNC, e);
throw;
}
}
#else
#include "Ocpp.h"
} // namespace
#endif

#pragma warning(push)
#pragma warning(disable : 26447) /* all exceptions suppressed by catch blocks */
DebugInfo::DebugInfo(const juce::String& profile_directory) noexcept
{
try {
#ifndef _WIN32
if (!juce::MessageManager::callAsync(rsj::FillInMessageLoop))
rsj::Log("Unable to post FillInMessageLoop to message queue.");
#endif
LogAndSave(fmt::format("Application: System language {}.",
juce::SystemStats::getDisplayLanguage().toStdString()));
// ReSharper disable CppUnreachableCode
Expand All @@ -185,11 +180,12 @@ DebugInfo::DebugInfo(const juce::String& profile_directory) noexcept
"Application: Log file directory {}.", rsj::WideToUtf8(rsj::AppLogFilePath(L""))));
LogAndSave(fmt::format(
"Application: Settings file directory {}.", rsj::WideToUtf8(rsj::AppDataFilePath(L""))));
/* MacOS keyboard type read when first trying to send keystroke */
LogAndSave(fmt::format("Application: Keyboard type {}.", GetKeyboardLayout()));
#else
LogAndSave(fmt::format("Application: Log file directory {}.", rsj::AppLogFilePath("")));
LogAndSave(fmt::format("Application: Settings file directory {}.", rsj::AppDataFilePath("")));
#endif
LogAndSave(fmt::format("Application: Keyboard type {}.", rsj::GetKeyboardLayout()));
}
catch (...) {
try {
Expand Down
4 changes: 0 additions & 4 deletions Source/DebugInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,4 @@ class DebugInfo {
std::vector<std::string> info_;
};

namespace rsj {
std::string GetKeyboardLayout();
}

#endif
Loading

0 comments on commit 98c11b5

Please sign in to comment.