Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rsjaffe committed Mar 16, 2019
2 parents 34d3d6d + 54aa5df commit 52d5b64
Show file tree
Hide file tree
Showing 39 changed files with 487 additions and 481 deletions.
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.0.0.11</string>
<string>3.0.1.0</string>
<key>CFBundleVersion</key>
<string>3.0.0.11</string>
<string>3.0.1.0</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
Expand Down
8 changes: 4 additions & 4 deletions Builds/MacOSX/MIDI2LR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@
"DONT_SET_USING_JUCE_NAMESPACE=1",
"GSL_THROW_ON_CONTRACT_VIOLATION=1",
"JUCER_XCODE_MAC_F6D2F4CF=1",
"JUCE_APP_VERSION=3.0.0.11",
"JUCE_APP_VERSION_HEX=0x300000b",
"JUCE_APP_VERSION=3.0.1.0",
"JUCE_APP_VERSION_HEX=0x3000100",
"JucePlugin_Build_VST=0",
"JucePlugin_Build_VST3=0",
"JucePlugin_Build_AU=0",
Expand Down Expand Up @@ -1001,8 +1001,8 @@
"DONT_SET_USING_JUCE_NAMESPACE=1",
"GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1",
"JUCER_XCODE_MAC_F6D2F4CF=1",
"JUCE_APP_VERSION=3.0.0.11",
"JUCE_APP_VERSION_HEX=0x300000b",
"JUCE_APP_VERSION=3.0.1.0",
"JUCE_APP_VERSION_HEX=0x3000100",
"JucePlugin_Build_VST=0",
"JucePlugin_Build_VST3=0",
"JucePlugin_Build_AU=0",
Expand Down
4 changes: 2 additions & 2 deletions Builds/VisualStudio2017/MIDI2LR_App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../;../../icu/source/common/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_THROW_ON_CONTRACT_VIOLATION=1;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=3.0.0.11;JUCE_APP_VERSION_HEX=0x300000b;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;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_THROW_ON_CONTRACT_VIOLATION=1;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=3.0.1.0;JUCE_APP_VERSION_HEX=0x3000100;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 @@ -105,7 +105,7 @@
<ClCompile>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../;../../icu/source/common/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=3.0.0.11;JUCE_APP_VERSION_HEX=0x300000b;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;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=3.0.1.0;JUCE_APP_VERSION_HEX=0x3000100;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>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
Expand Down
6 changes: 3 additions & 3 deletions Builds/VisualStudio2017/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,0,0,11
FILEVERSION 3,0,1,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "MIDI2LR\0"
VALUE "FileVersion", "3.0.0.11\0"
VALUE "FileVersion", "3.0.1.0\0"
VALUE "ProductName", "MIDI2LR\0"
VALUE "ProductVersion", "3.0.0.11\0"
VALUE "ProductVersion", "3.0.1.0\0"
END
END

Expand Down
4 changes: 2 additions & 2 deletions Builds/VisualStudio2019/MIDI2LR_App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../;../../icu/source/common/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_THROW_ON_CONTRACT_VIOLATION=1;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.0.0.11;JUCE_APP_VERSION_HEX=0x300000b;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;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_THROW_ON_CONTRACT_VIOLATION=1;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.0.1.0;JUCE_APP_VERSION_HEX=0x3000100;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 @@ -105,7 +105,7 @@
<ClCompile>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../;../../icu/source/common/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.0.0.11;JUCE_APP_VERSION_HEX=0x300000b;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;U_STATIC_IMPLEMENTATION=1;DONT_SET_USING_JUCE_NAMESPACE=1;GSL_UNENFORCED_ON_CONTRACT_VIOLATION=1;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=3.0.1.0;JUCE_APP_VERSION_HEX=0x3000100;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>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
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,0,0,11
FILEVERSION 3,0,1,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "MIDI2LR\0"
VALUE "FileVersion", "3.0.0.11\0"
VALUE "FileVersion", "3.0.1.0\0"
VALUE "ProductName", "MIDI2LR\0"
VALUE "ProductVersion", "3.0.0.11\0"
VALUE "ProductVersion", "3.0.1.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.0.0.11
PROJECT_NUMBER = 3.0.1.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
10 changes: 4 additions & 6 deletions 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.0.0.11</version>
<version>3.0.1.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 Expand Up @@ -148,13 +148,10 @@
<origin>../Source/LRPlugin/MIDI2LR.lrplugin/TranslatedStrings_sv.txt</origin>
</distributionFile>
<distributionFile>
<origin>../Source/LRPlugin/MIDI2LR.lrplugin/TranslatedStrings_zn_cn.txt</origin>
<origin>../Source/LRPlugin/MIDI2LR.lrplugin/TranslatedStrings_zh_cn.txt</origin>
</distributionFile>
<distributionFile>
<origin>../Source/LRPlugin/MIDI2LR.lrplugin/TranslatedStrings_zn_tw.txt</origin>
</distributionFile>
<distributionFile>
<origin>../Source/LRPlugin/MIDI2LR.lrplugin/TRANSLATIONS.txt</origin>
<origin>../Source/LRPlugin/MIDI2LR.lrplugin/TranslatedStrings_zh_tw.txt</origin>
</distributionFile>
<distributionFile>
<origin>${lua}/Utilities.lua</origin>
Expand Down Expand Up @@ -389,6 +386,7 @@
<compressPackedFiles>1</compressPackedFiles>
<compressionAlgorithm>lzma-ultra</compressionAlgorithm>
<createOsxBundleDmg>1</createOsxBundleDmg>
<createUninstaller>0</createUninstaller>
<enableRollback>1</enableRollback>
<enableTimestamp>1</enableTimestamp>
<height>400</height>
Expand Down
4 changes: 2 additions & 2 deletions JuceLibraryCode/JuceHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace ProjectInfo
{
const char* const projectName = "MIDI2LR";
const char* const companyName = "";
const char* const versionString = "3.0.0.11";
const int versionNumber = 0x300000b;
const char* const versionString = "3.0.1.0";
const int versionNumber = 0x3000100;
}
#endif
2 changes: 1 addition & 1 deletion MIDI2LR.jucer
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="jqaeel" name="MIDI2LR" projectType="guiapp" version="3.0.0.11"
<JUCERPROJECT id="jqaeel" name="MIDI2LR" projectType="guiapp" version="3.0.1.0"
bundleIdentifier="com.rsjaffe.MIDI2LR" includeBinaryInAppConfig="1"
jucerVersion="5.4.3" companyWebsite="http://rsjaffe.github.io/MIDI2LR/"
companyEmail="rsjaffe@gmail.com" displaySplashScreen="0" reportAppUsage="0"
Expand Down
2 changes: 1 addition & 1 deletion Source/CCoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ using namespace juce;
//[/Headers]

