|
|
|
10-17-2022, 10:04 AM
|
#1
|
Human being with feelings
Join Date: Mar 2017
Location: in the moment
Posts: 632
|
Is there a way to have Transport Bar elements center in DAW screen?
Hi,
I work/tweak my homemade theme on a 1920x1080 laptop but actually use it on my studio DAW with a 2560 display. I have placed all my Transport Bar elements so they appear justified to the top left.
Is there a way to add some Walter code so that the group of elements is justified in the center no matter what size display the GUI is presented on?
Thank you.
Last edited by mister happy; 02-14-2023 at 02:11 PM.
|
|
|
10-17-2022, 06:43 PM
|
#2
|
Human being with feelings
Join Date: Mar 2017
Location: in the moment
Posts: 632
|
It looks like the Default 5.0 theme has something similar to the function I am hoping to implement.
I would like to treat all my top bar elements as one single "Section" and have it float in the horizontal center.
I'll try hacking some of the v5.0 default code to see what I can come up with.
|
|
|
10-18-2022, 03:37 AM
|
#3
|
Pixel Pusher
Join Date: Mar 2007
Location: Blighty
Posts: 4,950
|
Don't go poking around in the default themes for code tips, they are complicated to allow them to be easy to mod and do many different things for many different uses, which would be especially unhelpful in a situation like this where what you want is very simple.
Choice of two methods:
1) Some maths. You have the drawn width of the toolbar ('w') and you can add up the width of all your stuff. w minus stuff = the difference between the two. Add half that difference to the x position of any elements and they will be centred.
2) Using [. . . . 0.5 0 0.5 0] as an edge attachment. See WALTER : A themer's guide p16 and Appendix 1.
|
|
|
10-18-2022, 06:46 AM
|
#4
|
Human being with feelings
Join Date: Mar 2017
Location: in the moment
Posts: 632
|
Hi,
Thank you for the helpful info.
I appreciate all the documentation you have shared and have read the Themer's Guide over and over again, but script logic seems to befuddle me.
Thanks for the suggestions and also for pointing to a specific portion of the guide. Now that I have a specific goal and context to consider, it should be easier to learn the details.
I'd especially like to learn how to do option 1 as it seems like a good opportunity to learn this method. EDIT TO ADD: I assumed you meant that there was a method to have REAPER automatically compute the current width of a window and center the elements if the window width grew or shrank, but now I am beginning to think you were just advising that I cipher and use absolute coordinates to place the elements in the center.
For option 2, is there a way to group all my elements into a "Section" and then center it all at once? I got the "Section" idea by looking at the Default 5.0 config, but I do not know if it is applicable etc.?
Thank you!
Last edited by mister happy; 10-18-2022 at 11:15 AM.
|
|
|
10-19-2022, 09:01 AM
|
#5
|
Pixel Pusher
Join Date: Mar 2007
Location: Blighty
Posts: 4,950
|
Don't think in terms of you not knowing some arcane theming cleverness. Its just numbers. From the SDK:
Code:
w -- width of parent, pixels
The width and positioning of everything else is set by you. Half the difference between the width of the panel and the width of your stuff should be the left gap if you want to make your stuff centred.
Sections are imaginary anchors I use to position stuff relative to other stuff, defined by me for my own convenience. They don't do anything. Don't get hung up on that.
|
|
|
10-19-2022, 04:32 PM
|
#6
|
Human being with feelings
Join Date: Mar 2017
Location: in the moment
Posts: 632
|
Are you explaining how to figure out how to center the elements with absolute coordinates or are you describing how to dynamically center the elements in w when w is varies in size?
The sum of all my elements is 1452 pixels wide.
I understand that when w = 4 and my elements = 2 then 1 + 2 + 1 = w, and I can figure out the absolute coordinates for static placement.
I am hoping to learn how to write the code for conditional circumstances where the topbar elements automatically center themselves in my 1920 and or 2560 displays, as well as when the application window is arbitrarily resized on the desktop.
clear trans.*
;set trans.size = Baseline Size does not seem to do anything
;set trans.size [1920 45]
;set the minimum and maximum dimensions of the undocked transport bar.
set trans.size.minmax [1600 43 1600 43]
;First coordinate: desired docked height
set trans.size.dockedheight [43]
set trans.rew [10 6 40 32]
set trans.stop [50 6 39 32]
set trans.play [89 6 40 32]
set trans.pause [129 6 39 32]
set trans.fwd [168 6 40 32]
set trans.rec [208 6 41 32]
set trans.repeat [259 6 42 32]
set trans.automode [311 6 120 32]
set trans.bpm.tap [441 16 45 22]
set trans.bpm.edit [496 16 45 22]
set trans.curtimesig [551 16 46 22]
set trans.status [607 6 340 32]
set trans.sel [957 16 330 22]
front trans.rate.fader
set trans.rate.fader [1409 9 26 26]
set trans.rate.fader.fadermode [1]
set trans.rate [1302 6 140 32]
|
|
|
10-20-2022, 06:17 AM
|
#7
|
Pixel Pusher
Join Date: Mar 2007
Location: Blighty
Posts: 4,950
|
I understand what you're trying to do, I'm trying to explain how this works to you (and anyone else reading) rather than just giving you the answer. w is the width of the panel, it changes when you change the size of the panel or screen.
But ok;
Code:
set myBorderVariable * 0.5 - w 1452
set anyElement + [myBorderVariable{0} 0 0 0] [usual numbers]
BTW You've commented out your trans.size, don't do that.
|
|
|
10-20-2022, 08:12 AM
|
#8
|
Human being with feelings
Join Date: Mar 2017
Location: in the moment
Posts: 632
|
Hi,
I appreciate the idea that it is better to teach a person how to fish rather than just give them a fish. Really I do, but I last studied algebra 45+ years ago, and it has seemed impossible to look at the syntax of a line of code such as
myBorderVariable * 0.5 - w 1452
and immediately understand that it translates to the syntax I am familiar with.
For example; (width - 1452)/ 2 = the left or right border
The code syntax makes sense when I pause to think about it but when I see it I get so distracted that it becomes hard to see the forest for the trees, and I can not recognize the fundamental concepts.
I recognize that this is an example of the variables you describe in the Themer's Guide, and I sort of appreciate how it will be used to establish the function I am hoping for.
If I was a 15 year old schoolboy your efforts to teach the fundamentals might be effective, but as I have learned while aging, it really does become more difficult to grasp some concepts once you have become an old codger, especially if you have never seemed predisposed to the modality of thought required.
Having said that, I am going to try my best.
Some questions:
set myBorderVariable * 0.5 - w 1452
set anyElement + [myBorderVariable{0} 0 0 0] [usual numbers]
What is meant by "anyElement"? is that supposed to be a list of the elements such as trans.rew, trans.stop, trans.play etc.?
What is meant by "[usual numbers]"?
I will go read the Themer's Guide about variables again and see if anything clicks.
I am at a stage in life where I just want to be thankful, even if I don't accomplish the goal stated in the original post.
Thank you for your time and consideration.
Last edited by mister happy; 10-20-2022 at 08:59 AM.
|
|
|
10-20-2022, 08:39 AM
|
#9
|
Human being with feelings
Join Date: Mar 2017
Location: in the moment
Posts: 632
|
Hi again,
OK! I it appears that I finally got the clues, but the truth is I just made a lucky guess.
I also removed the comment out for the trans.size even though I can not see it do anything. :-)
Code:
set myBorderVariable * 0.5 - w 1452
;set anyElement + [myBorderVariable{0} 0 0 0] [usual numbers]
;set trans.size = Baseline Size, but does not seem to do anything
set trans.size [2560 45]
;set the minimum and maximum dimensions of the undocked transport bar.
set trans.size.minmax [1600 43 1600 43]
;First coordinate: desired docked height
set trans.size.dockedheight [43]
set trans.rew + [myBorderVariable{0} 0 0 0] [10 6 40 32]
set trans.stop + [myBorderVariable{0} 0 0 0] [50 6 39 32]
set trans.play + [myBorderVariable{0} 0 0 0] [89 6 40 32]
set trans.pause + [myBorderVariable{0} 0 0 0] [129 6 39 32]
set trans.fwd + [myBorderVariable{0} 0 0 0] [168 6 40 32]
set trans.rec + [myBorderVariable{0} 0 0 0] [208 6 41 32]
set trans.repeat + [myBorderVariable{0} 0 0 0] [259 6 42 32]
set trans.automode + [myBorderVariable{0} 0 0 0] [311 6 120 32]
set trans.bpm.tap + [myBorderVariable{0} 0 0 0] [441 16 45 22]
set trans.bpm.edit + [myBorderVariable{0} 0 0 0] [496 16 45 22]
set trans.curtimesig + [myBorderVariable{0} 0 0 0] [551 16 46 22]
set trans.status + [myBorderVariable{0} 0 0 0] [607 6 340 32]
set trans.sel + [myBorderVariable{0} 0 0 0] [957 16 330 22]
front trans.rate.fader
set trans.rate.fader + [myBorderVariable{0} 0 0 0] [1409 9 26 26]
set trans.rate.fader.fadermode [1]
set trans.rate + [myBorderVariable{0} 0 0 0] [1302 6 140 32]
I had been using my transport_bg.png as a long strip. I had added label lettering too it and coordinated the locations with features such as bpm tap, meter, and tempo.
I have not found a way to place the transport_bg.png with coordinates. It is not mentioned in the WALTER SDK so I assume it is placed behind the scenes.
Thank you!
Last edited by mister happy; 02-14-2023 at 02:11 PM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:42 PM.
|