Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Color Themes and Icon Sets

Reply
 
Thread Tools Display Modes
Old 12-13-2021, 11:14 AM   #1
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default WALTER: Is there a reason that the tcpindent doesn't apply to the tcp_bg.png image?

Is there a reason that the tcp indent doesn't apply to the tcp background image?

I'm doing some experimenting:


Track 1 and 5 are folders. Track 1 is not selected. Track 5 is selected.

Tracks 2, 3, and 4 sit inside track 1.

Tracks 6, 7, and 8 sit inside track 5.

The pink strip is the left-most side of my tcp_bg.png.
The orange strip is the left-most side of my tcp_bgsel.png.

The red square is my folder start image.
The green strip is my folder indent image.
The blue square is my folder end image.


So I have my folder indent value set to 11 pixels in rtconfig.


I can see that the controls on the tracks inside the folder are being shifted by 11 pixels. This is good.

But strips are not currently doing what I want.

This is what I want to achieve:




I noticed the Reaper 6.0 default theme uses the tcpidx_bg images (track index backgrounds) to draw the bulk of the background, and the tcp_bg images just draw an underline, with mostly transparent pixels to let the other background show through.

Now I did try doing this, but using the tcpidx really limits what I can then eventually do with the text inside it - the default Reaper 6.0 theme is happy to let the text slide all over the place. I don't want that for my theme, I want to lock the text in place. But when using the background image as the main background image, there are all sorts of problems with keeping the text in place and also keeping the background image drawing across the entire dimensions of the TCP.

In short - does anyone know how to do this??
Amberience is offline   Reply With Quote
Old 12-13-2021, 12:25 PM   #2
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,982
Default

This comes up a lot; you're not the first to fall for this misunderstanding. tcp_bg is the background of one entire TCP panel - everything, including the folder area. It is the container that fills the entirety of that area. This vastly pre-dates the use of transparency for custom colouring, you can read more about that HERE.

We use tcp_idxbg to do all kinds of hacks, because it has 3 unique properties:
  1. It has a _sel variant.
  2. It supports yellow and pink lines with WALTERable margin values.
  3. It is non-interactive for the user.
...so it can be used for all kinds of visual-only things that Reaper doesn't necessarily expect us to do. Reaper doesn't have coloured strips that represent folder hierarchy, so you need to cheat. I have provided the cheat for anyone modding the default 6 theme, see here.

tcp_idxbg won't affect your placement of text or other elements unless you've told it to, have you done that? Are you modding existing WALTER that might be doing that?
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-13-2021, 01:07 PM   #3
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

Hey WT, thanks for responding. Just to be clear, I'm only using colours here so I can see what is going on. I don't want to use colours in the final thing. Well... it might be nice, but let's walk before I try to stumble out of the pub at 4am looking for the nearest kebab shop.

Ahem.



I'm mostly writing WALTER from scratch, but also referencing the default 4.0 and default 6.0 themes. When I snatch some of your code from the default 6.0 theme, I start to go more in the direction that I was expecting.

Code:
; ----------TCP------------

set tcp.volume.fadermode 	[1]
set tcp.pan.fadermode 		[1]

; component sizes
	set tcp_mute_w									24
	set tcp_mute_h									23
	set tcp_solo_w									24
	set tcp_solo_h									23
	set tcp_recarm_w								24
	set tcp_recarm_h								23
	set tcp_recmon_w								23
	set tcp_recmon_h								23
	set tcp_label_w + 								[0 w 0] * [0 0 w] [0 0 0.33]
	set tcp_label_h									20
	set tcp_pan_w									76
	set tcp_pan_h									22
	
; indent calculation
set tcp_indent										22
set this_tcp_indent									* * 1.0 tcp_indent folderdepth{0}
set folder_sec										* 1.0 tcp_indent 1 \
													+ [0 0 20] * [0 0 1] *  maxfolderdepth{0} \
													+ [0 0 20] * [0 0 1] * tcp_indent folderdepth{0}

;draw component
set tcp.size 										[214 60]
set scale											1.0
set tcp.trackidx                 					+ + + [0 0 this_tcp_indent] [folder_sec 0 0 0 0 0 0 1] * scale [0 0 18 100] [-25 -25]
set tcp_idx_margin									- / h 2 * scale 18
set tcp.trackidx.margin        						+ + [this_tcp_indent] [0 tcp_idx_margin 0 tcp_idx_margin 0.5] folderstate<0 * scale [0 -6 0 6]