//[MiscUserDefs] You can add your own user definitions and misc code here...
ControlsModel* CCoptions::controls_model_{nullptr};

//[/MiscUserDefs]

//==============================================================================
Expand Down
6 changes: 3 additions & 3 deletions Source/CCoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class CCoptions : public juce::Component, juce::TextEditor::Listener, public juc
controls_model_ = model;
}
void BindToControl(size_t channel, short number);
CCoptions(CCoptions&& other) noexcept = delete;
CCoptions& operator=(CCoptions&& other) noexcept = delete;
//[/UserMethods]

void paint(juce::Graphics& g) override;
Expand All @@ -78,11 +80,9 @@ class CCoptions : public juce::Component, juce::TextEditor::Listener, public juc
//[UserVariables] -- You can add your own custom variables in this section.
juce::TextEditor::LengthAndCharacterRestriction numrestrict_{5, "0123456789"};
void textEditorFocusLost(juce::TextEditor& t) override;
static ControlsModel* controls_model_;
inline static ControlsModel* controls_model_{nullptr};
short bound_channel_{0}; // note: 0-based in program, add one to compensate
short bound_number_{0};
CCoptions(CCoptions&& other) noexcept = delete;
CCoptions& operator=(CCoptions&& other) noexcept = delete;
//[/UserVariables]

//==============================================================================
Expand Down
158 changes: 130 additions & 28 deletions Source/CommandMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,57 @@ MIDI2LR. If not, see <http://www.gnu.org/licenses/>.

#include <exception>

#include <gsl/gsl>
#include "Misc.h"

