Old 08-20-2018, 06:38 AM   #1
Tobbe
Human being with feelings
 
Tobbe's Avatar
 
Join Date: Sep 2009
Location: Northern Lights
Posts: 749
Default Hide/Show tracks by certain color?

Hi,

Is it possible to do an action that toggle tracks based on it's color (show/hide)?

I have all instruments setup om different color:

Drums: darkblue
Bass: green

and so on...
__________________
OS: Manjaro KDE Plasma, Reaper For Linux (64Bit) native linux-vst plugins, LSP-Plugins, TpL-Plugins, Harrison's AVA & VST Plugins. Behringer U-PHORIA UMC22.
Tobbe is offline   Reply With Quote
Old 08-20-2018, 11:21 AM   #2
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

I don't know of any action, but you could open the Track Manager, sort list by color column, hold left mouse button down and drag it over the TCP column for the color(s) you want to show/hide.
Edgemeal is offline   Reply With Quote
Old 08-20-2018, 10:50 PM   #3
Tobbe
Human being with feelings
 
Tobbe's Avatar
 
Join Date: Sep 2009
Location: Northern Lights
Posts: 749
Default

Quote:
Originally Posted by Edgemeal View Post
I don't know of any action, but you could open the Track Manager, sort list by color column, hold left mouse button down and drag it over the TCP column for the color(s) you want to show/hide.
Yes, I know that one. I wanna create a toolbar and push a button to only show drums or guitar or bass or...

I seen one using it but he uses folders, I dont.

I look futher, would be cool to hide and show by color.
__________________
OS: Manjaro KDE Plasma, Reaper For Linux (64Bit) native linux-vst plugins, LSP-Plugins, TpL-Plugins, Harrison's AVA & VST Plugins. Behringer U-PHORIA UMC22.
Tobbe is offline   Reply With Quote
Old 08-21-2018, 12:53 AM   #4
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by Tobbe View Post
I look futher, would be cool to hide and show by color.
This seems to work OK, should be easy enough to read/modify, example for tracks colored red,..

EDIT Added, reaper.UpdateArrange() , or media items don't hide/unhide!

Code:
-- Hide tracks colored Red

tracks = reaper.CountTracks(0)
if tracks > 0 then
	reaper.PreventUIRefresh(1)
	reaper.Undo_BeginBlock()    
	for i = 0, tracks - 1 do
		track = reaper.GetTrack(0, i)
		tr_col = reaper.GetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR')

		-- reaper.ShowConsoleMsg(tostring(tr_col).."\n") -- show track color values for debugging.
	
		if tr_col == 16777471 then -- track is red
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINTCP", 0)
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINMIXER", 0)
		end
	end
    reaper.UpdateArrange()
    reaper.TrackList_AdjustWindows(false)
    reaper.Undo_EndBlock('Hide tracks colored Red', -1)
    reaper.PreventUIRefresh(-1)
end
Code:
-- UnHide tracks colored Red

tracks = reaper.CountTracks(0)
if tracks > 0 then
	reaper.PreventUIRefresh(1)
	reaper.Undo_BeginBlock()    
	for i = 0, tracks - 1 do
		track = reaper.GetTrack(0, i)
		tr_col = reaper.GetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR')

		-- reaper.ShowConsoleMsg(tostring(tr_col).."\n") -- show track color values for debugging.
	
		if tr_col == 16777471 then -- track is red 
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINTCP", 1)
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINMIXER", 1)
		end
	end
    reaper.UpdateArrange()
    reaper.TrackList_AdjustWindows(false)
    reaper.Undo_EndBlock('UnHide tracks colored Red', -1)
    reaper.PreventUIRefresh(-1)
end

Last edited by Edgemeal; 08-21-2018 at 01:03 AM.
Edgemeal is offline   Reply With Quote
Old 08-21-2018, 02:58 AM   #5
Tobbe
Human being with feelings
 
Tobbe's Avatar
 
Join Date: Sep 2009
Location: Northern Lights
Posts: 749
Default

Quote:
Originally Posted by Edgemeal View Post
This seems to work OK, should be easy enough to read/modify, example for tracks colored red,..

EDIT Added, reaper.UpdateArrange() , or media items don't hide/unhide!

Code:
-- Hide tracks colored Red

tracks = reaper.CountTracks(0)
if tracks > 0 then
	reaper.PreventUIRefresh(1)
	reaper.Undo_BeginBlock()    
	for i = 0, tracks - 1 do
		track = reaper.GetTrack(0, i)
		tr_col = reaper.GetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR')

		-- reaper.ShowConsoleMsg(tostring(tr_col).."\n") -- show track color values for debugging.
	
		if tr_col == 16777471 then -- track is red
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINTCP", 0)
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINMIXER", 0)
		end
	end
    reaper.UpdateArrange()
    reaper.TrackList_AdjustWindows(false)
    reaper.Undo_EndBlock('Hide tracks colored Red', -1)
    reaper.PreventUIRefresh(-1)
end
Code:
-- UnHide tracks colored Red

tracks = reaper.CountTracks(0)
if tracks > 0 then
	reaper.PreventUIRefresh(1)
	reaper.Undo_BeginBlock()    
	for i = 0, tracks - 1 do
		track = reaper.GetTrack(0, i)
		tr_col = reaper.GetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR')

		-- reaper.ShowConsoleMsg(tostring(tr_col).."\n") -- show track color values for debugging.
	
		if tr_col == 16777471 then -- track is red 
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINTCP", 1)
			reaper.SetMediaTrackInfo_Value(track, "B_SHOWINMIXER", 1)
		end
	end
    reaper.UpdateArrange()
    reaper.TrackList_AdjustWindows(false)
    reaper.Undo_EndBlock('UnHide tracks colored Red', -1)
    reaper.PreventUIRefresh(-1)
end
Wow, thank you! I try that.
__________________
OS: Manjaro KDE Plasma, Reaper For Linux (64Bit) native linux-vst plugins, LSP-Plugins, TpL-Plugins, Harrison's AVA & VST Plugins. Behringer U-PHORIA UMC22.
Tobbe is offline   Reply With Quote
Old 08-21-2018, 08:28 AM   #6
Tobbe
Human being with feelings
 
Tobbe's Avatar
 
Join Date: Sep 2009
Location: Northern Lights
Posts: 749
Default

Is that lua scripts?
__________________
OS: Manjaro KDE Plasma, Reaper For Linux (64Bit) native linux-vst plugins, LSP-Plugins, TpL-Plugins, Harrison's AVA & VST Plugins. Behringer U-PHORIA UMC22.
Tobbe 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 11:48 AM.


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