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

Reply
 
Thread Tools Display Modes
Old 12-10-2019, 06:39 PM   #1
synkrotron
Human being with feelings
 
synkrotron's Avatar
 
Join Date: May 2015
Location: Warrington, UK
Posts: 1,068
Default [SOLVED] Cannot understand why Track ID text flips into vertical in TCP

I'm really sorry about this.

I am at a total loss here...

I have read right through WT's WALTER Themer's Guide as well as all the other SDK stuff. It was fun working through the examples and understanding, for the most part, how WALTER works. I have still to get my head around some of the more advanced stuff but I thought I had learned enough to make a start on my own theme.

I have an almost empty rtconfig.txt file. All it contains is the "Global" parameters from the R6 default theme and then just six lines of WALTER defining the tcp.size ane then all the trackidx stuff.

I have had a play and ever so slightly altered some of the PNG files.

No rocket science yet... Not a button placed, although I should have done for the amount of time I've been scratching my head wondering what I've done wrong.


Thing is, once a track in the TCP is dragged over a certain height its ID text flips from the horizontal into the vertical.


This is all of the code in the rtconfig up to now:-

Code:
#>----------------------------------- GLOBALS -----------------------------------------
version 6.0
use_pngs 1
tcp_showborders 0
mcp_showborders 0
transport_showborders 0
tcp_vupeakwidth 2
mcp_vupeakheight 2
mcp_mastervupeakheight 4
mcp_altmeterpos 0
use_overlays 0
tcp_vol_zeroline FF666666
tcp_pan_zeroline 66000000
mcp_vol_zeroline FF666666
mcp_pan_zeroline 85000000
trans_speed_zeroline 85000000
gen_vol_zeroline FF000000
gen_pan_zeroline FF000000
item_volknobfg 85000000 FF778485 00474F4F
mcp_min_height 240
tcp_master_minheight 56
mcp_voltext_flags 5 5
tcp_voltext_flags 12
tinttcp 298
peaksedges 0
no_meter_reclbl 1
tcp_heights 4 25 50 64   ; supercollapsed, collapsed, small(norecarm), recarm size
tcp_h 70
tcp_folderindent 0
envcp_min_height 27
misc_dpi_translate 134 150
misc_dpi_translate 174 200

; ----------------- WALTER -------------------

; font #1/6/11 - calibri 8
; font #2/7/12 - calibri 9
; font #3/8/13 - calibri 10
; font #4/9/14 - calibri 11


clear tcp.*

set tcp.size		[260 tcp_h 150 25]
set tcp.trackidx	[0 0 21 tcp_h 0 0 0 1]
set tcp.trackidx.color	[255 255 255]
set tcp.trackidx.font	[2]
set tcp.trackidx.margin	[0 0 0 0 0.5]
And here is a picture showing how the track looks:-



Track 1 is minimised to smallest height and the ID text is drawn horizontally as expected.

The ID text in track 2 is still horizontal but track 3 is just a few pixels taller than track 2 and its ID text is now drawn vertical.

If I switch to either of the R5 or R6 default themes text ID numbers are drawn horizontal regardless of TCP track height.

I have checked my REAPER preferences and I can't find anything there.

I have opened the .ReaperTheme file in notepad and I can't see anything in there.

I have tried a few of the different fonts available to WALTER.


I wouldn't mind betting that I have missed something real simple and I'll be kicking myself when I log back in in the morning.


Okay, I am keeping my fingers crossed that an experienced themer can help me out with this.


cheers

andy
__________________
Bandcamp // YouTube // SoundCloud

Last edited by synkrotron; 12-11-2019 at 06:38 AM.
synkrotron is online now   Reply With Quote
Old 12-11-2019, 02:28 AM   #2
synkrotron
Human being with feelings
 
synkrotron's Avatar
 
Join Date: May 2015
Location: Warrington, UK
Posts: 1,068
Default

Okay, I have now sussed out at which point the text flips orientation:-

with trackidx at 43px and below the text is drawn horizontal

At 44px and above the text is drawn vertical

My trackidx is based on the R6 default theme, on the left of the track pane. So I need to dig down into its code to see what I am missing.

From the drawTcp macro there are two lines of code for tcp.trackidx:-

set tcp.trackidx + + [0 0 this_tcp_indent] [folder_sec 0 0 0 0 0 0 1]
set tcp.trackidx ?supercollapsed{0} + tcp.trackidx * scale [0 0 0 40]


I understand that the first line of code is executed first, followed by the second.

I can probably ignore the second line for now as I am not looking into tracks that are "supercollapsed"

So I will have a look at that first line, expanding on its defined variables, and come back...


I'm back.

In that first line of code there are two variables;

this_tcp_indent which is set as follows:-

