Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Insert project marker under mouse or play cursor v1.0 #1309

Closed
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
39 changes: 39 additions & 0 deletions Markers/az_Insert project marker under mouse or play cursor.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-- @description Insert project marker under mouse or play cursor
-- @author AZ
-- @version 1.0
-- @provides [main=main,midi_editor] .
-- @link Forum thread https://forum.cockos.com/showthread.php?t=288069
-- @donation Donate via PayPal https://www.paypal.me/AZsound
-- @about
-- SWS is required
--
-- This script brings usability of project markers closer to the take markers.
--
-- If mouse placed in arrange - use mouse position for marker, else use edit or play cursor position.

function ins_proj_marker()
window, segment, details = reaper.BR_GetMouseCursorContext()

if window == "arrange" or window == "midi_editor" then
pos = reaper.BR_GetMouseCursorContext_Position()

if window == "midi_editor" then
if segment == "unknown"or segment == "notes"or segment == "cc_lane" then
reaper.AddProjectMarker2( 0, false, pos, 0, "", -1, 0 )
else
reaper.Main_OnCommandEx( reaper.NamedCommandLookup( "_S&M_INS_MARKER_PLAY" ), 0, 0 )
end
else
reaper.AddProjectMarker2( 0, false, pos, 0, "", -1, 0 )
end
else
reaper.Main_OnCommandEx( reaper.NamedCommandLookup( "_S&M_INS_MARKER_PLAY" ), 0, 0 )
end

end



reaper.Undo_BeginBlock2( 0 )
ins_proj_marker()
reaper.Undo_EndBlock2( 0, "Insert project marker", -1 )
Loading