;set tcp.trackidx 			[21 7 20 20]
set tcp.mute				+ + + [36 13 tcp_mute_w tcp_mute_h] [0 -7] [8] [this_tcp_indent 0 0 0]
set tcp.solo				+ [tcp.mute{x} tcp.mute{y} tcp_solo_w tcp_solo_h] [tcp.mute{w}]
set tcp.recarm				+ [tcp.solo{x} tcp.solo{y} tcp_recarm_w tcp_recarm_h] [tcp.solo{w}]
set tcp.recmon				+ [tcp.recarm{x} tcp.recarm{y} tcp_recmon_w tcp_recmon_h] [tcp.recarm{w}]
set tcp.label				+ + [tcp.recmon{x} tcp.recmon{y} tcp_label_w tcp_label_h] [tcp.recmon{w}] [5]
set tcp.volume				+ + [tcp.mute{x} tcp.mute{y} 215 20] [-8 tcp.mute{h}] [3 -8]
set tcp.pan					+ + + + [tcp.volume{x} tcp.volume{y} tcp_pan_w tcp_pan_h] [tcp.volume{w} 0 0 0] * [10 tcp.volume{h}] [1 0.25]

front tcp.mute tcp.solo tcp.recarm tcp.recmon tcp.foldercomp tcp.env tcp.label  tcp.width.label  tcp.volume.label tcp.volume tcp.fx tcp.width tcp.phase tcp.meter tcp.folder tcp.io tcp.env tcp.fxbyp  tcp.recinput tcp.recmode tcp.pan.label tcp.pan tcp.fxin
I think I might have modified a few bits of your code to fit in here, but what I am seeing is close... but no cigarillo....



- I get rotated track numbers at all track sizes.
- The track numbers slide up and down accord to the track height.
- When a track is not a folder, the track number is shifted further to the left, which isn't what I want.




So obviously a bunch of this stuff is being caused by the folder_sec edge attachment.

Now if I do this:

Code:
set tcp.trackidx                 					+ + + [0 0 this_tcp_indent] [folder_sec 0 0 0 0 0 0 0] * scale [0 0 18 100] [-25 -25]
Then I get this:


Which is closer to what I want. But....

- I still have the issue with non-folder track numbers shifting to the left.
- Track numbers don't slide up and down with the track height anymore, which is nice.
- But most importantly, the tcpidx_bg images are not stretched to the bottom of the tcp area, which causes the unsightly blockiness.


FWIW: The pink and orange blocks are just temporary tcp_bg images, so I can see what is going on.

Last edited by Amberience; 12-13-2021 at 01:22 PM.
Amberience is offline   Reply With Quote
Old 12-13-2021, 02:54 PM   #4
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,982
Default

Its great that you're starting from scratch, truly. 100% the only way to learn. So stop air-dropping code from me, or anyone else. You're trying to do some very simple things here, so all the complication and difficulty is coming from crap you can't justify the existence of because you didn't write it. You're on the right path doing it all yourself, be strong.

Folder indenting is really very easy, see HERE.

To see what's going on with your track index, make a temporary tcp_idxbg that's just a full single block of colour. Write your own tcp.trackidx and remove tcp.trackidx.margin so you can see how the area relates to the text. If its taller than it is wide, the text rotates to be vertical. You don't have to deal with any more than that if you're just using it as a simple track number, rather than a source for hacking.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-13-2021, 02:56 PM   #5
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

So yeah, I've looked at a bunch of themes. I can't actually find one that fulfills all requirements at once:

- Show a clear squared off folder indentation without using the tcpindent and the folder_start, folder_indent, folder_end images.
- Use the trackidx background as the indent image.
- Fix the track index into a single position without it's text sliding around.
- Fix the track indext into a single position whilst still filling the entire track height with it's background image.

Maybe I'm being dumb, but it doesn't seem possible to me. All of the themes I could find do everything except the sliding track index text; which is a side effect of the edge attachment required to make sure the background image stretches across the TCP to make the seamless visual effect work.
Amberience is offline   Reply With Quote
Old 12-13-2021, 03:06 PM   #6
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,982
Default

That's totally do-able. You're probably looking at a bunch of themes that are all rehashing the same code that do it the same way.

...however...

Are you clear why you want to use tcp_idxbg as the indent image? This is a difficult hack. You're going to have to write it, you can't just copy it from elsewhere. You make a big area that stretches as you want it to so that the image does the thing you want, and then you sort-of do the opposite with tcp.trackidx.margin to put the track number text back somewhere sensible to disguise the hack.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-13-2021, 03:18 PM   #7
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

Quote:
Originally Posted by White Tie View Post
That's totally do-able. You're probably looking at a bunch of themes that are all rehashing the same code that do it the same way.

...however...

Are you clear why you want to use tcp_idxbg as the indent image? This is a difficult hack. You're going to have to write it, you can't just copy it from elsewhere. You make a big area that stretches as you want it to so that the image does the thing you want, and then you sort-of do the opposite with tcp.trackidx.margin to put the track number text back somewhere sensible to disguise the hack.
Yes, I think I understand why I would want to use tcp_idx.

I want to use it so that I can obscure the tcp_bg, in order to draw those nice square darker sections around the left-edge of folder tracks. Just like the Default 6.0 theme, which is why I went straight to it's rtconfig for some code to prototype with.

I'll scrap the 4 lines I copied over and start completely from scratch with some solid colour blocks.

