RPR GetMediaItemTake Item

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(Python)
(Python)
Line 56: Line 56:
#
#
CURR_PROJ,FIRST_SEL_ITEM,FIRST_TAKE = 0,0,0;
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
# Get the first selected media item in the current project
-
my it = RPR_GetSelectedMediaItem(CURR_PROJ, FIRST_SEL_ITEM);
+
it = RPR_GetSelectedMediaItem(CURR_PROJ, FIRST_SEL_ITEM);
# and now the take in that item
# and now the take in that item
-
my take = RPR_GetMediaItemTake(it, FIRST_TAKE);
+
take = RPR_GetMediaItemTake(it, FIRST_TAKE);
# now back up to the Media Item
# now back up to the Media Item
-
my item = RPR_GetMediaItemTake_Item(take);
+
item = RPR_GetMediaItemTake_Item(take);
# check if they match...
# check if they match...
if(it == item ):
if(it == item ):
     result = 'Woo Hoo!';
     result = 'Woo Hoo!';
else:
else:
-
     rresult = 'Ah...';
+
     result = 'Ah...';
RPR_ShowConsoleMsg("result\n");
RPR_ShowConsoleMsg("result\n");

Revision as of 14:09, 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;
# Get the first selected media item in the current project
it = RPR_GetSelectedMediaItem(CURR_PROJ, FIRST_SEL_ITEM);
# and now the take in that item
take = RPR_GetMediaItemTake(it, FIRST_TAKE);
# now back up to the Media Item
item = RPR_GetMediaItemTake_Item(take);
# check if they match...
if(it == item ):
    result = 'Woo Hoo!';
else:
    result = '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