Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,26 @@ The resulting dll can be found in the `build/bin/Release` directory (Windows)
Note: If you are still building for Reaper x86 32bit specify -A x86 as target architecture above.

### How to build on OSX
#### Intel x86 based Mac
To build ReaKontrol, from a command prompt, change to the ReaKontrol checkout directory and run the following commands:
```
cd build
cmake ..
cmake --build . --config Release
```
The resulting dll can be found in the `build/lib` directory (OSX).
The resulting dylib can be found in the `build/lib` directory (OSX).

#### ARM based Mac
First, comment out 'set(CMAKE_OSX_ARCHITECTURES x86_64)' in 'CMakeLists.txt'. Then build as described above.

Both ARM and x86 binaries can reside in parallel and load depending on Rosetta settings by naming them like this:

```
ls ~/Library/Application\ Support/REAPER/UserPlugins

reaper_kontrol-x86_64.dylib
reaper_kontrol.dylib
```
### How to Install
If you have followed the build steps, you can attach the last command:
```
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ elseif(APPLE)
include(FetchContent)
FetchContent_Declare(WDL
GIT_REPOSITORY https://github.com/justinfrankel/WDL.git
GIT_TAG main
SOURCE_DIR "${CMAKE_SOURCE_DIR}/WDL"
)
FetchContent_MakeAvailable(WDL)
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ DWORD GetTickCount()
using namespace std;

const char KK_VST_PREFIX[] = "VSTi: Komplete Kontrol";
const char KK_VST3_PREFIX[] = "VST3i: Komplete Kontrol";
const char KK_VST3_PREFIX[] = "VST3i: Komplete Kontro"; // lazy cheat to make it the same length as VST2
const char KK_INSTANCE_PARAM_PREFIX[] = "NIKB";


const string getKkInstanceName(MediaTrack* track, bool stripPrefix) {
int fxCount = TrackFX_GetCount(track);
for (int fx = 0; fx < fxCount; ++fx) {
// Find the Komplete Kontrol FX.
char fxName[sizeof(KK_VST3_PREFIX)];
char fxName[sizeof(KK_VST_PREFIX)];
TrackFX_GetFXName(track, fx, fxName, sizeof(fxName));
if (strcmp(fxName, KK_VST_PREFIX) != 0 &&
strcmp(fxName, KK_VST3_PREFIX) != 0) {
Expand Down
15 changes: 13 additions & 2 deletions src/niMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ void loadActionList() {
s_filename += REAKONTROL_INI;
s_filename.push_back('\0');
pathname = &s_filename[0];
if (!file_exists(pathname)) {
WritePrivateProfileString("reakontrol_actions", "action_0_id", "40001", pathname); // Windows only. Mac OSX via Swell version of this
if (!WritePrivateProfileString("reakontrol_actions", "action_0_name", "Insert Default Track", pathname)) {
ostringstream s;
s << "Unable to write configuration file! Please read manual, subfolder must exist for the configuration file:"
<< endl << endl
<< s_filename;
ShowMessageBox(s.str().c_str(), "ReaKontrol", 0);
g_actionList.ID[0] = -1;
}
}
if (file_exists(pathname)) {
std::string s_keyName;
char* key;
Expand All @@ -170,14 +181,14 @@ void loadActionList() {
s_keyName = "action_" + std::to_string(i) + "_ID";
s_keyName.push_back('\0');
key = &s_keyName[0];
GetPrivateProfileString("reakontrol_actions", key, nullptr, &stringOut[0], stringOut_sz, pathname); // Windows only. Mac OSX via Swell version of this?
GetPrivateProfileString("reakontrol_actions", key, nullptr, &stringOut[0], stringOut_sz, pathname); // Windows only. Mac OSX via Swell version of this
if (stringOut[0] != '\0') {
g_actionList.ID[i] = NamedCommandLookup(&stringOut[0]);
if (g_actionList.ID[i]) {
s_keyName = "action_" + std::to_string(i) + "_name";
s_keyName.push_back('\0');
key = &s_keyName[0];
GetPrivateProfileString("reakontrol_actions", key, nullptr, &stringOut[0], stringOut_sz, pathname); // Windows only. Mac OSX via Swell version of this?
GetPrivateProfileString("reakontrol_actions", key, nullptr, &stringOut[0], stringOut_sz, pathname); // Windows only. Mac OSX via Swell version of this
if (stringOut[0] != '\0') {
strcpy_s(&g_actionList.name[i][0], A_NAME_MAX, &stringOut[0]);
}
Expand Down