RPR GetMediaItemTake Item

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(See Also)
(Python)
Line 52: Line 52:
===Python===
===Python===
<pre>
<pre>
 +
#
 +
# GetMediaItemTake_Item.py
 +
#
 +
CURR_PROJ,FIRST_SEL_ITEM,FIRST_TAKE = 0,0,0;
 +
# Bit artificial this, I have to start off from where I'm going to end up,
 +
# at the Media Item - but not to worry, I'll check it out at the end
 +
# Get the first selected media item in the current project
 +
my it = RPR_GetSelectedMediaItem(CURR_PROJ, FIRST_SEL_ITEM);
 +
# and now the take in that item
 +
my take = RPR_GetMediaItemTake(it, FIRST_TAKE);
 +
# now back up to the Media Item
 +
my item = RPR_GetMediaItemTake_Item(take);
 +
# check if they match...
 +
if(it == item ):
 +
    result = 'Woo Hoo!';
 +
else:
 +
    rresult = 'Ah...';
 +
RPR_ShowConsoleMsg("result\n");
 +
</pre>
</pre>
 +
==See Also==
==See Also==
{{SeeAlso_item}}
{{SeeAlso_item}}

Revision as of 14:08, 12 December 2009

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetMediaItemTake Item
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetMediaItemTake Item

Contents

GetMediaItemTake_Item()

MediaItem* GetMediaItemTake_Item(MediaItem_Take* take)

Get parent item of media item take

Parameters

MediaItem_Take* take

Returns

MediaItem*

Examples

C++


Perl

#
# GetMediaItemTake_Item.pl
#

use strict;
use warnings;

use constant CURR_PROJ => 0;
use constant FIRST_SEL_ITEM => 0;
use constant FIRST_TAKE => 0;

# Bit artificial this, I have to start off from where I'm going to end up,
# at the Media Item - but not to worry, I'll check it out at the end

# Get the first selected media item in the current project
my $it = RPR_GetSelectedMediaItem(CURR_PROJ,FIRST_SEL_ITEM);

# and now the take in that item
my $take = RPR_GetMediaItemTake($it, FIRST_TAKE);

# now back up to the Media Item
my $item = RPR_GetMediaItemTake_Item($take);

# check if they match...
my $result;

if( $it == $item ){
    $result = 'Woo Hoo!'
} else {
    $result = 'Ah...';
}

RPR_ShowConsoleMsg("$result\n");

Python

#
# GetMediaItemTake_Item.py
#
CURR_PROJ,FIRST_SEL_ITEM,FIRST_TAKE = 0,0,0;
# Bit artificial this, I have to start off from where I'm going to end up,
# at the Media Item - but not to worry, I'll check it out at the end
# Get the first selected media item in the current project
my it = RPR_GetSelectedMediaItem(CURR_PROJ, FIRST_SEL_ITEM);
# and now the take in that item
my take = RPR_GetMediaItemTake(it, FIRST_TAKE);
# now back up to the Media Item
my item = RPR_GetMediaItemTake_Item(take);
# check if they match...
if(it == item ):
    result = 'Woo Hoo!';
else:
    rresult = 'Ah...';
RPR_ShowConsoleMsg("result\n");

See Also

item: AddMediaItemToTrack, AddTakeToMediaItem, GetTrackMediaItem, GetTrackNumMediaItems, CountMediaItems, CountSelectedMediaItems, GetItemProjectContext, SetMediaItemInfo_Value, CountTrackMediaItems, SetMediaItemTakeInfo_Value, GetMediaItem, GetMediaItem_Track, GetMediaItemInfo_Value, GetMediaItemNumTakes, GetMediaItemTake, GetMediaItemTake_Item, GetMediaItemTake_Source, GetMediaItemTake_Track, GetMediaItemTakeInfo_Value, SplitMediaItem, MoveMediaItemToTrack, GetSelectedMediaItem, DeleteTrackMediaItem, GetSetItemState, GetSetMediaItemTakeInfo_String, Undo_OnStateChange_Item, UpdateItemInProject,

take: GetActiveTake, GetMediaItemNumTakes, GetMediaItemTake, GetMediaItemTakeInfo_Value, GetMediaItemTake_Item, GetMediaItemTake_Source, GetMediaItemTake_Track, GetSetMediaItemTakeInfo_String, GetTake, GetTakeEnvelopeByName, SetMediaItemTakeInfo_Value, AddTakeToMediaItem, CountTakes,

(Section automatically generated, edits may be overwritten.)

Stuff

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetMediaItemTake Item
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetMediaItemTake Item

Personal tools