RPR CountTakes

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(CountTakes())
m (Python)
 
(8 intermediate revisions not shown)
Line 19: Line 19:
|}
|}
==Examples==
==Examples==
 +
===C++===
 +
<source lang=cpp>
 +
</source>
===Perl===
===Perl===
-
<pre>
+
<source lang=perl>
#
#
# CountTakes.pl
# CountTakes.pl
Line 35: Line 38:
RPR_ShowConsoleMsg("There are $num_takes takes in the selected media item.");
RPR_ShowConsoleMsg("There are $num_takes takes in the selected media item.");
-
</pre>
+
</source>
 +
 
===Python===
===Python===
-
<pre>
+
<source lang=python>
-
</pre>
+
# --------------
 +
# CountTakes.py
 +
# --------------
 +
# get the first selected media item in the current project (0)
 +
CURR_PROJ = 0
 +
FIRST_ITEM = 0
 +
 
 +
selected_media_item = RPR_GetSelectedMediaItem( CURR_PROJ, FIRST_ITEM )
 +
 
 +
# count the takes and convert result to string
 +
num_takes = RPR_CountTakes( selected_media_item )
 +
 
 +
# show msg
 +
RPR_ShowConsoleMsg( "There are " + str(num_takes) + " takes in the selected media item." )
 +
</source>
 +
 
==See Also==
==See Also==
-
[[RPR_GetSelectedMediaItem|GetSelectedMediaItem]],
+
{{SeeAlso_take}}
-
[[RPR_ShowConsoleMsg|ShowConsoleMsg]]
+
 
 +
''(Section automatically generated, edits may be overwritten.)''
 +
 
==Stuff==
==Stuff==
{{API_Doc_Footer}}
{{API_Doc_Footer}}
Line 47: Line 68:
[[Category:ReaScript]]
[[Category:ReaScript]]
[[Category:Perl]]
[[Category:Perl]]
 +
[[Category:ReaPerl]]
 +
[[Category:ReaPython]]
[[Category:Python]]
[[Category:Python]]

Latest revision as of 20:46, 9 December 2011

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR CountTakes
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR CountTakes

Contents

CountTakes()

int CountTakes(MediaItem* item)

Counts and returns the number of takes in a specifed Media Item.

Parameters

Parameter typeNameDescription
MediaItem*itemA pointer to a Media Item

Returns

Returns a scalar value.

TypeDescription
integerThe number of takes in the specifed Media Item.

Examples

C++

 

Perl

#
# CountTakes.pl
#
 
use strict;
use warnings;
 
# Get the first selected Media Item in the current project
my $selected_media_item = RPR_GetSelectedMediaItem(0,0);
 
# Now count the takes in that Media Item
my $num_takes = RPR_CountTakes($selected_media_item);
 
RPR_ShowConsoleMsg("There are $num_takes takes in the selected media item.");

Python

# --------------
# CountTakes.py
# --------------
# get the first selected media item in the current project (0)
CURR_PROJ = 0
FIRST_ITEM = 0
 
selected_media_item = RPR_GetSelectedMediaItem( CURR_PROJ, FIRST_ITEM )
 
# count the takes and convert result to string 
num_takes = RPR_CountTakes( selected_media_item )
 
# show msg
RPR_ShowConsoleMsg( "There are " + str(num_takes) + " takes in the selected media item." )

See Also

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 CountTakes
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR CountTakes

Personal tools