Skip to content

Commit a6188c3

Browse files
committed
feat: make enter visual timeline mode not clear selection,
add new binding <M-v> which does old behaviour of clearing timeline selection
1 parent c928c90 commit a6188c3

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

definitions/defaults/actions.lua

+2
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ return {
431431
SetModeNormal = lib.state.setModeNormal,
432432
PasteItemFxChain = {"_S&M_COPYFXCHAIN9", prefixRepetitionCount=true},
433433
SetModeVisualTimeline = lib.state.setModeVisualTimeline,
434+
ClearSelectedTimeline = custom.clearSelectedTimeline,
435+
ClearTimelineSelectionAndSetModeVisualTimeline = {"ClearSelectedTimeline", "SetModeVisualTimeline"},
434436
SetModeVisualTrack = lib.state.setModeVisualTrack,
435437
SetModeRecord = lib.state.setModeRecord,
436438
SetProjectTimebaseToBeatsPosLengthAndRate = "_SWS_AWTBASEBEATALL",

definitions/defaults/global.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ return {
3535
},
3636
timeline_selector = {
3737
["~"] = "MarkedRegion",
38-
["v"] = "TimeSelection",
3938
["!"] = "LoopSelection",
4039
["<S-right>"] = "NextRegion",
4140
["<S-left>"] = "PrevRegion",
@@ -76,6 +75,7 @@ return {
7675
["<C-z>"] = "ZoomUndo",
7776
["<C-Z>"] = "ZoomRedo",
7877
["v"] = "SetModeVisualTimeline",
78+
["<M-v>"] = "ClearTimelineSelectionAndSetModeVisualTimeline",
7979
["<C-SPC>"] = "ToggleViewMixer",
8080
["<ESC>"] = "Reset",
8181
["<return>"] = "StartStop",

definitions/defaults/main.lua

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ return {
2525
},
2626
track_selector = {
2727
["'"] = "MarkedTracks",
28-
["V"] = "Selection",
2928
["c"] = "FolderChildren",
3029
["F"] = "FolderParent",
3130
["F"] = "Folder",

internal/custom_actions/custom_actions.lua

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ function custom_actions.setMidiGridDivision()
3636
end
3737
end
3838

39+
function custom_actions.clearSelectedTimeline()
40+
local current_position = reaper.GetCursorPosition()
41+
reaper.GetSet_LoopTimeRange(true, false, current_position, current_position, false)
42+
end
43+
3944
function custom_actions.setGridDivision()
4045
local division = getUserGridDivisionInput()
4146
if division then

internal/library/state.lua

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local state_interface = require('state_machine.state_interface')
2+
local config = require('definitions.config')
23

34
local state = {}
45

@@ -19,10 +20,7 @@ function state.setModeVisualTrack()
1920
end
2021

2122
function state.setModeVisualTimeline()
22-
local current_position = reaper.GetCursorPosition()
23-
reaper.GetSet_LoopTimeRange(true, false, current_position, current_position, false)
2423
state_interface.setMode('visual_timeline')
25-
2624
if state_interface.getTimelineSelectionSide() == 'left' then
2725
state_interface.setTimelineSelectionSide('right')
2826
end

0 commit comments

Comments
 (0)