Skip to content

Commit

Permalink
Forgot to check dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTalagan committed Nov 25, 2024
1 parent 29c5c1e commit 9c4e989
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions View/talagan_Docking tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
These actions are meant to be small bricks of bigger custom actions where you perform a reorganisation of the UI (e.g. use FTC's scrolling scripts for the MIDI editor).
You can copy / paste the "... (500).lua" action files and modify their name to put a custom height instead of 500.
Thanks to @edgemeal for the technical advice and windows support !
--]]
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?

local docking_lib = require "talagan_Docking tools/docking_lib"

if not docking_lib.CheckDependencies() then return end

docking_lib.maximizeBottommostDock()
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?

local docking_lib = require "talagan_Docking tools/docking_lib"

if not docking_lib.CheckDependencies() then return end

docking_lib.maximizeMidiDock()
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?

local docking_lib = require "talagan_Docking tools/docking_lib"

if not docking_lib.CheckDependencies() then return end

docking_lib.minimizeBottommostDock()
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?

local docking_lib = require "talagan_Docking tools/docking_lib"

if not docking_lib.CheckDependencies() then return end

docking_lib.minimizeMidiDock()
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?

local docking_lib = require "talagan_Docking tools/docking_lib"

if not docking_lib.CheckDependencies() then return end

local _, sfname = reaper.get_action_context()
local param = tonumber(sfname.match(sfname,"%((.*)%).lua"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .."?

local docking_lib = require "talagan_Docking tools/docking_lib"

if not docking_lib.CheckDependencies() then return end

local _, sfname = reaper.get_action_context()
local param = tonumber(sfname.match(sfname,"%((.*)%).lua"))
Expand Down
21 changes: 21 additions & 0 deletions View/talagan_Docking tools/docking_lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
-- @license MIT
-- @description This is part of Talagan Docking Tools

local function CheckReapack(func_name, api_name, search_string)
if not reaper.APIExists(func_name) then
local answer = reaper.MB( api_name .. " is required and you need to install it.\z
Right-click the entry in the next window and choose to install.",
api_name .. " not installed", 0 )
reaper.ReaPack_BrowsePackages( search_string )
return false
end
return true
end

local function CheckDependencies()
if not CheckReapack("JS_ReaScriptAPI_Version", "JS_ReaScriptAPI", "js_ReaScriptAPI") then return false end

return true
end


------------------------

DOCK_BOTTOM = 0
DOCK_FLOATING = 4

Expand Down Expand Up @@ -205,6 +225,7 @@ local function minimizeBottommostDock() resizeBottommostDock(0) end


return {
CheckDependencies=CheckDependencies,
setTimeout=setTimeout,

resizeMidiDock=resizeMidiDock,
Expand Down

0 comments on commit 9c4e989

Please sign in to comment.