RPR CountTakes
From CockosWiki
(→CountTakes()) |
Klankschap (Talk | contribs) m (→Python) |
||
(8 intermediate revisions not shown) | |||
Line 19: | Line 19: | ||
|} | |} | ||
==Examples== | ==Examples== | ||
+ | ===C++=== | ||
+ | <source lang=cpp> | ||
+ | </source> | ||
===Perl=== | ===Perl=== | ||
- | < | + | <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."); | ||
- | </ | + | </source> |
+ | |||
===Python=== | ===Python=== | ||
- | < | + | <source lang=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." ) | ||
+ | </source> | ||
+ | |||
==See Also== | ==See Also== | ||
- | + | {{SeeAlso_take}} | |
- | + | ||
+ | ''(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 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