set this_tcp_indent * * scale tcp_indent{0} folderdepth{0}

folder_sec which is set as follows:-

set folder_sec * scale ?tcp_control_align{0} + [0 0 20] * [0 0 1] * tcp_indent{0} maxfolderdepth{0} + [0 0 20] * [0 0 1] * tcp_indent{0} folderdepth{0}


At this point I think I can simplify the above code by removing all instances of "scale" because I am not interested in having scaled layouts.


Right... off for another think...
__________________
Bandcamp // YouTube // SoundCloud

Last edited by synkrotron; 12-11-2019 at 02:45 AM.
synkrotron is online now   Reply With Quote
Old 12-11-2019, 03:57 AM   #3
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 2,783
Default

Reaper automatically flips the orientation of text if the containing volume is taller than it is wide. Its more like herding a sheep than riding it like a horse If its proving difficult to visualise an area, I often find it enlightening to temporarily set a really obnoxious image as its background, so you can really see what's going on as you work things out. Here are my favourite obnoxious images for that task, should you find them useful:





Just to pick up a couple of points:

This isn't a useful way to think of it : "the first line of code is executed first, followed by the second." because, in this case, the value is set in the first line, and then is overridden in the second line if ?supercollapsed{0} is true. Otherwise the second line does nothing, since it has no second term to that condition.

Something that is useful, for an overview clarity of thinking when modding a completed theme, to load up a nuked blank theme. No WALTER, no images whatsoever. You see what you see there? That is REAPER, with its clothes off. That is Reaper, and that is always there, behind the theme. Everything we do is an adjustment of that.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-11-2019, 05:04 AM   #4
synkrotron
Human being with feelings
 
synkrotron's Avatar
 
Join Date: May 2015
Location: Warrington, UK
Posts: 1,068
Default

Hi White Tie

Thank you for taking time to reply here, I know you are a busy man and the last thing you need to be doing is trying to get old and knackered "ex-coders" back in to the swing of things.

On the "ex-coders" thing... I use AutoCAD in my day job (when I have one) and I used to be quite good at AutoLISP, which is a variation of LISP. You would think, therefore, that I would take to WALTER like a duck to water.

It just isn't happening, though, and I can only assume that as I enter my dotage I am finding it harder to pick up new stuff like this.

In fact, over the last couple of years I had a need to create some small macros for AutoCAD using AutoLISP and I struggled. I looked back over some older code I created and thought, "did I do that!?"

Quote:
Originally Posted by White Tie View Post
Reaper automatically flips the orientation of text if the containing volume is taller than it is wide.
Oh dear.

Quote:
If its proving difficult to visualise an area, I often find it enlightening to temporarily set a really obnoxious image as its background, so you can really see what's going on as you work things out. Here are my favourite obnoxious images for that task, should you find them useful:
Thanks for the images

I renamed my tcp_idxbg.png to tcp_idxbgXXX.png and then renamed one of your ugly images to tcp_idxbg.png

So now I can see this:-



I left the "selected" version of the idx png as is so that I can see how that looks on a selected track and therefore compare the two (ugly vs nice):-




The thing that is now confusing me the most is that both the default REAPER 5 theme and the default REAPER 6 theme utilise an image that needs to be stretched right across a track pane. As soon as you do this then at some point the containing volume is going to be taller than it is wide, and therefore flips, except in R5 and R6 it doesn't.

Okay, time to have a look at R5:-



All looking good.

And R5 with the Ugly image:-



Ah, right... It appears that I am not understanding how the tcp.trackidx and tcp.trackidx.margin are working. I thought that the tcp_idxbg.png WAS the volume of the idx area but according to the last picture above it isn't.

Some how, the volume is set, but the tcp_idxbg.png is still stretched across the track pane.

Now let's do the same with R6.

Here is how it looks "out of the box":-



And this is how it looks using the Ugly image:-




Big question now is, how, in REAPER V6 default theme, is the idx text not vertical even though the volume in which it is contained is taller than it is wide?

I can only assume that there is some more code that I am missing or not understanding in the R6 rtconfig file.

Quote:
This isn't a useful way to think of it : "the first line of code is executed first, followed by the second." because, in this case, the value is set in the first line, and then is overridden in the second line if ?supercollapsed{0} is true. Otherwise the second line does nothing, since it has no second term to that condition.
Okay, I understand that.

I was discounting that second line because of the implied IF statement. I didn't word my understanding of that in my previous post very well.

Quote:
Something that is useful, for an overview clarity of thinking when modding a completed theme, to load up a nuked blank theme. No WALTER, no images whatsoever. You see what you see there? That is REAPER, with its clothes off. That is Reaper, and that is always there, behind the theme. Everything we do is an adjustment of that.
Yes, that is what I have been doing. I started out with a completely blank rtconfig.txt file.

