Contact us

tel:15797766463

mail:business@seeshiontech.com

中文
English
中文
登录/注册

{user.username}

ID: {user.id}

<span><a href="/docs/index.html">首页</a> > <a href="/docs/en-us/editor/group_123.html">SDK</a> > <a href="/docs/en-us/editor/group_129.html">iOS SDK</a> > SXTrackGroup</span>

SXTrackGroup

Update time : 2020-08-11 16:45:34

Multiple tracks can be contained in a track group.

/**
* Add a track to track group at a certain point-in-time. If the track is incompatible, return false. 
* @param track Track
* @param time Time is relative to the timeline of group. 

* @return Return true if the track is added successfully, otherwise return false. 
*/
- (BOOL)addTrack:(SXTrack *)track inPoint:(double)time;
/**
* Set the start display time for the track, and invoking this method will result in changing whole  duration simultaneously.  
* @param trackId The unique track ID. 
* @param time Time is relative to the group timeline.
* @return Return false if failing to find track, in point beyond the range of start time and out point, otherwise return true.  
*/
- (BOOL)setTrack:(NSString *)trackId inPoint:(double)time;
/**
* Set display duration of track, and the duration is allowed to be longer than end time, which will result in looping the track automatically. 
* @param trackId The unique track ID.  
* @param time Time is relative to group timeline. 
* @return Return false if failing to find track or the duration less than 0, otherwise return true. 
*/
- (BOOL)setTrack:(NSString *)trackId duration:(double)time;
/**
* Offset the entire track.  
* @param trackId The unique track ID.
* @param time The offset duration.  
* @returnReturn false if failing to find track or the track becomes incompatible resulting from offset, otherwise return true.  
*/
- (BOOL)setTrack:(NSString *)trackId offset:(double)time
//example:
SXTrack *track = [group splitTrack:track.getTrackId time: time];
if (track) {
}
//example:
if (transitionPath) {
        int error;
//Add a transition.  
        [_editManager.mainGroup addTransition:transitionPath trackId:mediaTrack.getTrackId duration:duration error:&amp;error];
}else {
//Remove the transition. 
        [_editManager.mainGroup removeTransition:mediaTrack.getTrackId];
}
//example:
SXMainTrackGroup *mainTrackGroup = (SXMainTrackGroup *)_editManager.mainGroup;
if (!mainTrackGroup) {
   return;
}
if (!_colorAdujst) {
//Add color grading.  
   _colorAdujst = [mainTrackGroup addColorAdjust];
   [_colorAdujst setEffectFollowType:SXEffectTimeFollowTypeNone];
   _colorAdujst.startTime = _startTime;
   _colorAdujst.duration = MIN(_editManager.editDuration - _startTime, 3);
}