RPR AddMediaItemToTrack

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(Returns)
(Examples)
Line 21: Line 21:
==Examples==
==Examples==
 +
===C++===
 +
<pre>
 +
</pre>
===Perl===
===Perl===
<pre>
<pre>
Line 47: Line 50:
</pre>
</pre>
===Python===
===Python===
 +
==See Also==
==See Also==
{{SeeAlsoMediaItemFunctions}}
{{SeeAlsoMediaItemFunctions}}

Revision as of 15:51, 14 November 2009

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

Contents

AddMediaItemToTrack()

MediaItem* AddMediaItemToTrack(MediaTrack* tr)

Creates a new media item in the specified track, the new item is created right at the beginning of the track.

Parameters

Parameter typeNameDescription
MediaTrack*trackA pointer to the track that will contain the new item

Returns

Returns a scalar value because there are no modifiable variables in the parameter list.

Parameter typeDescription
MediaItem*A pointer to the new Media Item

Examples

C++


Perl

#
# AddMediaItemToTrack.pl
#

use strict;
use warnings;

use constant MSGBOX_JUSTOK => 0;
use constant CURR_PROJ => 0;

# Check to make sure there's a track selected
if(RPR_CountSelectedTracks(CURR_PROJ) > 0){
    # Get a reference to the selected track
    my $MediaTrack = RPR_GetSelectedTrack(CURR_PROJ,0);
    # And then use that reference to add a new, very blank, media item
    # We get a reference to the new item returned to us, if it went ok
    if (my $MediaItem = RPR_AddMediaItemToTrack($MediaTrack)){
        # so we can use that reference to make the item long enough to see
        RPR_SetMediaItemInfo_Value($MediaItem, "D_LENGTH", 1.0);
    }
}

Python

See Also

Media Item: AddMediaItemToTrack, CountMediaItems, CountSelectedMediaItems, CountTrackMediaItems, DeleteTrackMediaItem, GetMediaItemInfo_Value, GetMediaItemNumTakes, GetMediaItemTake, GetMediaItemTake_Item, GetMediaItemTake_Source, GetMediaItemTake_Track, GetMediaItemTakeInfo_Value, GetSelectedMediaItem, GetSetMediaItemTakeInfo_String, GetTrackMediaItem, GetTrackNumMediaItems, MoveMediaItemToTrack, SetMediaItemInfo_Value, SetMediaItemTakeInfo_Value, SplitMediaItem

Track: AddMediaItemToTrack, BypassFxAllTracks, CountSelectedTracks, CountTracks, CountTrackMediaItems, DeleteTrack, DeleteTrackMediaItem, EnumTrackMIDIProgramNames, EnumTrackMIDIProgramNamesEx, GetLastTouchedTrack, GetMediaItem_Track, GetMediaItemTake_Track, GetMediaTrackInfo_Value, GetNumTracks, GetSelectedTrack, GetSelectedTrackEnvelope, GetSetMediaTrackInfo_String, GetSetTrackState, GetTrack, GetTrackAutomationMode, GetTrackEnvelope, GetTrackEnvelopeByName, GetTrackGUID, GetTrackInfo, GetTrackMediaItem, GetTrackMIDINoteName, GetTrackMIDINoteNameEx, GetTrackNumMediaItems, GetTrackUIVolPan, GetTrackState, HasTrackMIDIPrograms, HasTrackMIDIProgramsEx, InsertTrackAtIndex, MoveMediaItemToTrack, MuteAllTracks, PlayTrackPreview, PlayTrackPreview2, SetTrackAutomationMode, SetTrackMIDINoteName, SetTrackMIDINoteNameEx, SetTrackSelected, SoloAllTracks, StopTrackPreview, StopTrackPreview2, Track_GetPeakInfo, TrackFX_FormatParamValue, TrackFX_GetCount, TrackFX_GetFXName, TrackFX_GetNumParams, TrackFX_GetParam, TrackFX_GetParamName, TrackFX_SetParam, TrackList_AdjustWindows, TrackList_UpdateAllExternalSurfaces

Stuff

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

Personal tools