|
|
|
04-08-2019, 12:34 PM
|
#1
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Script : Pop up toolbar
Bonjour à tous
Je suis en train de réaliser une config pour un client et j'ai mis au point une astuce sympatique que je partage avec vous
une image vaut mieux qu'un long discours
https://drive.google.com/open?id=1yJ...KLVn9q1nWnljsb
Le principe, c'est de faire en sorte que la/les toolbars de gauche (mais ca peut être une autre) ne s'affiche que lorsqu'on touche le bord guache de l'écran
Comment faire?
1) je créer d'abord deux cycle action qui permettent de maintenir ouvertes et/ou fermés les toolbars que j'ai placée à gauche dans ma config (16 et8 dans mon cas)
https://drive.google.com/open?id=1Zs...I3QrTBjQjRJmOV
2) Je créer un script.lua de type defer basé sur la position de la souris
quel est ce script?
Code:
local r = reaper; local function nothing() end; local function bla() end
function act(id) r.Main_OnCommand(id, 0) end
local function Main()
x,y = reaper.GetMousePosition()
if x == 0 then
act(reaper.NamedCommandLookup("_S&M_CYCLACTION_102")) end -- Toolbar left
if x > 120 then
act(reaper.NamedCommandLookup("_S&M_CYCLACTION_101")) end -- Toolbar left
r.defer(Main)
end
Main()
Les trois valeurs en couleur sont à adaptées selon votre config
En rouge, l'ID de cycle action qui OUVRE les toolbar
En vert, l'ID de cycle actrion qui FERME les toolbar
en bleu, le nombre de pixel de largeur de vos toolbars
3) placer le scipt dans un macro qui sert de start action
voili
|
|
|
04-08-2019, 12:37 PM
|
#2
|
Human being with feelings
Join Date: Sep 2010
Location: Mons, Belgium
Posts: 3,053
|
Je n'ai qu'un seul mot, mais il est composé :
Top-giga-balèze-de-sa-maman-en-slip.
|
|
|
04-08-2019, 12:52 PM
|
#3
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Avertissement: Google Translate. Désolé
C'est une bonne idée.
Cela fait l'action sur chaque cycle de script:
Code:
if x> 120 then
act (reaper.NamedCommandLookup (" _S & M_CYCLACTION_101 "))
end
Il devrait vérifier si la barre d'outils est ouverte:
Code:
local isOpen
local function Main ()
x, y = reaper.GetMousePosition ()
if (x == 0 and not isOpen) then
act (reaper.NamedCommandLookup (" _S & M_CYCLACTION_102 "))
isOpen = true
end
elseif (x > 120 and isOpen) then
act (reaper.NamedCommandLookup (" _S & M_CYCLACTION_101 "))
end
r.defer (Main)
end
|
|
|
04-08-2019, 01:04 PM
|
#4
|
Petit manitou
Join Date: Feb 2009
Location: Mars
Posts: 7,356
|
Comme souvent; c'est brillant !!
|
|
|
04-08-2019, 01:16 PM
|
#5
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
@ lokasenna
Thanks a million
|
|
|
04-09-2019, 02:30 AM
|
#6
|
Human being with feelings
Join Date: May 2012
Posts: 6,472
|
J'ai le droit de dire que ça ressemble a la fonction "masquer automatiquement" de mon Paintshop Pro et que ça pourrait être nativement inclus dans Reaper ou il faut que je retourne a mon Cubase ?
(mauvais esprit inside )
|
|
|
04-09-2019, 03:05 AM
|
#7
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
@Reno
Dans mon script Scroll arrange view if mouse is on screen edges, tu as la base du code pour faire la meme chose à droite, en haut et en bas, en fonction des resolutions de l'écran (renvoyée par JS_reascriptAPI). :P
|
|
|
04-09-2019, 03:26 AM
|
#8
|
Human being with feelings
Join Date: Oct 2008
Location: France
Posts: 3,701
|
Quote:
Originally Posted by Lylo
J'ai le droit de dire que ça ressemble a la fonction "masquer automatiquement" de mon Paintshop Pro et que ça pourrait être nativement inclus dans Reaper ou il faut que je retourne a mon Cubase ?
(mauvais esprit inside )
|
Si tu connais la réponse, pourquoi poses-tu la question ?
|
|
|
04-09-2019, 03:29 AM
|
#9
|
Human being with feelings
Join Date: Jan 2010
Posts: 8,215
|
Quote:
Originally Posted by benf
Si tu connais la réponse, pourquoi poses-tu la question ?
|
Y a rien dans la charte du fofo concernant les coups bas, non?
__________________
"Votre vote m'oblige". Menteur n'a qu'un œil.
|
|
|
04-09-2019, 03:33 AM
|
#10
|
Human being with feelings
Join Date: Oct 2008
Location: France
Posts: 3,701
|
J'avoue. C'était un coup base...
D'autant plus qu'on fait assez peu de musique avec Paintshop pro.
|
|
|
04-09-2019, 03:39 AM
|
#11
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Quote:
@Reno
Dans mon script Scroll arrange view if mouse is on screen edges, tu as la base du code pour faire la meme chose à droite, en haut et en bas, en fonction des resolutions de l'écran (renvoyée par JS_reascriptAPI). :P
|
Merci, j'ai vu
Mais ton code est ultr complexe et la, en un coup d'oeil, si j'ai vite compris comment ouvrir les toolbars, pour les refermer, c'est une autre paire
|
|
|
04-09-2019, 05:54 AM
|
#12
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
@Reno
Ah je comprends ce qui peut perturber, cest mes longues comparaisons pour gérer le féfilement en diagonale, mais en fait dans otn cas t'as pas besoin de ça,
juste de la position de la souris en X et Y
Code:
mouse_x, mouse_y = reaper.GetMousePosition()
de la résolution de l'écran
Code:
screen_left, screen_top, screen_right, screen_bottom = reaper.JS_Window_MonitorFromRect(0, 0, 0, 0, false)
Et après c'est des comparaisons simple
A gauche (ça c'est ce que tu as déjà)
Code:
if mouse_x == 0 then
à droite
Code:
if mouse_x >= screen_right - 1 then
en haut
en bas
Code:
if mouse_y >= screen_bottom - 1 then
Tout simplement
|
|
|
04-09-2019, 06:43 AM
|
#13
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Ok! merci
J'ai réussi a faire ouvrir la toolbar 1 et la refermer et ce, sans passer par une cycle action! un bon début
Code:
function SetButtonState( set ) -- Set ToolBar Button State
if not set then set = 0 end
local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
local state = reaper.GetToggleCommandStateEx( sec, cmd )
reaper.SetToggleCommandState( sec, cmd, set ) -- Set ON
reaper.RefreshToolbar2( sec, cmd )
end
function Main()
mouse_x, mouse_y = reaper.GetMousePosition()
screen_left, screen_top, screen_right, screen_bottom = reaper.JS_Window_MonitorFromRect(0, 0, 0, 0, false)
toolbar_1_state = reaper.GetToggleCommandState(41679)--toolbar 1 command id
if mouse_x == 0 and toolbar_1_state == 0 then -- action to open toolbar 1
reaper.Main_OnCommand(41679,0)-- open/close toolbar 1
end
if mouse_x >= screen_left + 30 and toolbar_1_state == 1 then -- action to close toolbar 1
reaper.Main_OnCommand(41679,0) -- open/close toolbar 1
end
reaper.defer(Main)
end
SetButtonState( 1 )
Main()
reaper.atexit( SetButtonState )
Le code est eut-être pas optimal mais il fontionne :P
|
|
|
04-09-2019, 08:01 AM
|
#14
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
@Reno
Ca me parait bien (à part les indentations :P)
Pour ma part vu que je me sert déjà des edges pour me script de scrolling, je rajouterai peut-être un petit modificateur clavier pour afficher la toolbar (par exemple, que si je suis dans un coin, avec ALT appuyé). On peut imaginer des toolbars différentes en fonction des touches appuées (MAJ, CTRL, MAJ + CTRL etc)
En tout cas tout ce ci ouvre pas mal de possibilité :P
|
|
|
04-09-2019, 08:37 AM
|
#15
|
Human being with feelings
Join Date: Dec 2010
Location: Saint Brieuc, Yeah !
Posts: 675
|
Quote:
Originally Posted by X-Raym
à part les indentations
|
Mais ouf c'est pas du Python.
Je connais bien Lua, c'est cool qu'il y ait une API Reaper. Bravo à tous ceux qui s'y collent.
|
|
|
04-09-2019, 10:42 AM
|
#16
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
J'en suis là
https://drive.google.com/open?id=1dD...0u-qj7GFke6TtU
Bord guache -> ouverture des toolbars et refermeture dès la souris n'est plus au dessus
Bord droit -> ouverture du docker droit
Bord bas / moitié guache de l'écran -> ouverture mixeur
Bord bas / moitié droite de l'écran -> ouverture du docker du bas
Bord haut (avec zone du menu inactive) -> fermeture du mixer et des docker
C'est hyper pratique et libère des icones et raccourcis clavier d'ouverture de tout ce beau monde
Le code, pour ceux que ca inspire
Code:
function SetButtonState( set ) -- Set ToolBar Button State
if not set then set = 0 end
local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
local state = reaper.GetToggleCommandStateEx( sec, cmd )
reaper.SetToggleCommandState( sec, cmd, set ) -- Set ON
reaper.RefreshToolbar2( sec, cmd )
end
function Main()
mouse_x, mouse_y = reaper.GetMousePosition()
screen_left, screen_top, screen_right, screen_bottom = reaper.JS_Window_MonitorFromRect(0, 0, 0, 0, false)
toolbar_8_state = reaper.GetToggleCommandState(41686)--toolbar 8 command id
toolbar_dock_state = reaper.GetToggleCommandState(41084)--toolbar docker state
mixer_state = reaper.GetToggleCommandState(40078)--mixer state
fx_browser_state = reaper.GetToggleCommandState(40271)--Fx Browser state
resources_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"))--resources state
region_state = reaper.GetToggleCommandState(40326)--region manager state
groove_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"))--resources state
fx_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_WNTGL4"))--resources state
screen_width = screen_right - screen_left
if mouse_x == 0 and toolbar_8_state == 0 then -- open left toolbar
reaper.Main_OnCommand(41686,0)-- open/close toolbar 8
reaper.Main_OnCommand(41943,0)-- open/close toolbar 16
end
if mouse_x >= screen_left + 130 and toolbar_8_state == 1 then -- action to close toolbar 1
reaper.Main_OnCommand(41686,0) -- open/close toolbar 1
reaper.Main_OnCommand(41943,0)-- open/close toolbar 16
end
if mouse_x == screen_right and region_state == 0 and fx_browser_state == 0 then -- open browser
reaper.Main_OnCommand(40271,0)-- open FX browser
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"),0)-- open resources
reaper.Main_OnCommand(40326,0)-- open Region Manager
reaper.Main_OnCommand(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"),0)-- open groove
end
if mouse_y <= 15 and region_state == 1 and fx_browser_state == 1 then -- close browser
reaper.Main_OnCommand(40271,0)-- close FX browser
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"),0)-- close resources
reaper.Main_OnCommand(40326,0)-- close Region Manager
reaper.Main_OnCommand(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"),0)-- close groove
end
if mouse_y == screen_bottom and mouse_x >= screen_width * 0.5 and toolbar_dock_state == 0 then
reaper.Main_OnCommand(41084,0) -- open toolbar docker
end
if mouse_y <= 15 and mouse_x >= screen_width * 0.25 and toolbar_dock_state == 1 then
reaper.Main_OnCommand(41084,0) -- close toolbar docker
end
if mouse_y == screen_bottom and mouse_x <= screen_width * 0.5 and mixer_state == 0 then
reaper.Main_OnCommand(40078,0) -- open Mixer
end
if mouse_y <= 15 and mouse_x >= screen_width * 0.25 and mixer_state == 1 then
reaper.Main_OnCommand(40078,0) -- close mixer
end
--reaper.ShowConsoleMsg(mouse)
reaper.defer(Main)
end
SetButtonState( 1 )
Main()
reaper.atexit( SetButtonState )
|
|
|
04-09-2019, 11:43 AM
|
#17
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
Et bien c'est pas mal tout ça !
On pourrait aussi définir des zones (genre en bas à droite c'ets e mixer, en bas à gauche c'est le navigateur etc)... Juste des idées comme ça, c'est suffisamment facile à moder pour ajuster ça à sa sauce.
Beaucoup de possibilités encore une fois :P
|
|
|
04-09-2019, 01:45 PM
|
#18
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Ce qui est dommage, c'est qu'un script ne puisse pas être actif que lorsque sa touche de raccourcis est maintenue enfoncée...
Là, ca permettrait à la terre de commencer à tourner à l'envers
|
|
|
04-09-2019, 01:50 PM
|
#19
|
Human being with feelings
Join Date: May 2012
Posts: 6,472
|
Quote:
Originally Posted by benf
J'avoue. C'était un coup base...
D'autant plus qu'on fait assez peu de musique avec Paintshop pro.
|
Oui très, très bas(e) et assumé, j'étais une vraie tronche de Cake(walk) ce matin.
Et en effet je ne crois pas que ça existe dans les logiciels de musique, du moins avec un simple glissé de souris.
|
|
|
04-09-2019, 02:52 PM
|
#20
|
Human being with feelings
Join Date: Jun 2017
Location: Paris-Bruxelles
Posts: 1,266
|
Bravo les amis, j'ai pas vraiment besoin de ça pour le moment, mais ça m'impressionne.
|
|
|
04-10-2019, 03:10 AM
|
#21
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
Quote:
Originally Posted by Reno.thestraws
Ce qui est dommage, c'est qu'un script ne puisse pas être actif que lorsque sa touche de raccourcis est maintenue enfoncée...
|
J'avais fais la request il y a quelques temps,
Continous Push Shortcuts ? - "Press and Hold" Shortcuts
Mais la solution proposée par Xenakios n'était pas cross-platforme.
Cependant, il y maintenant une fonction pour analysé l'état du clavier via l'extension js_Reascript API :P
Du coup.... C'est possible !
Voici une démo:
La grille se met en mode mesure le temps que G est maintenu et revient à la normal après.
Je t'ai mis le code snippet sur github
https://github.com/ReaTeam/ReaScript...20shortcut.lua
Have fun :P
EDIT: je t'ai mis en top ce qui doit être modifié dans le block USER CONFIG AREA
après tu peux mod la fonction principale si besoin (pour enlever les messages par exemple).
Last edited by X-Raym; 04-10-2019 at 03:23 AM.
|
|
|
04-10-2019, 03:41 AM
|
#22
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
roh!!!
|
|
|
04-10-2019, 04:23 AM
|
#23
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Le truc du hold!!!
En quelques minutes, j'ai fait ca
https://drive.google.com/open?id=1lL...Jhm5LLm55dmt6j
l'outil de split par click qui ne fonctionne que lorsqu'on maintient le S
par contre, j'ai un message d'alerte erreur sonore windows (douang douang) à chaque fois que je lance le script (maintient de la touche)
|
|
|
04-10-2019, 04:48 AM
|
#24
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
Quote:
par contre, j'ai un message d'alerte erreur sonore windows (douang douang) à chaque fois que je lance le script (maintient de la touche)
|
Hmmm je n'ai pas ce probleme, (Win 10 x64)
Pour info le script n'est lié à un raccourcis clavier,
je le lance depuis l'action list tout simplement, il s'occupe de l'interception des touches lui-même,
du coup je n'ai à le lancer qu'une seule fois.
A vérifier ta touche S est pas reliée à une autre action dans la liste d'action. IL y a peut-être une interférence quelque part.
(note: pour info js_extension API possède un équivalent de js_Vkeys mais pour la souris, pour intercépté les clics de souris :P)
|
|
|
04-10-2019, 04:58 AM
|
#25
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Quote:
A vérifier ta touche S est pas reliée à une autre action dans la liste d'action. IL y a peut-être une interférence quelque part.
|
effectivement, il faut relié le raccourcis clavier concerné à l'action no-op, no action
|
|
|
04-10-2019, 05:01 AM
|
#26
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
Quote:
effectivement, il faut relié le raccourcis clavier concerné à l'action no-op, no action
|
Ou ne le relier à rien du tout ^^
|
|
|
04-10-2019, 05:01 AM
|
#27
|
Human being with feelings
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
|
Quote:
Originally Posted by X-Raym
Ou ne le relier à rien du tout ^^
|
non... viens de tester
|
|
|
04-10-2019, 05:05 AM
|
#28
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
@Reno
Ok, moi je l'avais sur une autre action qui ne faisait rien non plus, pour ça que ça marchait sans le beep surement.
Dans certains cas je pense qu'il faut être assez prudent sur ce qui est focus, bien vérifier que c'est l'arrange view, par exemple, ou que a souris est bien au dessus d'un item etc..
Mon script ne gérait pas le focus donc même si j'écrivais "G" dans un champs de nom de pistes ça changeait la grille.
|
|
|
05-02-2019, 04:37 PM
|
#29
|
Human being with feelings
Join Date: Jun 2014
Location: Paris France
Posts: 157
|
Waou! vous êtes trop forts!! J'étais passé à côté de ces infos, ça ouvre des perspectives cool super innovantes pour l'ergonomie. Le genre de truc dont on ne pourra plus se passer si on y goute!!
|
|
|
05-18-2020, 08:56 AM
|
#30
|
Human being with feelings
Join Date: Sep 2016
Posts: 513
|
Quote:
Originally Posted by Reno.thestraws
J'en suis là
https://drive.google.com/open?id=1dD...0u-qj7GFke6TtU
Bord guache -> ouverture des toolbars et refermeture dès la souris n'est plus au dessus
Bord droit -> ouverture du docker droit
Bord bas / moitié guache de l'écran -> ouverture mixeur
Bord bas / moitié droite de l'écran -> ouverture du docker du bas
Bord haut (avec zone du menu inactive) -> fermeture du mixer et des docker
C'est hyper pratique et libère des icones et raccourcis clavier d'ouverture de tout ce beau monde
Le code, pour ceux que ca inspire
Code:
function SetButtonState( set ) -- Set ToolBar Button State
if not set then set = 0 end
local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
local state = reaper.GetToggleCommandStateEx( sec, cmd )
reaper.SetToggleCommandState( sec, cmd, set ) -- Set ON
reaper.RefreshToolbar2( sec, cmd )
end
function Main()
mouse_x, mouse_y = reaper.GetMousePosition()
screen_left, screen_top, screen_right, screen_bottom = reaper.JS_Window_MonitorFromRect(0, 0, 0, 0, false)
toolbar_8_state = reaper.GetToggleCommandState(41686)--toolbar 8 command id
toolbar_dock_state = reaper.GetToggleCommandState(41084)--toolbar docker state
mixer_state = reaper.GetToggleCommandState(40078)--mixer state
fx_browser_state = reaper.GetToggleCommandState(40271)--Fx Browser state
resources_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"))--resources state
region_state = reaper.GetToggleCommandState(40326)--region manager state
groove_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"))--resources state
fx_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_WNTGL4"))--resources state
screen_width = screen_right - screen_left
if mouse_x == 0 and toolbar_8_state == 0 then -- open left toolbar
reaper.Main_OnCommand(41686,0)-- open/close toolbar 8
reaper.Main_OnCommand(41943,0)-- open/close toolbar 16
end
if mouse_x >= screen_left + 130 and toolbar_8_state == 1 then -- action to close toolbar 1
reaper.Main_OnCommand(41686,0) -- open/close toolbar 1
reaper.Main_OnCommand(41943,0)-- open/close toolbar 16
end
if mouse_x == screen_right and region_state == 0 and fx_browser_state == 0 then -- open browser
reaper.Main_OnCommand(40271,0)-- open FX browser
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"),0)-- open resources
reaper.Main_OnCommand(40326,0)-- open Region Manager
reaper.Main_OnCommand(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"),0)-- open groove
end
if mouse_y <= 15 and region_state == 1 and fx_browser_state == 1 then -- close browser
reaper.Main_OnCommand(40271,0)-- close FX browser
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"),0)-- close resources
reaper.Main_OnCommand(40326,0)-- close Region Manager
reaper.Main_OnCommand(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"),0)-- close groove
end
if mouse_y == screen_bottom and mouse_x >= screen_width * 0.5 and toolbar_dock_state == 0 then
reaper.Main_OnCommand(41084,0) -- open toolbar docker
end
if mouse_y <= 15 and mouse_x >= screen_width * 0.25 and toolbar_dock_state == 1 then
reaper.Main_OnCommand(41084,0) -- close toolbar docker
end
if mouse_y == screen_bottom and mouse_x <= screen_width * 0.5 and mixer_state == 0 then
reaper.Main_OnCommand(40078,0) -- open Mixer
end
if mouse_y <= 15 and mouse_x >= screen_width * 0.25 and mixer_state == 1 then
reaper.Main_OnCommand(40078,0) -- close mixer
end
--reaper.ShowConsoleMsg(mouse)
reaper.defer(Main)
end
SetButtonState( 1 )
Main()
reaper.atexit( SetButtonState )
|
Bonjour et encor merci pour ce super scrip J'ai une petite question sur cette évolution du scrip quelle ligne modifier pour remplacer par ces propre tool basre s'il vous plais suis un peut perdu
|
|
|
05-18-2020, 11:14 AM
|
#31
|
Human being with feelings
Join Date: Sep 2016
Posts: 513
|
J'ai finalement trouver javais pas vue a cette ligne qu'il y a ecrit toolbar 1 mais l'id est celui de la toolbar 8
reaper.Main_OnCommand(41686,0) -- open/close toolbar 1
Merci Reno pour ce fantastic script
|
|
|
05-18-2020, 12:12 PM
|
#32
|
Human being with feelings
Join Date: Sep 2016
Posts: 513
|
Je ne comprend tout de meme pas tout ce qui ce passe les barre top et left fonctionne mais pas le mixer le fx brows en fait rien ne se passe quand je met ma souris en bas ou a droite
|
|
|
05-18-2020, 12:15 PM
|
#33
|
Human being with feelings
Join Date: Sep 2016
Posts: 513
|
Quote:
Originally Posted by grandfougue
Je ne comprend tout de meme pas tout ce qui ce passe quand les barre top et left fonctionne mais rien ne se passe quand je met ma souris en bas ou a droite
|
Pouvez vous m'expliquer s'il vous plait.
Ce serait vraiment cool un video pour expliquer le fonctionnement Merci en tous cas .
|
|
|
09-15-2020, 02:33 PM
|
#34
|
Human being with feelings
Join Date: Sep 2016
Posts: 513
|
Quote:
Originally Posted by Reno.thestraws
J'en suis là
https://drive.google.com/open?id=1dD...0u-qj7GFke6TtU
Bord guache -> ouverture des toolbars et refermeture dès la souris n'est plus au dessus
Bord droit -> ouverture du docker droit
Bord bas / moitié guache de l'écran -> ouverture mixeur
Bord bas / moitié droite de l'écran -> ouverture du docker du bas
Bord haut (avec zone du menu inactive) -> fermeture du mixer et des docker
C'est hyper pratique et libère des icones et raccourcis clavier d'ouverture de tout ce beau monde
Le code, pour ceux que ca inspire
Code:
function SetButtonState( set ) -- Set ToolBar Button State
if not set then set = 0 end
local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
local state = reaper.GetToggleCommandStateEx( sec, cmd )
reaper.SetToggleCommandState( sec, cmd, set ) -- Set ON
reaper.RefreshToolbar2( sec, cmd )
end
function Main()
mouse_x, mouse_y = reaper.GetMousePosition()
screen_left, screen_top, screen_right, screen_bottom = reaper.JS_Window_MonitorFromRect(0, 0, 0, 0, false)
toolbar_8_state = reaper.GetToggleCommandState(41686)--toolbar 8 command id
toolbar_dock_state = reaper.GetToggleCommandState(41084)--toolbar docker state
mixer_state = reaper.GetToggleCommandState(40078)--mixer state
fx_browser_state = reaper.GetToggleCommandState(40271)--Fx Browser state
resources_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"))--resources state
region_state = reaper.GetToggleCommandState(40326)--region manager state
groove_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"))--resources state
fx_state = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_WNTGL4"))--resources state
screen_width = screen_right - screen_left
if mouse_x == 0 and toolbar_8_state == 0 then -- open left toolbar
reaper.Main_OnCommand(41686,0)-- open/close toolbar 8
reaper.Main_OnCommand(41943,0)-- open/close toolbar 16
end
if mouse_x >= screen_left + 130 and toolbar_8_state == 1 then -- action to close toolbar 1
reaper.Main_OnCommand(41686,0) -- open/close toolbar 1
reaper.Main_OnCommand(41943,0)-- open/close toolbar 16
end
if mouse_x == screen_right and region_state == 0 and fx_browser_state == 0 then -- open browser
reaper.Main_OnCommand(40271,0)-- open FX browser
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"),0)-- open resources
reaper.Main_OnCommand(40326,0)-- open Region Manager
reaper.Main_OnCommand(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"),0)-- open groove
end
if mouse_y <= 15 and region_state == 1 and fx_browser_state == 1 then -- close browser
reaper.Main_OnCommand(40271,0)-- close FX browser
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_SHOW_RESOURCES_VIEW"),0)-- close resources
reaper.Main_OnCommand(40326,0)-- close Region Manager
reaper.Main_OnCommand(reaper.NamedCommandLookup("_FNG_GROOVE_TOOL"),0)-- close groove
end
if mouse_y == screen_bottom and mouse_x >= screen_width * 0.5 and toolbar_dock_state == 0 then
reaper.Main_OnCommand(41084,0) -- open toolbar docker
end
if mouse_y <= 15 and mouse_x >= screen_width * 0.25 and toolbar_dock_state == 1 then
reaper.Main_OnCommand(41084,0) -- close toolbar docker
end
if mouse_y == screen_bottom and mouse_x <= screen_width * 0.5 and mixer_state == 0 then
reaper.Main_OnCommand(40078,0) -- open Mixer
end
if mouse_y <= 15 and mouse_x >= screen_width * 0.25 and mixer_state == 1 then
reaper.Main_OnCommand(40078,0) -- close mixer
end
--reaper.ShowConsoleMsg(mouse)
reaper.defer(Main)
end
SetButtonState( 1 )
Main()
reaper.atexit( SetButtonState )
|
Bonjour reno tout marche a part le bord droit n'ouvre aucune bar c'est le bord gauche qui déclance les 2 a la fois pourrais tu méclairer sil te plait ?
|
|
|
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 01:01 PM.
|