Old 01-19-2017, 09:29 AM   #1
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default Radial Menu

So I got the impression that you folks found Radial Menu pretty exciting. Prepare to need a new pair of underwear.



We've got custom colors. We've got adjustable everything. We've got context sensitive menus. We've got a pile of different action modes. We've got a sexy new setup script for getting it all, er, set up.

Oh, and this:



Yeah. That thing that Dora tells the fox not to do.

Presenting...
Radial Menu 2

This time it's personal. Ized. Personalized. This time it's per.... You get the idea.

Getting Started:

Not everyone likes as much text as I do. If that's you, here! Have a video!




Features:
  • Provides a pop-up "quick menu", similar to how most FPS games handle weapon selection these days.
  • Pretty much any Reaper action, custom action, or script can be assigned to a menu button.
  • Create as many menus, submenus, and buttons as you want. Well, 16 buttons per menu, but only a weirdo needs more than that.
  • Buttons for toggle actions (Options: Toggle metronome, etc) will light up appropriately if their action is toggled On.
  • Context sensitive; open a different set of menus when the mouse cursor is over the TCP vs MCP vs Arrange. There are over 20 contexts available, or you can opt for broader categories.
  • Buttons can be activated via Swipe gestures, just like answering your iPhone or trying to pick up strangers on Tinder. When swiping into a submenu, the window will be reopened at your mouse cursor.
  • Buttons can be set to repeat their action for as long as the mouse is held down - nudging volume faders, etc.
  • Buttons can be set to perform an action multiple times per mouse-click - "insert three new tracks", etc.
  • Both of these ^ can be combined, and are compatible with custom actions and user scripts
  • Buttons can also be activated by hovering over them with the mouse.
  • Buttons can have key binds assigned, for an all-keyboard workflow if you want.
  • Several different behaviors for the script's shortcut key.
  • Custom colors for every individual button if you really feel like going to the trouble. I wouldn't want to.
  • A handy-dandy setup script with a help screen, tooltips, and 50% more Vitamin C than the leading brand. Messing around with text files to change settings is for filthy peasants.