I had to put in that first block of code, the "Globals" because first of all the PNG images were not being picked up. Even setting the use_pngs flag to 1 didn't work for some reason and I had to put the reaper version line in. I realise that a lot of that initial code isn't needed for what I am doing right now, but I thought it was a good starting point.


Right! Back to it then, and thanks again for your help WT. If you get a chance to explain the R6 conundrum above that would be great but no pressure... I will spend some more time dissecting that R6 code around the tcp idx statements.

cheers

andy
__________________
Bandcamp // YouTube // SoundCloud
synkrotron is online now   Reply With Quote
Old 12-11-2019, 05:25 AM   #5
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 2,783
Default

Okay, final piece of the puzzle is the margins. Most of the time they'll just be used to keep a text away from the edges of its enclosure but, for example, really big top and/or bottom margins can be used to make a tall thin enclosure (because I want the idx background image that shape) have text behave as if it weren't tall at all. So the text doesn't flip.

You're starting out by editing some very complicated WALTER, because its me trying to whip, brutalise and bully the theme engine into doing things it was never originally intended for. Don't feel disheartened if its tough going at times

We do a great deal of egregious hacking in themes using idx_bg, more so than any other element, because it is the only element that has all three of these very useful attributes : it has a selected state, it makes full use of pink&yellow lines, and it is completely non-interactive. So if you see any kind of fancy visual-only, selection state changing trickery going on in a theme, you'll likely find that all the clever stuff is being done on idx_bg.

Quote:
Originally Posted by synkrotron View Post
I started out with a completely blank rtconfig.txt file.
Wow, man, I can't tell you how pleased I am to hear that. Its my absolute #1 tip and I find it so disappointing when I see people struggling and they haven't tried that enormously enlightening exercise, if only for a bit.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 12-11-2019, 07:12 AM   #6
synkrotron
Human being with feelings
 
synkrotron's Avatar
 
Join Date: May 2015
Location: Warrington, UK
Posts: 1,068
Default

Quote:
Originally Posted by White Tie View Post
Okay, final piece of the puzzle is the margins. Most of the time they'll just be used to keep a text away from the edges of its enclosure but, for example, really big top and/or bottom margins can be used to make a tall thin enclosure (because I want the idx background image that shape) have text behave as if it weren't tall at all. So the text doesn't flip.
Ah ha!

That was indeed the final piece

I started out increasing the top and bottom margins by single pixels, which started to crop the text after a short time.

I tried using;

front tcp.trackidx

thinking it would pull the text forward of that "cropping," but it didn't work.

I then started increasing the top and bottom margins by tens of pixels and it was interesting watching the text get cropped at different track heights.

By the time I got to a top/bottom margin of 460 the cropping behaviour stopped even with the track height extended to the full height of the arrange window.

So, that's it, job done... One to the next problem haha!

Quote:
You're starting out by editing some very complicated WALTER, because its me trying to whip, brutalise and bully the theme engine into doing things it was never originally intended for. Don't feel disheartened if its tough going at times
Yeah, it was a bit of a tough one last night. I had been pouring over all the different help documents, online and offline, examining existing "complex" code and I was lost.

It got to about 2 am here and I decided to make my second post in this topic and for some reason my internet went down about 90% the way through. I had hit Preview Post and it seems all my rambling was lost. Fortunately I hit the back button and it took me back to my post, which I quickly copied and pasted into a session of notepad.

Then about ten minutes later the internet came back on and I was able to finish my post and get to bed.

I think I had about four hours sleep, if that, and I was back at it again.

Coding can be a bit of a mad addiction at times!

Quote:
We do a great deal of egregious hacking in themes using idx_bg, more so than any other element, because it is the only element that has all three of these very useful attributes : it has a selected state, it makes full use of pink&yellow lines, and it is completely non-interactive. So if you see any kind of fancy visual-only, selection state changing trickery going on in a theme, you'll likely find that all the clever stuff is being done on idx_bg.
Right... A bit to take in there.

Especially the yellow lines thing.

I had read your Power of Pink document but the use of yellow lines along with the pink wasn't sinking in. I need to go back over that...

Quote:
Wow, man, I can't tell you how pleased I am to hear that. Its my absolute #1 tip and I find it so disappointing when I see people struggling and they haven't tried that enormously enlightening exercise, if only for a bit.
Well, I got fed up with faffing with stuff I didn't understand.

It's not like I will become a proper "Themer" because I doubt very much if I will come up with anything worthwhile sharing, so all this effort may well be over the top. But I get sucked into this kind of thing. This isn't the first time...



Cheers, and thanks yet again for your help with this. I really appreciate it.

andy
__________________
Bandcamp // YouTube // SoundCloud
synkrotron is online now   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:32 AM.


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