RPR CountTakes
From CockosWiki
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 type | Name | Description |
---|---|---|
MediaItem* | item | A pointer to a Media Item |
Returns
Returns a scalar value.
Type | Description |
---|---|
integer | The 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