RPR GetMediaItemTake Item

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(MediaItem* GetMediaItemTake_Item(MediaItem_Take* take))
(Perl)
Line 10: Line 10:
<pre>
<pre>
#
#
-
# GetMediaItem_Take.pl
+
# GetMediaItemTake_Item.pl
#
#
Line 21: Line 21:
# Bit artificial this, I have to start off from where I'm going to end up,
# Bit artificial this, I have to start off from where I'm going to end up,
-
# at the Media Item
+
# 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
Line 30: Line 30:
# now back up to the Media Item
# now back up to the Media Item
-
my $item = RPR_GetMediaItem_Take($take);
+
my $item = RPR_GetMediaItemTake_Item($take);
# check if they match...
# check if they match...
-
my $result = iif($it == $item, 'Woo Hoo!', 'Oops...');
+
my $result;
 +
 
 +
if( $it == $item ){
 +
    $result = 'Woo Hoo!'
 +
} else {
 +
    $result = 'Ah...';
 +
}
RPR_ShowConsoleMsg("$result\n");
RPR_ShowConsoleMsg("$result\n");
 +
</pre>
</pre>
 +
===Python===
===Python===
<pre>
<pre>

Revision as of 23:39, 30 October 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

MediaItem* GetMediaItemTake_Item(MediaItem_Take* take)

Get parent item of media item take

Parameters

MediaItem_Take* take

Returns

MediaItem*

Examples

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


See Also

GetSelectedMediaItem, GetMediaItemTake, ShowConsoleMsg

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