Skip to content

Commit

Permalink
fix permissions, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrc committed Jan 26, 2025
1 parent ab3c3e8 commit 28d27c4
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 46 deletions.
Empty file modified LICENSE
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion Scripts/install-reaper-keys.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- @description reaper-keys: map keystroke combinations to actions like in vim
-- @version 2.0.0-a8
-- @version 2.0.0-a9
-- @author gwatcha
-- @links
-- GitHub repository https://github.com/gwatcha/reaper-keys
Expand Down
3 changes: 1 addition & 2 deletions internal/custom_actions/custom_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ function actions.innerItem()
for i = #item_positions, 1, -1 do
local item = item_positions[i]
if item.left <= current_position and item.right >= current_position then
reaper.GetSet_LoopTimeRange(true, false, item.left, item.right, false)
break
return reaper.GetSet_LoopTimeRange(true, false, item.left, item.right, false)
end
end
end
Expand Down
42 changes: 0 additions & 42 deletions internal/custom_actions/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,48 +86,6 @@ function utils.getBigItemPositionsOnSelectedTracks()
return big_item_positions
end

function utils.getMatchedTrack(search_name, forward)
if not search_name then
return nil
end

local current_track = reaper.GetSelectedTrack(0, 0)
local start_i = 0
if current_track then
start_i = reaper.GetMediaTrackInfo_Value(current_track, "IP_TRACKNUMBER") - 1
end

local num_tracks = reaper.GetNumTracks()
local tracks_searched = 1
local next_track_i = start_i
while tracks_searched < num_tracks do
if forward == true then
next_track_i = next_track_i + 1
else
next_track_i = next_track_i - 1
end

local track = reaper.GetTrack(0, next_track_i)
if not track then
if forward == true then
next_track_i = -1
else
next_track_i = num_tracks
end
else
local _, current_name = reaper.GetTrackName(track, "")
local has_no_name = current_name:match("Track ([0-9]+)", 1)
current_name = current_name:lower()
tracks_searched = tracks_searched + 1
if not has_no_name and current_name:match(search_name:lower()) then
return track
end
end
end

return nil
end

function utils.getTrackPosition()
local track = reaper.GetLastTouchedTrack()
if not track then return 0 end
Expand Down
42 changes: 41 additions & 1 deletion internal/library/library.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
local state_interface = require('state_machine.state_interface')
local getMatchedTrack = require('custom_actions.utils').getMatchedTrack
local reaper_state = require('utils.reaper_state')
local feedback = require('gui.feedback.controller')

local function getMatchedTrack(search_name, forward)
if not search_name then return nil end

local current_track = reaper.GetSelectedTrack(0, 0)
local start_i = 0
if current_track then
start_i = reaper.GetMediaTrackInfo_Value(current_track, "IP_TRACKNUMBER") - 1
end

local num_tracks = reaper.GetNumTracks()
local tracks_searched = 1
local next_track_i = start_i
while tracks_searched < num_tracks do
if forward == true then
next_track_i = next_track_i + 1
else
next_track_i = next_track_i - 1
end

local track = reaper.GetTrack(0, next_track_i)
if not track then
if forward == true then
next_track_i = -1
else
next_track_i = num_tracks
end
else
local _, current_name = reaper.GetTrackName(track, "")
local has_no_name = current_name:match("Track ([0-9]+)", 1)
current_name = current_name:lower()
tracks_searched = tracks_searched + 1
if not has_no_name and current_name:match(search_name:lower()) then
return track
end
end
end

return nil
end


local library = {
marks = require('library.marks'),
state = require('library.state')
Expand Down
Empty file modified internal/rk.lua
100755 → 100644
Empty file.
Empty file modified internal/state_machine/state_interface.lua
100755 → 100644
Empty file.

0 comments on commit 28d27c4

Please sign in to comment.