diff --git a/CHANGELOG.md b/CHANGELOG.md index 4272577..70dfacf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added option to disable the 'window may be covered' warning - Added Kontakt 8 support -- Added Kontakt instrument switching +- Added Kontakt instrument and multi switching ### Changed diff --git a/Includes/Overlays/Kontakt7.ahk b/Includes/Overlays/Kontakt7.ahk index 73bce31..672a0e2 100644 --- a/Includes/Overlays/Kontakt7.ahk +++ b/Includes/Overlays/Kontakt7.ahk @@ -16,6 +16,8 @@ Class Kontakt7 { PluginHeader.AddCustomButton("SHOP (Opens in default web browser)",,, Kontakt7.ActivatePluginHeaderButton).SetHotkey("!S", "Alt+S") PluginHeader.AddCustomButton("Previous instrument", Kontakt7.MoveToPluginInstrumentButton,,, Kontakt7.ActivatePluginInstrumentButton).SetHotkey("^P", "Ctrl+P") PluginHeader.AddCustomButton("Next instrument", Kontakt7.MoveToPluginInstrumentButton,,, Kontakt7.ActivatePluginInstrumentButton).SetHotkey("^N", "Ctrl+N") + PluginHeader.AddCustomButton("Previous multi", Kontakt7.MoveToPluginMultiButton,,, Kontakt7.ActivatePluginMultiButton).SetHotkey("^+P", "Ctrl+Shift+P") + PluginHeader.AddCustomButton("Next multi", Kontakt7.MoveToPluginMultiButton,,, Kontakt7.ActivatePluginMultiButton).SetHotkey("^+N", "Ctrl+Shift+N") PluginHeader.AddCustomButton("Snapshot menu", Kontakt7.MoveToPluginSnapshotButton,,, Kontakt7.ActivatePluginSnapshotButton).SetHotkey("!M", "Alt+M") PluginHeader.AddCustomButton("Previous snapshot", Kontakt7.MoveToPluginSnapshotButton,,, Kontakt7.ActivatePluginSnapshotButton).SetHotkey("!P", "Alt+P") PluginHeader.AddCustomButton("Next snapshot", Kontakt7.MoveToPluginSnapshotButton,,, Kontakt7.ActivatePluginSnapshotButton).SetHotkey("!N", "Alt+N") @@ -224,6 +226,34 @@ Class Kontakt7 { } } + Class ActivatePluginMultiButton { + Static Call(MultiButton) { + Critical + UIAElement := GetUIAElement("15,1,5") + If Not UIAElement = False And UIAElement.Name = "SHOP" { + Try + ControlGetPos &ControlX, &ControlY, &ControlWidth, &ControlHeight, ReaHotkey.GetPluginControl(), "A" + Catch + Return + Kontakt7.MoveToPluginMultiButton("Previous multi") + If CheckColor() { + Kontakt7.MoveToPluginMultiButton(MultiButton) + Click + Return + } + } + AccessibilityOverlay.Speak("Multi switching unavailable. Make sure that a multi is loaded and that you're in rack view.") + CheckColor() { + MouseGetPos &mouseXPosition, &mouseYPosition + Sleep 10 + FoundColor := PixelGetColor(MouseXPosition, MouseYPosition, "Slow") + If FoundColor = "0x323232" + Return True + Return False + } + } + } + Class ActivatePluginSnapshotButton { Static Call(SnapshotButton) { Critical @@ -312,6 +342,25 @@ Class Kontakt7 { } } + Class MoveToPluginMultiButton { + Static Call(MultiButton) { + Label := MultiButton + If MultiButton Is Object + Label := MultiButton.Label + UIAElement := GetUIAElement("15,1,5") + If Not UIAElement = False And UIAElement.Name = "SHOP" { + Try + ControlGetPos &ControlX, &ControlY, &ControlWidth, &ControlHeight, ReaHotkey.GetPluginControl(), "A" + Catch + Return + If Label = "Previous multi" + MouseMove ControlX + 712, ControlY + 104 + Else + MouseMove ControlX + 730, ControlY + 104 + } + } + } + Class MoveToPluginSnapshotButton { Static Call(SnapshotButton) { If SnapshotButton Is Object And InStr(SnapshotButton.Label, "Snapshot", True) diff --git a/Includes/Overlays/Kontakt8.ahk b/Includes/Overlays/Kontakt8.ahk index 34e5706..a694705 100644 --- a/Includes/Overlays/Kontakt8.ahk +++ b/Includes/Overlays/Kontakt8.ahk @@ -16,6 +16,8 @@ Class Kontakt8 { PluginHeader.AddCustomButton("SHOP (Opens in default web browser)",,, Kontakt8.ActivatePluginHeaderButton).SetHotkey("!S", "Alt+S") PluginHeader.AddCustomButton("Previous instrument", Kontakt8.MoveToPluginInstrumentButton,,, Kontakt8.ActivatePluginInstrumentButton).SetHotkey("^P", "Ctrl+P") PluginHeader.AddCustomButton("Next instrument", Kontakt8.MoveToPluginInstrumentButton,,, Kontakt8.ActivatePluginInstrumentButton).SetHotkey("^N", "Ctrl+N") + PluginHeader.AddCustomButton("Previous multi", Kontakt8.MoveToPluginMultiButton,,, Kontakt8.ActivatePluginMultiButton).SetHotkey("^+P", "Ctrl+Shift+P") + PluginHeader.AddCustomButton("Next multi", Kontakt8.MoveToPluginMultiButton,,, Kontakt8.ActivatePluginMultiButton).SetHotkey("^+N", "Ctrl+Shift+N") PluginHeader.AddCustomButton("Snapshot menu", Kontakt8.MoveToPluginSnapshotButton,,, Kontakt8.ActivatePluginSnapshotButton).SetHotkey("!M", "Alt+M") PluginHeader.AddCustomButton("Previous snapshot", Kontakt8.MoveToPluginSnapshotButton,,, Kontakt8.ActivatePluginSnapshotButton).SetHotkey("!P", "Alt+P") PluginHeader.AddCustomButton("Next snapshot", Kontakt8.MoveToPluginSnapshotButton,,, Kontakt8.ActivatePluginSnapshotButton).SetHotkey("!N", "Alt+N") @@ -224,6 +226,34 @@ Class Kontakt8 { } } + Class ActivatePluginMultiButton { + Static Call(MultiButton) { + Critical + UIAElement := GetUIAElement("15,1,5") + If Not UIAElement = False And UIAElement.Name = "SHOP" { + Try + ControlGetPos &ControlX, &ControlY, &ControlWidth, &ControlHeight, ReaHotkey.GetPluginControl(), "A" + Catch + Return + Kontakt8.MoveToPluginMultiButton("Previous multi") + If CheckColor() { + Kontakt8.MoveToPluginMultiButton(MultiButton) + Click + Return + } + } + AccessibilityOverlay.Speak("Multi switching unavailable. Make sure that a multi is loaded and that you're in classic view.") + CheckColor() { + MouseGetPos &mouseXPosition, &mouseYPosition + Sleep 10 + FoundColor := PixelGetColor(MouseXPosition, MouseYPosition, "Slow") + If FoundColor = "0x323232" + Return True + Return False + } + } + } + Class ActivatePluginSnapshotButton { Static Call(SnapshotButton) { Critical @@ -312,6 +342,25 @@ Class Kontakt8 { } } + Class MoveToPluginMultiButton { + Static Call(MultiButton) { + Label := MultiButton + If MultiButton Is Object + Label := MultiButton.Label + UIAElement := GetUIAElement("15,1,5") + If Not UIAElement = False And UIAElement.Name = "SHOP" { + Try + ControlGetPos &ControlX, &ControlY, &ControlWidth, &ControlHeight, ReaHotkey.GetPluginControl(), "A" + Catch + Return + If Label = "Previous multi" + MouseMove ControlX + 730, ControlY + 104 + Else + MouseMove ControlX + 750, ControlY + 104 + } + } + } + Class MoveToPluginSnapshotButton { Static Call(SnapshotButton) { If SnapshotButton Is Object And InStr(SnapshotButton.Label, "Snapshot", True) diff --git a/README.md b/README.md index 72d67d1..2ec9a2f 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,7 @@ Our changelog can be found [in our dedicated changelog file](https://github.com/ - Works both inside REAPER and in the standalone version of Komplete Kontrol. * Makes it possible to interact with Kontakt menus. - Works both inside REAPER and in the standalone version of Kontakt, Full and Player. Note that Kontakt version 7.10 or higher is required. -* Makes it possible to switch Between instruments/NKIs in Kontakt. - - Only works inside REAPER. -* Makes it possible to select and cycle through snapshots in Kontakt. +* Makes it possible to switch Between instruments, multis and snapshots in Kontakt. - Only works inside REAPER. * Provides support for the 'Browse' button in the Kontakt Content Missing dialog. - Works both inside REAPER and in the standalone version of Kontakt. This feature may not work with Komplete Kontrol.