void CommandMap::AddCommandforMessage(size_t command, const rsj::MidiMessageId& message)
void CommandMap::Resort(std::pair<int, bool> new_order)
{
try {
// adds a message to the message:command map, and its associated command to the
// command:message map
auto guard = std::unique_lock{cmdmap_mutex_};
if (command < command_set_.CommandAbbrevSize()) {
auto cmd_abbreviation = command_set_.CommandAbbrevAt(command);
message_map_[message] = cmd_abbreviation;
command_string_map_.emplace(cmd_abbreviation, message);
}
auto guard = std::unique_lock{cmdmap_mtx_};
current_sort_ = new_order;
Sort_();
}

void CommandMap::AddCommandforMessage_(size_t command, const rsj::MidiMessageId& message)
{ // internal use
if (command < command_set_.CommandAbbrevSize()) {
auto cmd_abbreviation = command_set_.CommandAbbrevAt(command);
message_map_[message] = cmd_abbreviation;
command_string_map_.emplace(cmd_abbreviation, message);
}
catch (const std::exception& e) {
rsj::ExceptionResponse(typeid(this).name(), __func__, e);
throw;
}

void CommandMap::AddRowMapped(const std::string& command, const rsj::MidiMessageId message)
{
auto guard = std::unique_lock{cmdmap_mtx_};
if (!MessageExistsInMap_(message)) {
if (!command_set_.CommandTextIndex(command)) {
message_map_[message] = "Unmapped";
command_string_map_.emplace("Unmapped", message);
}
else {
message_map_[message] = command;
command_string_map_.emplace(command, message);
}
command_table_.push_back(message);
Sort_();
}
}

std::vector<const rsj::MidiMessageId*> CommandMap::GetMessagesForCommand(
const std::string& command) const
{
try {
auto guard = std::shared_lock{cmdmap_mutex_};
std::vector<const rsj::MidiMessageId*> mm;
const auto range = command_string_map_.equal_range(command);
for (auto it = range.first; it != range.second; ++it)
mm.push_back(&it->second);
return mm;
}
catch (const std::exception& e) {
rsj::ExceptionResponse(typeid(this).name(), __func__, e);
throw;
}
{ // external use only
auto guard = std::shared_lock{cmdmap_mtx_};
std::vector<const rsj::MidiMessageId*> mm;
const auto range = command_string_map_.equal_range(command);
for (auto it = range.first; it != range.second; ++it)
mm.push_back(&it->second);
return mm;
}

void CommandMap::ToXmlDocument(const juce::File& file) const
{
{ // external use only
try {
auto guard = std::shared_lock{cmdmap_mutex_};
auto guard = std::shared_lock{cmdmap_mtx_};
if (!message_map_.empty()) { // don't bother if map is empty
// save the contents of the command map to an xml file
juce::XmlElement root{"settings"};
Expand Down Expand Up @@ -95,4 +105,96 @@ void CommandMap::ToXmlDocument(const juce::File& file) const
rsj::ExceptionResponse(typeid(this).name(), __func__, e);
throw;
}
}

void CommandMap::AddRowUnmapped(int midi_channel, int midi_data, rsj::MsgIdEnum msg_type)
{
auto guard = std::unique_lock{cmdmap_mtx_};
const rsj::MidiMessageId msg{midi_channel, midi_data, msg_type};
if (!MessageExistsInMap_(msg)) {
AddCommandforMessage_(0, msg); // add an entry for 'no command'
command_table_.push_back(msg);
Sort_();
}
}

void CommandMap::BuildFromXml(const juce::XmlElement* root)
{ // external use only, but mutex here causes deadlock. will use external versions of CommandMap
// calls to lock individual accesses, manually lock any internal calls
// CommandTableModel calls CommandMap from refreshComponentForCell and Sort_
try {
// auto guard = std::unique_lock{cmdmap_mtx_};
if (!root || root->getTagName().compare("settings") != 0)
return;
RemoveAllRows();
const auto* setting = root->getFirstChildElement();
while (setting) {
if (setting->hasAttribute("controller")) {
const rsj::MidiMessageId message{setting->getIntAttribute("channel"),
setting->getIntAttribute("controller"), rsj::MsgIdEnum::kCc};
AddRowMapped(setting->getStringAttribute("command_string").toStdString(), message);
}
else if (setting->hasAttribute("note")) {
const rsj::MidiMessageId note{setting->getIntAttribute("channel"),
setting->getIntAttribute("note"), rsj::MsgIdEnum::kNote};
AddRowMapped(setting->getStringAttribute("command_string").toStdString(), note);
}
else if (setting->hasAttribute("pitchbend")) {
const rsj::MidiMessageId pb{
setting->getIntAttribute("channel"), 0, rsj::MsgIdEnum::kPitchBend};
AddRowMapped(setting->getStringAttribute("command_string").toStdString(), pb);
}
setting = setting->getNextElement();
}
auto guard = std::unique_lock{cmdmap_mtx_};
Sort_();
}
catch (const std::exception& e) {
rsj::ExceptionResponse(typeid(this).name(), __func__, e);
throw;
}
}

void CommandMap::RemoveAllRows_()
{ // internal use
command_string_map_.clear();
command_table_.clear();
message_map_.clear();
}

void CommandMap::RemoveRow(size_t row)
{ // external callers only
auto guard = std::unique_lock{cmdmap_mtx_};
const auto msg = GetMessageForNumber_(row);
command_string_map_.erase(message_map_.at(msg));
command_table_.erase(command_table_.cbegin() + row);
message_map_.erase(msg);
}

void CommandMap::Sort_()
{ // always call within unique_lock. only call from tablemodel is sortOrderChanged callback
// use LRCommandList::getIndexOfCommand(string); to sort by command
const auto msg_idx = [this](rsj::MidiMessageId a) {
return command_set_.CommandTextIndex(GetCommandforMessage_(a));
};
const auto msg_sort = [&msg_idx](rsj::MidiMessageId a, rsj::MidiMessageId b) {
return msg_idx(a) < msg_idx(b);
};

if (current_sort_.first == 1)
if (current_sort_.second)
std::sort(command_table_.begin(), command_table_.end());
else
std::sort(command_table_.rbegin(), command_table_.rend());
else if (current_sort_.second)
std::sort(command_table_.begin(), command_table_.end(), msg_sort);
else
std::sort(command_table_.rbegin(), command_table_.rend(), msg_sort);
}

int CommandMap::GetRowForMessage(int midi_channel, int midi_data, rsj::MsgIdEnum msg_type) const
{
const rsj::MidiMessageId msg_id{midi_channel, midi_data, msg_type};
return gsl::narrow_cast<int>(
std::find(command_table_.begin(), command_table_.end(), msg_id) - command_table_.begin());
}
Loading

0 comments on commit 52d5b64

Please sign in to comment.