Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 07-19-2016, 04:15 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,584
Default ReaScript: MIDIEditor_GetTake returns take object even if no take is active

MIDIEditor_GetTake is intended to return the take that is currently being edited in the MIDI editor.

However, if the MIDI editor has no active take, which may happen when "Close editor when the active item is deleted in the arrange view" is DEselected in Preferences -> MIDI editor, the function still returns a take object instead of nil.

Moreover, the returned take object is invalid, so I assume that it refers to one of the deleted takes.

A script can therefore not reliably test whether the MIDI editor has an active take, and this may lead to errors (as demonstrated in http://forum.cockos.com/showthread.p...54#post1708154).
juliansader is online now   Reply With Quote
Old 07-19-2016, 12:11 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,671
Default

There is a way to check if it's a real existing take in the current project with ValidatePtr: https://forum.cockos.com/showthread.php?p=1666283

Last edited by cfillion; 07-19-2016 at 12:20 PM.
cfillion is offline   Reply With Quote
Old 07-19-2016, 04:24 PM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,584
Default

This workaround works, thanks!
juliansader is online now   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 03:28 PM.


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