Old 01-17-2022, 10:45 AM   #1
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 5,065
Default Change item colour when "frozen"?

Ahoy ReaScripters,
is there a way to auto-change the item colour if the item name contains the string "freeze"? Analog to SWS "Auto-color", but for items instead of tracks?

When the track height is too small it's impossible to perceive the little lock icons on frozen items, so what I'd love to have is a dedicated colour, e.g. white, if the script detects the appropriate string.
(Reason: today I've worked for hours until I realized that the overhead track wasn't the original but a previously frozen track which messed up the whole drum mix - due to a non-working room correction chain in the recent weeks. A unique item colour might have prevented that slip.)
Help a brother out, cheers!
__________________
Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x
"If I can hear well, then everything I do is right" (Allen Sides)
beingmf is offline   Reply With Quote
Old 01-17-2022, 01:12 PM   #2
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

This should work. It's lua code.

Code:
function main()
  if reaper.GetSelectedTrack2(0,0,false) then
    sel_track = reaper.GetSelectedTrack2(0,0,false)
    for i=0, reaper.CountTrackMediaItems(sel_track)-1 do
      sel_item = reaper.GetTrackMediaItem(sel_track, i)
      item_name = reaper.GetTakeName(reaper.GetActiveTake(sel_item))
      if string.find(item_name, 'freeze') ~= nil then
        yes = reaper.ColorToNative(0, 255, 204)
        reaper.SetMediaItemInfo_Value(sel_item, 'I_CUSTOMCOLOR', reaper.ColorToNative(0, 255, 204)|0x1000000)
      end
    end
  end
  reaper.defer(main)
end

main()
vitalker is offline   Reply With Quote
Old 01-17-2022, 11:47 PM   #3
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 5,065
Default

Ooooh, thanks so much! Will test it later.
And sorry for my delayed response, I never get notifications for my own threads.
__________________
Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x
"If I can hear well, then everything I do is right" (Allen Sides)
beingmf is offline   Reply With Quote
Old 01-18-2022, 01:27 AM   #4
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by beingmf View Post
Ooooh, thanks so much! Will test it later.
And sorry for my delayed response, I never get notifications for my own threads.
No one does. You can set notifications to send you an email.
vitalker is offline   Reply With Quote
Old 01-18-2022, 03:21 AM   #5
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 5,065
Default

The script works! Thanks soooo much, Vitalker, it's already pinned to a contextual toolbar!
__________________
Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x
"If I can hear well, then everything I do is right" (Allen Sides)
beingmf is offline   Reply With Quote
Old 01-18-2022, 03:38 AM   #6
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by beingmf View Post
The script works! Thanks soooo much, Vitalker, it's already pinned to a contextual toolbar!
You're welcome. You could also put it to startup actions, so no need to run it manually.
vitalker is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.