 |
|
|
01-12-2020, 10:41 AM
|
#1
|
Human being with feelings
Join Date: Dec 2015
Posts: 1,952
|
Layout Sub-Menus
Layout Sub-Menus
----------------------------------------------
Expand the layout menu with sub-menus.
This would make navigating the menu much faster.
Take the case of fader colors as an example:
If you have the initial layout and then 4 fader colors, you now have 5 layout entries in the menu for what is basically a single layout with 4 options for that layout.
If you have 5 layouts with 4 additional fader colors, you now have 25 entries to navigate instead of just seeing the initial 5 and then chosing the fader option for the layout you've chosen.
The current menu looks like this:
Sub-menus would make it look like this:
Navigation is clearly much faster in the second one.
::
|
|
|
01-12-2020, 10:45 AM
|
#2
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 5,874
|
+1
and even in cases where it's not faster, it looks much better and cleaned up.
|
|
|
02-27-2020, 08:22 AM
|
#3
|
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,567
|
+1.
Here's the FR I wrote, before finding this one:
At the moment, all the available layouts for an screen element (TCP, MCP, Envelope) are in a single list. I use nested Layouts in the rtconfig file to specify different coloured fader handles but this makes the Layouts menu very long and requires a lot of mouse movement / scrolling etc.
It would be much better if the Layout menu were nested too. This would make is much more compact, easier to navigate and more intuitive.
And my mock-up:
And the WALTER code for a coloured fader variant, within the general Layout, is just:
Code:
; --------------------------------------------------------------------------------
Layout "DS M02b. Red" "mcp_def_red"
; --------------------------------------------------------------------------------
set mcp.extmixer.mode [1]
EndLayout ;
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
|
|
|
02-27-2020, 09:13 AM
|
#4
|
Human being with feelings
Join Date: May 2010
Posts: 4,069
|
What theme are you guys using?
|
|
|
02-27-2020, 09:28 AM
|
#5
|
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,567
|
I'm using one based on Konzentration_v11 with my own layouts and variants added for the fader colours. Hence the odd-looking layout names (needed to get them into a logical order).
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
|
|
|
06-23-2020, 05:20 PM
|
#6
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 790
|
whoa this looks amazing
Last edited by zookthespook; 09-03-2020 at 11:26 AM.
|
|
|
06-23-2020, 06:48 PM
|
#7
|
Human being with feelings
Join Date: Dec 2015
Posts: 1,952
|
@ Dark Star
I really appreciate your input on the feature request, but this thread has only 7 posts and the last 4 are not directly related.
I totally understand the desire to share, but please stay on topic.
::
Last edited by lucas_LCS; 06-23-2020 at 10:52 PM.
Reason: typo
|
|
|
06-24-2020, 11:08 PM
|
#8
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 790
|
Sorry lucas it was a very colorful distraction.
But yes nested menu systems are always a +1 here too.
@darkstar plz don't distract us with the cool tools ! hehehe
peace
zook
|
|
|
06-25-2020, 06:00 AM
|
#9
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,385
|
@DarkStar: Impressive!! Nice!
Guys, something like this? :
(bigger pic)
|
|
|
06-25-2020, 11:42 AM
|
#10
|
Human being with feelings
Join Date: Dec 2015
Posts: 1,952
|
@ amagalma
Yes!
how are you doing that?
Is it a script?
::
|
|
|
06-25-2020, 12:39 PM
|
#11
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,385
|
Code:
-- @description Smart track layout picker (categories with sub-menus)
-- @author amagalma
-- @version 1.00
-- @link https://forum.cockos.com/showthread.php?t=230114
-- @donation https://www.paypal.me/amagalma
-- @about
-- # Smart track layout picker (categories with sub-menus)
--
-- - Displays a pop-up menu with all the available tcp/mcp layouts for the track under the mouse cursor or for the selected tracks, categorized in sub-menus
-- - Smart undo naming
-- - Requires JS_ReascriptAPI
if not reaper.APIExists( "JS_Window_Find" ) then
reaper.MB( "Please, right-click and install 'js_ReaScriptAPI: API functions for ReaScripts'. Then restart Reaper and run the script again. Thanks!", "You need to install the JS_ReaScriptAPI", 0 )
local ok, err = reaper.ReaPack_AddSetRepository( "ReaTeam Extensions", "https://github.com/ReaTeam/Extensions/raw/master/index.xml", true, 1 )
if ok then reaper.ReaPack_BrowsePackages( "js_ReaScriptAPI" )
else reaper.MB( err, "Something went wrong...", 0)
end
return reaper.defer(function() end)
end
local track_at_mouse, context = reaper.BR_TrackAtMouseCursor()
local tracks = {}
local current_layout, _ = "[--not specified--]"
if track_at_mouse then
tracks[1] = track_at_mouse
end
local track_cnt = reaper.CountSelectedTracks( 0 )
for i = 0, track_cnt-1 do
local track = reaper.GetSelectedTrack( 0, i )
if track_at_mouse ~= track then
tracks[#tracks+1] = track
end
end
if #tracks == 0 then return reaper.defer(function() end ) end
local function alphanumsort(o)
-- http://notebook.kulchenko.com/algorithms/alphanumeric-natural-sorting-for-humans-in-lua
local function padnum(d) return ("%03d%s"):format(#d, d) end
table.sort(o, function(a,b)
return tostring(a):gsub("%d+",padnum) < tostring(b):gsub("%d+",padnum) end)
return o
end
local layout_parm
if context == 0 or context == 2 then
layout_parm = "P_TCP_LAYOUT"
context = "tcp"
else
layout_parm = "P_MCP_LAYOUT"
context = "mcp"
end
if #tracks == 1 then
_, current_layout = reaper.GetSetMediaTrackInfo_String( tracks[1], layout_parm, "", false )
end
local i = 0
local t = {}
repeat
local retval, name = reaper.ThemeLayout_GetLayout( context, i)
i = i + 1
if retval and name ~= "" then
local words = {}
local previous = ""
local max_word = nil
for separator, word in name:gmatch("([%s-_]*)([^%s-_]+)") do
local scalar = previous .. (separator or "") .. word
words[#words+1] = scalar
if t[scalar] then
max_word = scalar
t[scalar][#t[scalar]+1] = name
else
t[scalar] = { [1] = name }
end
previous = scalar
end
for w = 1, #words do
if max_word and words[w] ~= max_word then
t[words[w]] = nil
end
end
end
until not retval
for menu, tabl in pairs(t) do
if #tabl > 1 then
alphanumsort(tabl)
for i = #tabl, 1, -1 do
if t[tabl[i]] and tabl[i] ~= menu then
t[tabl[i]] = nil
end
end
end
end
words = nil
local n = {}
for section in pairs(t) do
n[#n+1] = section
end
alphanumsort(n)
local r = 2
local register = {[r] = ""}
local menu = "#" .. context:upper() .. " LAYOUTS|" .. (current_layout == "" and "!" or "") .. "Global layout default|"
for i = 1, #n do
if #t[n[i]] == 1 then
menu = menu .. (n[i] == current_layout and "!" or "") .. n[i] .. "|"
r = r + 1
register[r] = n[i]
else
menu = menu .. ">" .. n[i] .. "|"
for j = 1, #t[n[i]] do
menu = menu .. (j == #t[n[i]] and "<" or "").. (t[n[i]][j] == current_layout and "!" or "") .. t[n[i]][j] .. "|"
r = r + 1
register[r] = t[n[i]][j]
end
end
end
local title = "Hidden gfx window for showing the showmenu"
gfx.init( title, 0, 0, 0, 0, 0 )
local hwnd = reaper.JS_Window_Find( title, true )
local out = 0
if hwnd then
out = 7000
reaper.JS_Window_Move( hwnd, -out, -out )
end
local x, y = reaper.GetMousePosition()
gfx.x, gfx.y = x-40+out, y-40+out
local selection = gfx.showmenu(menu)
gfx.quit()
if selection > 0 then
reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)
for i = 1, #tracks do
reaper.GetSetMediaTrackInfo_String( tracks[i], layout_parm, register[selection], true)
end
reaper.PreventUIRefresh(-1)
local undo = "Set " .. context:upper() .. " layout to global default"
if register[selection] ~= "" then
undo = "Set " .. context:upper() .. " layout to " .. register[selection]
end
reaper.Undo_EndBlock( undo, 1 )
end
Shortly available in ReaPack...
amagalma_Smart track layout picker (categories with sub-menus)
|
|
|
06-26-2020, 01:48 AM
|
#12
|
Human being with feelings
Join Date: Dec 2015
Posts: 1,952
|
Quote:
Originally Posted by amagalma
Shortly available in ReaPack...
amagalma_Smart track layout picker (categories with sub-menus)
|
It's really very nice, but I think sub-menus need to be native to Reaper out of the box.
::
|
|
|
06-26-2020, 04:53 AM
|
#13
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,385
|
Quote:
Originally Posted by lucas_LCS
It's really very nice, but I think sub-menus need to be native to Reaper out of the box.
::
|
No problem! Works for me  Meanwhile, you can wait for the native implementation..
|
|
|
06-26-2020, 11:50 AM
|
#14
|
Human being with feelings
Join Date: Dec 2015
Posts: 1,952
|
Quote:
Originally Posted by amagalma
No problem! Works for me  Meanwhile, you can wait for the native implementation.. 
|
LOL.
I can easily use a script.
The issue is newbies or people who don't want or know how to install a script.
Your script is excellent and so is Dark Star's, but this function seems like it should already be there when you open Reaper for the first time.
Still, I wouldn't mind checking this out.
What needs to be done to layout names in the RTConfig for them to be seen as sub-layouts?
::
Last edited by lucas_LCS; 06-26-2020 at 11:58 AM.
|
|
|
06-26-2020, 04:07 PM
|
#15
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,385
|
Quote:
Originally Posted by lucas_LCS
What needs to be done to layout names in the RTConfig for them to be seen as sub-layouts?
::
|
Nothing. The script automatically does it for you on-the-fly for any theme. Just assign it to a shortcut and press it when the mouse is over a TCP or MCP or if there are tracks selected.
Last edited by amagalma; 06-27-2020 at 01:52 AM.
|
|
|
01-24-2023, 09:01 PM
|
#16
|
Human being with feelings
Join Date: Aug 2019
Posts: 480
|
I can't get this to work...
I'm running Reaper 6.73 on Ubuntu 22.04.1. I have it assigned to a shortcut, but when I press the shortcut (mouse over a track or track selected, or both), nothing happens. If I press a 2nd time, I get the popup about an instance running, that asks do I want to terminate the 1st instance or start a 2nd instance.
I installed via ReaPack...
|
|
|
01-25-2023, 08:17 AM
|
#17
|
Human being with feelings
Join Date: Apr 2021
Location: Colombia
Posts: 106
|
This is really needed! +1
|
|
|
01-25-2023, 09:04 AM
|
#18
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,385
|
Quote:
Originally Posted by PMan
I can't get this to work...
I'm running Reaper 6.73 on Ubuntu 22.04.1. I have it assigned to a shortcut, but when I press the shortcut (mouse over a track or track selected, or both), nothing happens. If I press a 2nd time, I get the popup about an instance running, that asks do I want to terminate the 1st instance or start a 2nd instance.
I installed via ReaPack...
|
Unfortunately, I can't test on Linux.. Try this:
Go to line 132 of the script and comment it out like this:
Code:
--reaper.JS_Window_Show( hwnd, "HIDE" )
Save and run and see if that helped..
If not then comment our line 134 too and save and run:
Code:
--gfx.x, gfx.y = gfx.mouse_x-40, gfx.mouse_y-40
|
|
|
01-25-2023, 01:33 PM
|
#19
|
Human being with feelings
Join Date: Aug 2019
Posts: 480
|
Quote:
Originally Posted by amagalma
Try this:
Go to line 132 of the script and comment it out like this:
Code:
--reaper.JS_Window_Show( hwnd, "HIDE" )
|
Yes! it worked! This is great!
Many thanks, and a donation heading your way!
|
|
|
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 11:55 AM.
|