|
|
|
08-15-2018, 01:59 PM
|
#1
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Cycle through track layouts
Is there currently script that can cycle through track and mixer layouts?
Sometimes, I just want to select a track and hit a hotkey a few times to select its layout instead of going through the menu or relying on track status or name.
Anyone knows of if something currently exists for such?
|
|
|
08-16-2018, 07:58 AM
|
#2
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
This is and old script, but seems to work:
https://forum.cockos.com/showthread....76#post1532976
Quote:
Originally Posted by spk77
I was "playing" with reaper.BR_GetMediaTrackLayouts/reaper.BR_SetMediaTrackLayouts, but there seems to be something weird happening when changing from horizontal meter to vertical meter:
This cycles through the user defined TCP-layouts ( "default", "bd --- Small Full Meter" and "cd --- Large expanding, popup fader" in this example)
PHP Code:
local tcp_layouts = { -- TCP layout names from the default theme (REAPER v5.0pre36) "", -- default --"aa - Standard", --"ab --- Standard + value readouts", --"ac --- Standard Media", --"ad --- Standard Media stretch", --"ae --- Standard expanding", --"af --- Standard expanding, popup fader", --"ag --- Standard Extra-expanding", --"ba - Small", --"bb --- Small + value readouts", --"bc --- Small Media", "bd --- Small Full Meter", --"bd --- Small Full Meter + value readouts", --"be --- Small expanding, popup fader", --"ca - Large", --"cb --- Large + value readouts", --"cc --- Large Media", "cd --- Large expanding, popup fader" }
function get_current_layouts_and_pos(track) -- "pos" means index in "tcp_layouts" -table local current_mcp_layout, current_tcp_layout = reaper.BR_GetMediaTrackLayouts(track) local i = 1 local pos = 0 for k, v in ipairs(tcp_layouts) do if v == current_tcp_layout then pos = i end i = i + 1 end return current_mcp_layout, current_tcp_layout, pos end
function set_next_tcp_layout() reaper.PreventUIRefresh(1) for i=1, reaper.CountSelectedTracks(0) do local track = reaper.GetSelectedTrack(0, i-1) if track ~= nil then current_mcp_layout, current_tcp_layout, pos = get_current_layouts_and_pos(track) if current_tcp_layout == tcp_layouts[#tcp_layouts] then new_tcp_layout = tcp_layouts[1] else new_tcp_layout = tcp_layouts[pos+1] end reaper.BR_SetMediaTrackLayouts(track, current_mcp_layout, new_tcp_layout) end end reaper.PreventUIRefresh(-1) end
set_next_tcp_layout()
NOTE: If you try it, use REAPER v5.0pre36 for testing (or edit the names in "tcp_layouts" -table to match your theme)
|
|
|
|
08-16-2018, 08:02 AM
|
#3
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Much thanks, spk77 for that script. Haven't seen that one.
One issue I have with approaches I've seen so far though is that it requires target layouts be predefined/chosen. However, being that different themes have different layouts, it just seems that it would make good sense to have a script/action that parses the available layouts and iterates through them.
Last edited by Ozman; 08-16-2018 at 08:17 AM.
|
|
|
08-16-2018, 08:05 AM
|
#4
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
I'll update the script...there are new functions that weren't available back then:
Code:
themePath, string themeName = reaper.BR_GetCurrentTheme()
string retval, optional string desc, optional number value, optional number defValue, optional number minValue, optional number maxValue = reaper.ThemeLayout_GetParameter(integer wp)
returns theme layout parameter. return value is cfg-name, or nil/empty if out of range.
reaper.ThemeLayout_RefreshAll()
Refreshes all layouts
boolean reaper.ThemeLayout_SetParameter(integer wp, integer value, boolean persist)
sets theme layout parameter to value. persist=true in order to have change loaded on next theme load. note that the caller should update layouts via ??? to make changes visible.
|
|
|
08-16-2018, 08:10 AM
|
#5
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Nice one spk77!!
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
08-16-2018, 08:11 AM
|
#6
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Thanks Thonex!
|
|
|
08-16-2018, 08:26 AM
|
#7
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Thanks, spk77.
Such a feature would most definitely come in handy.
|
|
|
08-16-2018, 12:28 PM
|
#8
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Ok, it's still not possible to get all layout names for current theme (from reascripts). I hope that the devs would add EnumTCPLayouts/EnumMCPLayouts -functions at some point.
(This is just a thought)
It might be possible to get the names, currently selected layout (and layout count) from the "Layout" submenu using Win32/SWELL functions:
juliansader might know something about this :
|
|
|
08-16-2018, 01:35 PM
|
#9
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Dang!
Well, hopefully, they see this and consider adding adding EnumTCPLayouts/EnumMCPLayouts to the API.
Please guys!
|
|
|
08-17-2018, 01:32 AM
|
#10
|
Human being with feelings
Join Date: Nov 2017
Location: Gloucestershire, UK
Posts: 223
|
Yeah... would be a great feature to have.
|
|
|
08-17-2018, 01:59 AM
|
#11
|
Banned
Join Date: Dec 2016
Location: England
Posts: 2,432
|
lol-trolltime!
wow--oldskool users still lost in a maze of unnecessary scripts>>
wake up you dopey fookers! - try view :screensets/layouts::layout tab @ end. <mousewheel scrolling by selecting+ mouse hover there=wootwithwonderous joy.
|
|
|
08-17-2018, 06:19 AM
|
#12
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Quote:
Originally Posted by Bri1
lol-trolltime!
wow--oldskool users still lost in a maze of unnecessary scripts>>
wake up you dopey fookers! - try view :screensets/layouts::layout tab @ end. <mousewheel scrolling by selecting+ mouse hover there=wootwithwonderous joy.
|
As I stated before:
Approaches I've seen so far require target layouts be predefined/chosen. However, being that different themes have different layouts, it just seems that it would make good sense to have a script/action that parses the available layouts and iterates through them.
I, like some other users, utilize more than one theme.
There should be a theme-neutral option for quick iteration through track layouts.
|
|
|
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 10:40 PM.
|