I get what the idxbg hack is all about. What I'm not yet understanding is how to lock the track idx text into a spot on the TCP, whilst also using the edge attachment to extend the image the full height of the TCP.
Amberience is offline   Reply With Quote
Old 12-13-2021, 04:15 PM   #8
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,982
Default

Try not to think of it as 'locking' the text to a spot. Do everything you need to do with the image, watch as it screws up the text, and then use tcp.trackidx.margin to put the text back.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-13-2021, 05:10 PM   #9
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

huh... okay.... I'm figuring some stuff out...



That rotating text is breaking my brain right now. But doing the indent calculation actually was easy once I did as you said and stopped thinking about it as being a case of fixing the text in place.
Amberience is offline   Reply With Quote
Old 12-14-2021, 02:58 PM   #10
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

Hey White Tie, would you mind helping me debug this maths?

Here's what I get:


The text stays anchored to the bottom right corner of the track, regardless of track height or width - which is almost what I want. I want the text to be on the right the way it is, but I want it up the top next to the mute switch.

Here's the relevant bit from my code:
Code:
; ----------TCP------------

set tcp.volume.fadermode 	[1]
set tcp.pan.fadermode 		[1]
; set tcp.size 										[300 100]

; component sizes
	set tcp_mute_w									24
	set tcp_mute_h									23
	set tcp_solo_w									24
	set tcp_solo_h									23
	set tcp_recarm_w								24
	set tcp_recarm_h								23
	set tcp_recmon_w								23
	set tcp_recmon_h								23
	set tcp_label_w + 								[0 w 0] * [0 0 w] [0 0 0.33]
	set tcp_label_h									20
	set tcp_pan_w									76
	set tcp_pan_h									22
	set tcp_fx_w									66
	set tcp_fx_h									20
	set tcp_fxbyp_w									17
	set tcp_fxbyp_h									20
	
;set tcp.trackidx.color								[0 0 0 255] [0 0 0 255]
	
set indent_value									11
set this_indent										* indent_value folderdepth{0}

;--------------- CODE TO CALCULATE INDENT -------------------------
set tcp.size 										[300 100]
set tcp_stock_heights 								[4 25 50 64]

define_parameter ind_add 'idx parameter' 2 1 7

set tcp_indent 						ind_add<=1 0 \
									ind_add==2 11 \
									ind_add==3 22 \
									ind_add==4 33 \
									ind_add==5 44 \
									ind_add==6 55 \
									ind_add==7 66 \
									ind_add==8 77


set this_tcp_indent 				* tcp_indent{0} folderdepth{0}
set tcp.trackidx                 	+ + [0 0 this_tcp_indent] [0 0 0 0 0 0 0 1] * 1 [0 0 24 100]

;this gets me the same behaviour as default 6.0 theme
;numbers stay vertically aligned to the middle of the track
;which isn't really what I want
;I want the numbers to stay at the top of the track
;set tcp_idx_margin 					- / h 2 * 1 18
set tcp_idx_margin 					- * h 2 * 1 18
set height_invert					* h -1
set tcp.trackidx.margin			+ + [this_tcp_indent tcp_idx_margin 2 h 0.5] [-2]
Amberience is offline   Reply With Quote
Old 12-14-2021, 03:12 PM   #11
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

Holy guacomole. I did it.

I changed one line. This bit:

Code:
set tcp_idx_margin 					- * h 2 * 1 18
To this:

Code:
set tcp_idx_margin 					+ * h 0 18
Amberience is offline   Reply With Quote
Old 12-14-2021, 03:22 PM   #12
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,982
Default

Make a solid block of colour and set it as tcp_idxbg, so I can see where the text field is.

I don't understand this:
Code:
set tcp_idx_margin 					- * h 2 * 1 18
set tcp.trackidx.margin			+ + [this_tcp_indent tcp_idx_margin 2 h 0.5] [-2]
top margin is twice the panel height, minus one times eighteen? And then bottom margin is the panel height? That's all very odd.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-14-2021, 03:24 PM   #13
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,982
Default

Quote:
Originally Posted by Amberience View Post
Code:
set tcp_idx_margin 					+ * h 0 18
OK, you're not understanding polish notation (fair enough). That is panel height, multiplied by zero, plus 18. Which is 18.

Have another look at the PN section of the guide, or have a google about for someone who explains it better than me.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-14-2021, 03:27 PM   #14
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

Oh. I'm an idiot. It's just 30. No maths required on that line.

I get Polish notation, well... 4/10. What I wasn't understanding was how the default theme hacks around the auto vertical/horizontal flip stuff. I still don't think I totally get it now... but it's working!
Amberience is offline   Reply With Quote
Old 12-14-2021, 03:32 PM   #15
Amberience
Human being with feelings
 
Amberience's Avatar
 
Join Date: Oct 2006
Location: swing on the spiral of our divinity
Posts: 2,242
Default

For reference, here are the solid colours:



I got to that point yesterday. But I was trying to get the margin stuff to work without doing the auto-flip.
Amberience 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 08:31 AM.


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