Old 04-14-2019, 10:52 AM   #1
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 9,735
Default script : Ouvrir editeur Midi et zoomer sur le contenu

Voici un petit script qui se place dans le mouse modifier item dbl click

Ca fait exactement la même chose que l'action originale si ce n'est que si, c'est un item MIDI, l'éditeur zoom sur la totalité du contenu

Code:
reaper.Undo_BeginBlock2(0)
function Main ()
item = reaper.GetSelectedMediaItem(0, 0)
take =  reaper.GetMediaItemTake(item, 0)
PCM_source = reaper.GetMediaItemTake_Source(take)
typesrc = reaper.GetMediaSourceType(PCM_source,0)
--reaper.ShowConsoleMsg (typesrc)
  if typesrc == "RPP_PROJECT" then
    reaper.Main_OnCommand(40109,0)
  
  elseif typesrc == "MIDI" then
      reaper.Main_OnCommand(40153,0)
      editor = reaper.MIDIEditor_GetActive()
      reaper.MIDIEditor_OnCommand(editor, 40468)
  
   
  elseif typesrc == "MIDIPOOL" then
      reaper.Main_OnCommand(40153,0)
      editor = reaper.MIDIEditor_GetActive()
      reaper.MIDIEditor_OnCommand(editor, 40468)
  else
      reaper.Main_OnCommand(40009,0)
  end
end
 
Main()
reaper.Undo_EndBlock2(0, "Open Item", 0)
Reno.thestraws is offline   Reply With Quote
Old 04-14-2019, 02:30 PM   #2
Vincent Sermonne
Human being with feelings
 
Vincent Sermonne's Avatar
 
Join Date: Feb 2009
Location: Marseille France
Posts: 5,977
Default

Merci Reno ! j'adopte !
__________________
Vincent
ReaperDrummer
http://www.tchackpoum.fr
Vincent Sermonne is offline   Reply With Quote
Old 04-15-2019, 10:27 AM   #3
nanardo
Human being with feelings
 
nanardo's Avatar
 
Join Date: Oct 2009
Posts: 630
Default

Thanks,
Adopté et modifié
-Ouvre l'éditeur midi ou zoom sur les objets audio
Code:
reaper.Undo_BeginBlock2(0)
function Main ()
item = reaper.GetSelectedMediaItem(0, 0)
take =  reaper.GetMediaItemTake(item, 0)
PCM_source = reaper.GetMediaItemTake_Source(take)
typesrc = reaper.GetMediaSourceType(PCM_source,0)
--reaper.ShowConsoleMsg (typesrc)
  if typesrc == "RPP_PROJECT" then
    reaper.Main_OnCommand(40109,0)
  
  elseif typesrc == "MIDI" then
      reaper.Main_OnCommand(40153,0)
      editor = reaper.MIDIEditor_GetActive()
      reaper.MIDIEditor_OnCommand(editor, 40468)
  
   
  elseif typesrc == "MIDIPOOL" then
      reaper.Main_OnCommand(40153,0)
      editor = reaper.MIDIEditor_GetActive()
      reaper.MIDIEditor_OnCommand(editor, 40468)
  else
      reaper.Main_OnCommand(41622,0)
  end
end
 
Main()
reaper.Undo_EndBlock2(0, "Open Item", 0)

Last edited by Vincent Sermonne; 04-16-2019 at 02:06 PM.
nanardo 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 02:40 AM.


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