Package de.sciss.timebased

Examples of de.sciss.timebased.Trail


  }

  public static List getInfos( List selectedTracks, List allTracks )
  {
    Track          track;
    Trail          trail;
    Track.Info        ti;
    int            chan;
    final Map        mapInfos  = new HashMap();
    final List        collInfos  = new ArrayList();
   
    for( int i = 0; i < allTracks.size(); i++ ) {
      track  = (Track) allTracks.get( i );
//System.err.println( "for track "+track.getClass().getName()+" ..." );
      trail  = track.getTrail();
//System.err.println( "... trail = "+trail.getClass().getName() );
      ti    = (Track.Info) mapInfos.get( trail.getClass() );   
      if( ti == null ) {
        ti  = new Info( trail );
        mapInfos.put( ti.trail.getClass(), ti );
        collInfos.add( ti );
      }
View Full Code Here


      final Span            copySpan      = (Span) context.getClientArg( "copySpan" );
      final boolean          cutTimeline      = ((Boolean) context.getClientArg( "cut" )).booleanValue();
      final Span            cutTimelineSpan    = (Span) context.getClientArg( "cutSpan" );
      final long            delta        = insertPos - tl.getSpan().start;
      Track.Info            ti;
      Trail              srcTrail;
      AudioTrail            audioTrail;
      boolean[]            trackMap;
      boolean              isAudio, pasteAudio;

      for( int i = 0; i < tis.size(); i++ ) {
        ti    = (Track.Info) tis.get( i );
        if( ti.selected ) {  // ----------------- selected tracks -----------------
          try {
            ti.trail.editBegin( edit );
            isAudio  = ti.trail instanceof AudioTrail;
            srcTrail = tl.getSubTrail( ti.trail.getClass() );
         
            if( isAudio ) {
              pasteAudio = (srcTrail != null) && (((AudioTrail) srcTrail).getChannelNum() > 0);
            } else {
              pasteAudio = false;
            }
           
            if( mode == EDIT_INSERT ) {
              ti.trail.editInsert( this, insertSpan, edit );
              if( cutTimeline ) ti.trail.editRemove( this, cutTimelineSpan, edit );
//              } else if( (mode == EDIT_OVERWRITE) && (pasteAudio || !isAudio) ) { // Audio needs to be cleared even in Mix mode!
            } else if( pasteAudio || ((mode == EDIT_OVERWRITE) && !isAudio) ) { // Audio needs to be cleared even in Mix mode!
              ti.trail.editClear( this, insertSpan, edit );
            }
           
            if( pasteAudio ) {
              audioTrail      = (AudioTrail) ti.trail;
              trackMap  = tl.getTrackMap( ti.trail.getClass() );
             
//System.err.println( "clipboard tm : " );
//for( int x = 0; x < trackMap.length; x++ ) { System.err.println( "  " + trackMap[ x ]); }
              int[] trackMap2 = new int[ audioTrail.getChannelNum() ];
              for( int j = 0, k = 0; j < trackMap2.length; j++ ) {
                if( ti.trackMap[ j ]) {  // target track selected
                  for( ; (k < trackMap.length) && !trackMap[ k ] ; k++ ) ;
                  if( k < trackMap.length ) {  // source track exiting
                    trackMap2[ j ] = k++;
                  } else if( tl.getTrackNum( ti.trail.getClass() ) > 0 ) {    // ran out of source tracks, fold over (simple mono -> stereo par exemple)
                    for( k = 0; !trackMap[ k ] ; k++ ) ;
                    trackMap2[ j ] = k++;
                  } else {
                    trackMap2[ j ] = -1;    // there aren't any clipboard tracks ....
                  }
                } else {              // target track not selected
                  trackMap2[ j ] = -1;
                }
              }
              if( !audioTrail.copyRangeFrom( (AudioTrail) srcTrail, copySpan, insertPos, mode, this, edit, trackMap2, bcPre, bcPost )) return CANCELLED;

            } else if( (ti.numTracks == 1) && (tl.getTrackNum( ti.trail.getClass() ) == 1) ) {
              ti.trail.editAddAll( this, srcTrail.getCuttedRange(
                copySpan, true, srcTrail.getDefaultTouchMode(), delta ), edit );
            }
          }
          finally {
            ti.trail.editEnd( edit );
          }
View Full Code Here

 
    this.span  = span;
   
    final List        infos = Track.getInfos( tracks, doc.tracks.getAll() );
    Track.Info        ti;
    Trail          subTrail;
    Set            setTrackLists;
   
    for( int i = 0; i < infos.size(); i++ ) {
      ti      = (Track.Info) infos.get( i );
      subTrail  = ti.trail.getCuttedTrail( span, Trail.TOUCH_SPLIT, 0 );
View Full Code Here

   
System.out.println( "copy:" );
Track.debugDump( collInfos );
   
    Track.Info  ti;
    Trail    subTrail;
    Set      setTrackLists;
   
    mapInfos  = new HashMap( collInfos.size() );
    mapTrails  = new HashMap( collInfos.size() );
    collTrails  = new ArrayList( collInfos.size() );
View Full Code Here

      final Span            copySpan      = (Span) context.getClientArg( "copySpan" );
      final boolean          cutTimeline      = ((Boolean) context.getClientArg( "cut" )).booleanValue();
      final Span            cutTimelineSpan    = (Span) context.getClientArg( "cutSpan" );
      final long            delta        = insertPos - tl.getSpan().start;
      Track.Info            ti;
      Trail              srcTrail;
      AudioTrail            audioTrail;
//      Transmitter            trns;
      boolean[]            trackMap;
      boolean              isAudio, isTrns, pasteAudio;

//System.out.println( "paste to:" );
//Track.debugDump( tis );

      for( int i = 0; i < tis.size(); i++ ) {
        ti    = (Track.Info) tis.get( i );
        if( ti.selected ) {  // ----------------- selected tracks -----------------
          try {
            ti.trail.editBegin( edit );
// EEE
//            isAudio  = ti.track instanceof AudioTrack;
isAudio = false;
            isTrns    = ti.tracks.get( 0 ) instanceof Transmitter;
            srcTrail  = tl.getSubTrail( ti.trail.getClass(), ti.trackIndex );
         
            if( isAudio ) {
              pasteAudio = (srcTrail != null) && (((AudioTrail) srcTrail).getChannelNum() > 0);
            } else if( isTrns ) {
              pasteAudio = (srcTrail != null);
            } else {
              pasteAudio = false;
            }
           
            if( mode == EDIT_INSERT ) {
              ti.trail.editInsert( this, insertSpan, edit );
              if( cutTimeline ) ti.trail.editRemove( this, cutTimelineSpan, edit );
            } else if( pasteAudio || ((mode == EDIT_OVERWRITE) && !(isAudio || isTrns)) ) { // Audio needs to be cleared even in Mix mode!
              ti.trail.editClear( this, insertSpan, edit );
            }
           
            if( pasteAudio ) {
              audioTrail  = (AudioTrail) ti.trail;
              trackMap  = tl.getChannelMap( srcTrail );
             
              final int[] trackMap2 = new int[ audioTrail.getChannelNum() ];
              for( int j = 0, k = 0; j < trackMap2.length; j++ ) {
                if( ti.channelMap[ j ]) {  // target track selected
                  for( ; (k < trackMap.length) && !trackMap[ k ] ; k++ ) ;
                  if( k < trackMap.length ) {  // source track exiting
                    trackMap2[ j ] = k++;
                  } else if( tl.getTrackNum( ti.trail.getClass() ) > 0 ) {    // ran out of source tracks, fold over (simple mono -> stereo par exemple)
                    for( k = 0; !trackMap[ k ] ; k++ ) ;
                    trackMap2[ j ] = k++;
                  } else {
                    trackMap2[ j ] = -1;    // there aren't any clipboard tracks ....
                  }
                } else {              // target track not selected
                  trackMap2[ j ] = -1;
                }
              }
              if( !audioTrail.copyRangeFrom( (AudioTrail) srcTrail, copySpan, insertPos, mode, this, edit, trackMap2, bcPre, bcPost )) return CANCELLED;

            } else if( (ti.tracks.size() == 1) && (tl.getTrackNum( ti.trail.getClass() ) == 1) ) {
              ti.trail.editAddAll( this, srcTrail.getCuttedRange(
                copySpan, true, srcTrail.getDefaultTouchMode(), delta ), edit );
            }
          }
          finally {
            ti.trail.editEnd( edit );
          }
View Full Code Here

  }
 
  public static List getInfos( List selectedTracks, List allTracks )
  {
    Track          track;
    Trail          trail;
    Track.Info        ti;
    int            chan;
    MutableInt        count;
    final Map        mapInfos  = new HashMap();
    final List        collInfos  = new ArrayList();
    final Map        mapCounts  = new HashMap();
   
    for( int i = 0; i < allTracks.size(); i++ ) {
      track  = (Track) allTracks.get( i );
      trail  = track.getTrail();
      ti    = (Track.Info) mapInfos.get( trail );
      count  = (MutableInt) mapCounts.get( trail.getClass() );
      if( count == null ) {
        count = new MutableInt( 0 );
        mapCounts.put( trail.getClass(), count );
      }
      if( ti == null ) {
        ti  = new Info( trail, count.value() );
        mapInfos.put( trail, ti );
        collInfos.add( ti );
View Full Code Here

TOP

Related Classes of de.sciss.timebased.Trail

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.