Old 12-16-2018, 12:56 PM   #1
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,417
Default GetTakeName returns item name...?

I'm fiddling with EEL-coding and trying to store script parameter values in the item notes, and I've run into this strange thing...

I have an item consisting of two takes, both which have the same source. When the first take is active the name at the top is "Take 1/2: Source.wav", and when the other take is active it says "Take 2/2: Source.wav".

So those strings are what I expect when I call
Code:
bool GetTakeName(#retval, MediaItem_Take take)
with the respective takes active.

To my suprise, I only get "Source.wav", which is (to me) the item name.

What am I missing?
How can I distinguish between the two takes?
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-16-2018, 01:32 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Fabian View Post
How can I distinguish between the two takes?
Use something else than the take names. For example the take pointers/handles directly or the take GUID.

There's no "item" name. The items don't have names, only takes do. (There's always at least 1 take in the items.)

The "Take 1/2" thing is added by the GUI drawing code, it's not actually stored in the takes as part of the name.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-17-2018, 01:27 PM   #3
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,417
Default

The take GUID seems like a good idea.

And of course, I should store script parameters as extstate data.

So for testing this I came up with this, in case someone is interested.

PHP Code:
function CheckSetTakeExtState(take)
local(guidstrok_retvalue)
(
    
guidstr #;
    
ok_ret GetSetMediaItemTakeInfo_String(take"GUID"guidstrGET_INFO);
    
    
value #;
    
ok_ret GetProjExtState(CURRENT_PROJECTEXTNAMEguidstrvalue);
    
ok_ret 
    (
        
ShowConsoleMsg(sprintf(#, "GUID:%s, value: %s\n", guidstr, value));
    
):(
        
SetProjExtState(CURRENT_PROJECTEXTNAMEguidstrsprintf(#, "%.02f", rand()));
    
);
); 
Thanks.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian 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 06:37 AM.


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