Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions Time Selection/colemize_Toggle repeat and color loop point.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- @description Toggle repeat and color loop point
-- @author Cole Mize
-- @version 1.0
-- @metapackage
-- @provides [main] colemize_Toggle repeat and color loop point/Change loop color yellow and toggle repeat.lua
-- @about
-- #Cole Mize
--
-- This script will toggle Repeat and color your Loop Point so that it's more obvious when Repeat is engaged.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
-- @noindex

--[[
Cole Mize Studios
REAPER Script: Toggle Repeat + Loop-Point Timeline Background
Created by: Cole Mize
Version: 1.0

Description:
Toggles REAPER's Repeat function and changes the loop-point
timeline background color based on the Repeat state.

Repeat ON = Yellow/Orange (255, 194, 30)
Repeat OFF = White (255, 255, 255)
--]]

local REPEAT_COMMAND = 1068

-- Toggle REAPER Repeat
reaper.Main_OnCommand(REPEAT_COMMAND, 0)

-- Get the NEW repeat state
local repeat_state = reaper.GetToggleCommandState(REPEAT_COMMAND)

local r, g, b

if repeat_state == 1 then
-- Repeat ON = Yellow/Orange
r = 255
g = 194
b = 30
else
-- Repeat OFF = White
r = 255
g = 255
b = 255
end

-- Convert RGB to REAPER native color
local color = reaper.ColorToNative(r, g, b)

-- Timeline background (in loop points)
reaper.SetThemeColor("col_tl_bgsel2", color, 0)

-- Refresh REAPER
reaper.UpdateArrange()
reaper.UpdateTimeline()