Installation:
  • The script is available via ReaPack or, if you'd rather do things the hard way, download and install both of these scripts *in the same folder*:
    Lokasenna_Radial Menu.lua
    Lokasenna_Radial Menu Setup.lua
    (right-click the link, choose Save As, put the files in your Reaper/Scripts folder or wherever you want, then use the Load button in the Reaper's action list to find them)
  • Installing with ReaPack will also get you an example menu file that can be imported in the Setup script (in the same folder as the scripts). If you installed manually, grab the example file here:
    Lokasenna_Radial Menu - example settings.txt

Instructions:
  • By default, Radial Menu will look for the "example settings" file mentioned above, which is included if you installed via ReaPack. If that file isn't found, you'll have to run the Setup script and set up (see what I did there?) some menus of your own before Radial Menu will be of any use to you.
  • Assign 'Lokasenna_Radial Menu.lua' to the shortcut key of your choice. There are some technical limitations on WHAT shortcut key you choose - see below.
  • Holding down your shortcut key will bring up the menu, letting go of your shortcut key will close it.
  • Click on buttons to do stuff, or click any empty space (technically, anywhere that doesn't make one of the buttons light up) to go back to the original menu.
  • See the Setup script's Help tab for further explanation of the various settings. I tried to be thorough.
  • Seriously, look at the Help tab. I spent several hours figuring out how to make the text automatically wrap to fit the window; the least you could do is read through what I put there. :P

Shortcut key restrictions:
Because of how the script figures out what key you're holding, there are a few rules you'll have to follow.
  • Known to work: All of the English letters, all of the numbers, F1-12.
  • Shift+ will only work with letters - no Shift+3, or Shift+[, etc. I'm not sure about non-English characters like 'é'.
  • Ctrl+, Alt+, and Win+ should work with any key.
  • Certain keys/characters like tilde ('~') will open the window but not close it. I've been told it's an issue with how the OS passes those characters to Reaper, so you'll have to use something else. Sorry.
  • If the window is rapidly opening and closing, that's a separate issue that I SHOULD be able to fix. Please let me know what key combination you're using, and what OS you're on. Bonus points if you can install this script here, run it, and tell me what numbers it's showing when you press that key combination.

Notes:
  • Reaper switches to a different set of key bindings when you're in the MIDI Editor. You can assign Radial Menu manually in the MIDI Editor's action list, or just assign your shortcut to Misc: Pass through key to main window. It'll use the same menus and settings either way.
  • Any Reaper action or script that takes focus away from Radial Menu's window will interfere with the key detection, causing Radial Menu to go "hey, you let go of the key!" and close. There's nothing I can do about this at present, so you may wish to use one of the alternate shortcut key modes in the Options tab.
  • Settings are stored in a text file right next to the two scripts. Feel free to edit it directly - there are instructions at the top of the file.

Last edited by Lokasenna; 04-30-2017 at 10:12 PM.
Lokasenna is offline   Reply With Quote
Old 01-19-2017, 09:35 AM   #2
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 64
Default

Wha !!

Awesome Lokasenna, as usual

Just a quick question, is it possible to use this script in order to launch functions in another script ?
Nantho is offline   Reply With Quote
Old 01-19-2017, 09:37 AM   #3
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

I haven't tried, but if you had a script loaded in the Action List you should be able to right-click, get the command ID, and paste that into a Radial Menu item.

The API function I'm using doesn't work with scripts. I'll look, but I don't think there's a different function that would.

Also, I just found a typo that kept the script from actually storing your actions. Fixing now. Also also, adding actions to submenus was putting the label on the wrong item. Fixed as well. Apparently I write code the same way I write forum/FB posts - type it out, post it, then have to go back and edit a billion tiny mistakes after the fact. :/

Last edited by Lokasenna; 01-19-2017 at 09:50 AM.
Lokasenna is offline   Reply With Quote
Old 01-19-2017, 10:12 AM   #4
Nantho
Human being with feelings
 
Join Date: Mar 2013
Posts: 64
Default

Quote:
Originally Posted by Lokasenna View Post
I haven't tried, but if you had a script loaded in the Action List you should be able to right-click, get the command ID, and paste that into a Radial Menu item.

The API function I'm using doesn't work with scripts. I'll look, but I don't think there's a different function that would.

Also, I just found a typo that kept the script from actually storing your actions. Fixing now. Also also, adding actions to submenus was putting the label on the wrong item. Fixed as well. Apparently I write code the same way I write forum/FB posts - type it out, post it, then have to go back and edit a billion tiny mistakes after the fact. :/
Thank you for this ligthning-fast answer and almost ligthning-fast edit

Regarding my question, don't worry about that, I've found another way around for my own script

And now, I'm thinking about all the other cool things I can do with your Radial Menu !

Once again, thank you for all your hard work, it's really useful to me, you can't even imagine
Nantho is offline   Reply With Quote
Old 01-19-2017, 10:34 AM   #5
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

There is my buddy!!!! Generous donation incoming!
Sexan is offline   Reply With Quote
Old 01-19-2017, 10:35 AM   #6
cfillion
Human being with feelings
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,175
Default

Quote:
Originally Posted by Lokasenna View Post
The API function I'm using doesn't work with scripts. I'll look, but I don't think there's a different function that would.
The textual command IDs must be converted with NamedCommandLookup before they can be used with Main_OnCommand:

Code:
local userinput = "_RSf9af5a881a603f63b4ac8574e6736996fc85eaf5"
-- local userinput = 1234

local runtime_id = reaper.NamedCommandLookup(userinput)
if runtime_id > 0 then -- if the script/action is loaded
  reaper.Main_OnCommand(runtime_id, 0)
end
(The support for running scripts using Main_OnCommand was added in v5.12)
cfillion is offline   Reply With Quote
Old 01-19-2017, 11:35 AM   #7
Flaneurette
Human being with feelings
 
Join Date: Dec 2016
Posts: 117
Default

What a great idea, and well executed. Should be default in Reaper.
__________________
Planting flowers, to which butterflies come.
Flaneurette is offline   Reply With Quote
Old 01-19-2017, 12:00 PM   #8
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

Quote:
Originally Posted by Flaneurette View Post
What a great idea, and well executed. Should be default in Reaper.
The only shitty thing is that it has to open a proper window. If the options could just be overlaid on top of the main window it'd be sexy as hell.

Well, and if the drawing functions were a bit more precise. Some of those corners are a bit messy.
Lokasenna is offline   Reply With Quote
Old 01-19-2017, 12:03 PM   #9
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

there is a bug when there are less action (buttons),script crashes :

Code:
473: attempt to index a nil value (field '?')
this line
Code:
  local act = mnu_arr[cur_depth][mnu_clicked].act
for example I have 3 actions in one menu

Last edited by Sexan; 01-19-2017 at 12:10 PM.
Sexan is offline   Reply With Quote
Old 01-19-2017, 12:12 PM   #10
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

Updated to work with custom actions and other scripts. Thanks for the heads up, @cfillion.

Quote:
Originally Posted by Sexan View Post
there is a bug when there are less action (buttons),script crashes :
Hmm... try adding this on the line right before that, make it crash again, and see what it says:
Code:
Msg("cur_depth = "..tostring(cur_depth).."mnu_clicked = "..tostring(mnu_clicked)
If it managed to save your custom menu in the text file, pasting that would be useful too.
Lokasenna is offline   Reply With Quote
Old 01-19-2017, 12:18 PM   #11
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Code:
cur_depth = 1mnu_clicked = 7
Right now I wanted only to test, I trimmed "COOL" menu to 3 actions (that are not set)

this is all I've trimmed the cool menu:
Code:
0  7  'terrible'  'menu 8'
1  0  'cool 0'  ''
1  1  'cool 1'  ''
1  2  'cool 2'  ''
2  0  'neat 0'  ''
thats from txt file
Nothing else is modified

Btw would it be too much if I ask for release key activate function ? I mean I've already added it (its 3 lines of code) to be optional in the main release code (not to modify it every time when I need to download it again)?
(this is not causing this above,I have two versions this bug is on vanilla code)

EDIT:Important info, this happens if you click in the middle

Last edited by Sexan; 01-19-2017 at 12:30 PM.
Sexan is offline   Reply With Quote
Old 01-19-2017, 12:39 PM   #12
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

Found the bug, it wasn't looking at the right table for "how many buttons do I have right now?". Should be fixed now, along with a similar bug for having more than 8 buttons.

As for running the action on release, no sweat. I'll add it to the list.
Lokasenna is offline   Reply With Quote
Old 01-19-2017, 12:40 PM   #13
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

I've fix it :
changed this line:
Code:
local mnu_clicked = mouse_mnu  % #mnu_arr
to this:
Code:
local mnu_clicked = mouse_mnu  % #mnu_arr[cur_depth]
It was looking always at the main menu table than menu you are in
Sexan is offline   Reply With Quote
Old 01-19-2017, 12:58 PM   #14
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Also its not that it bothers me , its a really great feature for even faster access of everything but on other hand it triggers unwanted commands,but just want to know from coding point of view:
why is the center considered as last button? In main menu it is awesome!!!!! but when you enter a sub menu and click center (considering thats how you get back to main menu) it activates last button.
If you wanna fix this (if its not intentional) please keep it in the main menu !!
Sexan is offline   Reply With Quote
Old 01-19-2017, 01:02 PM   #15
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

It's not meant to do that; in theory, anywhere within 32px of center should be a dead zone. I'll have a look.

Edit: I have two variables, mouse_mnu and mnu_clicked that track what the mouse is over. mouse_mnu was respecting the dead zone, but that wasn't being passed on to mnu_clicked. Fixing it now, because it is technically a bug.

As for keeping it on the main menu; I don't understand the benefit. How does it let you go faster? What if I made it so that pressing + releasing the keyboard key without moving the mouse automatically ran the last action you had clicked?

Last edited by Lokasenna; 01-19-2017 at 01:12 PM.
Lokasenna is offline   Reply With Quote
Old 01-19-2017, 01:10 PM   #16
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

or maybe add additional center button in main menu, its a great bug do not want to lose this!!!
Sexan is offline   Reply With Quote
Old 01-19-2017, 02:17 PM   #17
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: brighton, uk
Posts: 12,279
Default

awesome! thanks!

Will check it out/donate etc soon!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 01-19-2017, 05:14 PM   #18
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Quote:
Originally Posted by Lokasenna View Post
As for keeping it on the main menu; I don't understand the benefit. How does it let you go faster?
Well it was a menu dead center where you "click" - "left-right-up-down", less movement than others
Sexan is offline   Reply With Quote
Old 01-19-2017, 06:12 PM   #19
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 3,993
Default

This kind of thing is very popular in graphics apps, very interesting to have made something for audio software, I'm sure it can be useful !
X-Raym is offline   Reply With Quote
Old 01-19-2017, 11:46 PM   #20
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: City
Posts: 9,617
Default

Looking mighty fine. Ideal for setting up Loudness submenu stuff, scripts and edit functions.

If you enter nothing in the action ID field by just leaving it empty, a script error pops up:
Code:
454: bad argument #1 to 'sub' (string expected, got nil)
Suggestions/ideas.
Hmm. I'll probably try to add a colour for each field for the mouse-over.

If a submenu is called, the submenu could use its own background and non-mouse-over colour too. Might be necessary to set something up ahead of time in the script.

That way you have another layer of visual feedback. Perhaps more code monkeys can jump in. To summarize the ideas and a couple of more:
  • Mouse-over colour per field
  • Per-submenu background and non-mouse-over field colour
  • Variable number of fields
  • Field shapes
  • Multiline text
  • Variable font height with possible auto-correction to fit text in to field
  • Use icon images from resource-folder/data/


Fascinating how whiny users can spiral out of control, eh ?
__________________
Dialogue/FX Editor & Re-Recording Mixer
Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 01-20-2017, 02:24 AM   #21
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

I'm getting uncomfortable with FR bu last thing I want here is context sensitivity.I 've done it with demo script but here I cant modify it (I do't know how to implement it here). The easiest way to do it is to have section in txt file that will be triggerd when context is cought "tcp" "arrange' item etc, and a global option "context"' if that option is disabled then use normal table for all contexts
Sexan is offline   Reply With Quote
Old 01-20-2017, 02:40 AM   #22
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Also adding more buttons from setup would be cool (add one more section in F1 where you enter a number and it creates that many menus autonamed menu 1-number you entered) and also delete button option
Sexan is offline   Reply With Quote
Old 01-20-2017, 03:59 AM   #23
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Here I've added adding more buttons from F1 menu :
Code:
local defstr = table.concat(col_main, " ")..","..table.concat(col_hover, " ")..","..table.concat(col_bg, " ")..",".."0"..",".."a or m"
      
      -- added 4th and 5th options for adding menus (number of menus and menu type)
      local retval, retstr = reaper.GetUserInputs("Settings", 5, "Main RGBA (0 255):,Hover RGBA:,BG RGBA (requires a restart):,Add Menus,Menu Type,extrawidth=24", defstr)
      
      if retval then
        
        local col_arr = {string.match(retstr, "([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)")}
        col_main = {string.match(col_arr[1], "(%d+)%s+(%d+)%s+(%d+)%s+(%d+)")}
        col_hover = {string.match(col_arr[2], "(%d+)%s+(%d+)%s+(%d+)%s+(%d+)")}
        col_bg = {string.match(col_arr[3], "(%d+)%s+(%d+)%s+(%d+)%s+(%d+)")}
        
        
        --- if number of menu is added (differrent than 0)
        if string.match(col_arr[4], "(%d+)") ~= "0" then
        
          -- save all entrys ( current open menu , number or menus to add, menu type (action or submen)
          new_buttons = {cur_depth, string.match(col_arr[4], "(%d+)"), string.match(col_arr[5],"(%a+)")}
          
            -- to how many buttons were entered
            for i = 1 , new_buttons[2] do
            
              -- if new menu is action
              if new_buttons[3] == "a" then
              
                -- set action to nil and label is set to "action" + last menu + 1
                newA = { act = "" , lbl = "Action "..(#mnu_arr[new_buttons[1]]+ 1) }
                
                -- add new button to existing table 
                mnu_arr[new_buttons[1]][#mnu_arr[new_buttons[1]]+1] = newA
                
              -- if new menu is menu/submenu
              elseif new_buttons[3] == "m" then
                -- allow creating submenus only in main menu
                if cur_depth == 0 then
              
                  -- new menu/submenu
                  newM = { act = "menu "..(#mnu_arr[new_buttons[1]]+2), lbl = "Menu "..(#mnu_arr[new_buttons[1]]+2) }
                
                  -- new action
                  newA = { act = "" , lbl = "Menu "..(#mnu_arr[new_buttons[1]]+2) }
                
                  -- add new menu entry at current menu
                  mnu_arr[new_buttons[1]][#mnu_arr[new_buttons[1]]+1] = newM
                
                  -- add one new action in that menu (so it is not empty)
                  mnu_arr[#mnu_arr+1] = { [0] = newA } 
                end 
                              
              end
              
            end
        end
        
      end

It can add actions or menus (menu type "a" for action "m" for menu), menus can be only created if we are in main menu, if in sub menu only actions can be created (it will discare if you enter menu type "m" nothing will happen)

Last edited by Sexan; 01-20-2017 at 06:01 AM.
Sexan is offline   Reply With Quote
Old 01-20-2017, 06:33 AM   #24
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

I'm going to have port this over to my other GUI code just to make a proper Options menu. Or maybe a separate "Setup" script... hmm...

On the plus side, I just realized that scripts can call the OS's "choose a color..." box.

Last edited by Lokasenna; 01-20-2017 at 06:43 AM.
Lokasenna is offline   Reply With Quote
Old 01-20-2017, 06:46 AM   #25
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

What kind of options are we talking about ? checkboxes ? maybe add F2 for second option window (one for global settings other for adding or whatever) ? or like you sayed separate script that would open on F1 (not sure is it possible to work that way)
Sexan is offline   Reply With Quote
Old 01-20-2017, 07:15 AM   #26
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

I can actually reopen the window with different settings, so Setup mode will just make it wider and add a couple of tabs - one for all of the current button's settings and another tab for global stuff like Shape.
Lokasenna is offline   Reply With Quote
Old 01-20-2017, 02:49 PM   #27
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Ok I've found perfect solution for dead center menu that I very much love ,option to set center menu:
the code that drives it (also fixed that issue where center was always selecting last menu like you sayed)
Code:
if mouse_r < 32 then
    if cur_depth ~= 0 then
      mouse_mnu = -1 mnu_clicked = -1
    else
      if def_center_menu then
        mouse_mnu , mnu_clicked = def_center_menu,def_center_menu
      else
        mouse_mnu = -1 mnu_clicked = -1
      end
    end    
  else
    mnu_clicked = mouse_mnu  % (#mnu_arr[cur_depth] + 1)
  end

I'm weird I know but I like me

oh and btw

its little cpu hogy

edit: nevermind simple fix
Code:
if mouse_mnu ~= last_mouse_mnu then
  draw_mnu()
  last_mouse_mnu = mouse_mnu
end
minimal now

Last edited by Sexan; 01-20-2017 at 04:21 PM.
Sexan is offline   Reply With Quote
Old 01-20-2017, 08:18 PM   #28
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

I actually tried that trick to reduce CPU usage ages ago but couldn't make it work. Apparently you can only do that if you aren't using ANY of the gfx.drawsomething; as soon as you draw one thing, it blanks the canvas.

The CPU usage is probably because each button is calling gfx.arc about 200 times to fill in the middle. I think I've come up with a more efficient algorithm, but I'll add your "do we need to redraw yet?" code as well.

Edit: The arc function isn't accurate enough to draw these buttons nicely, and it just gets worse when I try to do it more efficiently. I might go with a different shape for the buttons altogether.

I've also added a center button for any menu you want to put it on, just by holding the left button in the middle like you do with the rest of them. That'll be in the same update as the CPU stuff once I sort that out.

Last edited by Lokasenna; 01-20-2017 at 10:34 PM.
Lokasenna is offline   Reply With Quote
Old 01-21-2017, 08:07 AM   #29
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

This is going to be some really ...REALLY exciting shit when its finished!
Toggle states, beautifying a little bit and something special


in draw_mnu() for toggle
Code:
 ----- toggle state color
      if string.sub(str.act, 1, 4) ~= "menu" and str.act ~= "" then
        local action = string.match(str.act, "(%d+)")
        local state = reaper.GetToggleCommandState(action)
        if state ~= nil then
          if state == 1 then 
            color = col_on
          end
        end
      end   
        
      draw_ring_section(i + k, mnu_adj, rc, rd, ox, oy, 0.05, fill, color)
volume changing need a proper implementation (I do not want to shock anyone with my awesome coding skills hahaa), this was a test and very weird code of mine (never done this before),but anyway implemented left click hold (as lokasenna showed me) to bypass menu selection and while in that mode to move fader up and down depending on mouse possition)

Last edited by Sexan; 01-21-2017 at 08:45 AM.
Sexan is offline   Reply With Quote
Old 01-21-2017, 08:26 AM   #30
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 3,353
Default

Amazing ! Can't wait !
vanhaze is offline   Reply With Quote
Old 01-21-2017, 09:10 AM   #31
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

Updated.

Reduced the CPU usage, added a center button if you want (in setup, click and hold in the middle), toggle actions will light up the button as in Sexan's .gif above, various bug fixes.
Lokasenna is offline   Reply With Quote
Old 01-21-2017, 09:13 AM   #32
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

there is an error in line 486 : atempting to to index a nil value field ?
Sexan is offline   Reply With Quote
Old 01-21-2017, 09:27 AM   #33
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

Yeah, I think I just found the same thing. Updated again.
Lokasenna is offline   Reply With Quote
Old 01-21-2017, 09:38 AM   #34
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Looking awesome!
Sexan is offline   Reply With Quote
Old 01-21-2017, 09:54 AM   #35
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

refreshed the txt now it works, but you still have error (at least me)
Code:
if mouse_r < ((cur_depth == 0 and mnu_arr[0][-1].lbl ~= "") and 48 or 16) then mnu_clicked = -1 end
Code:
mnu_arr[0][0]
this fix it

Last edited by Sexan; 01-21-2017 at 09:59 AM.
Sexan is offline   Reply With Quote
Old 01-21-2017, 10:05 AM   #36
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,188
Default

That line is checking to see if there's a middle button, though, so it needs [-1]. It's just giving an error because the code goes straight to "give me [-1]'s label!" without seeing if [-1] is there first. Working on it.

Edit: Updated again, should be fixed.

Last edited by Lokasenna; 01-21-2017 at 10:12 AM.
Lokasenna is offline   Reply With Quote
Old 01-21-2017, 10:37 AM   #37
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

Yeah great!
anyway here is the function for activate on release (that I've constantly put in new versions)
Code:
function on_release()
  if mouse_act then
    if string.sub(mouse_act, 1, 4) ~= "menu" and mouse_act ~= '' then
      reaper.Main_OnCommand(mouse_act, 0)
    end
  end
end
Code:
mnu_clicked = mouse_mnu  % (#mnu_arr[cur_depth] + 1)
mouse_act = mnu_arr[cur_depth][mnu_clicked].act   ----------- here
if mouse_r < ((cur_depth == 0 and mnu_arr[0][0].lbl ~= "") and 48 or 16) then mnu_clicked = -1 end

Last edited by Sexan; 01-21-2017 at 03:40 PM.
Sexan is offline   Reply With Quote
Old 01-21-2017, 11:24 AM   #38
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

the volume thing... cant figure it out :
Code:
  if hold == true then
    local tr = reaper.GetSelectedTrack(0,0)
    cur_vol = reaper.GetMediaTrackInfo_Value(tr,"D_VOL")
    mx, my = reaper.GetMousePosition()
    cur_pos = my - ly     -- ly is last reaper.GetMousePosition() so it starts counting from 0
  end
this code is triggerd when left click is hold, now what I cant figure out how to move fader relative to this possition, or how to translate pixel to fader movement. Every time this code is called the mouse position is 0 and from there it should move fader from what ever position it is

Last edited by Sexan; 01-21-2017 at 12:49 PM.
Sexan is offline   Reply With Quote
Old 01-21-2017, 03:39 PM   #39
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 1,740
Default

making click and on_release to work together:
Code:
else
  --Msg("attempting action "..act)
  reaper.Main_OnCommand(act, 0)        
  clicked = act
  --cur_depth = 0 -- i don like switching menus while clicking when having on_release to activate actions
end
Code:
  -- Figure out what option the mouse is over
  if mouse_angle < 0 then mouse_angle = mouse_angle + 2 end  
  mouse_mnu = math.floor(mouse_angle / mnu_adj + 0.5)
  if mouse_mnu == (#mnu_arr[cur_depth] + 1) then mouse_mnu = 0 end
  mnu_clicked = mouse_mnu  % (#mnu_arr[cur_depth] + 1)
  mouse_act = mnu_arr[cur_depth][mnu_clicked].act
  
  if clicked == mouse_act then
    mouse_act = nil
  end

  if mouse_r < ((cur_depth == 0 and mnu_arr[0][0].lbl ~= "") and 48 or 16) then mnu_clicked = -1 end
this prevents double triggering actions if you clicked on them to activate/deactivate and then when you release to activate/deactivate them again
Sexan is offline   Reply With Quote
Old 01-21-2017, 03:47 PM   #40
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 3,353
Default

Any estimated release of Radial Menu ?
Will it be available through ReaPack ?

Can't wait to try t out ..
Seems a really revolutionary concept:0)
vanhaze 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 01:36 PM.


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