Package de.sciss.meloncillo.edit

Examples of de.sciss.meloncillo.edit.CompoundSessionObjEdit


          renderThread = new ProcessingThread( this, root, name );
          renderThread.putClientArg( "span", span );
          renderThread.putClientArg( "trns", collTrns );
          renderThread.putClientArg( "blend", root.getBlending() );
          renderThread.putClientArg( "edit",
              new CompoundSessionObjEdit( this, collTrns,
                  Transmitter.OWNER_TRAJ, null, null, "Pencil" ));
          renderThread.start();
        }
      }
    }
View Full Code Here


     *  time warp is performed as follows:
     *  t'(t) = v_start * t + (v_end - v_start)/2T * t^2 , v_start = (0...2)/T, v_end = 2/T - v_start
     */
    public int processRun( ProcessingThread context )
    {
      final CompoundSessionObjEdit  edit    = (CompoundSessionObjEdit) context.getClientArg( "edit" );
      final List            collTrns  = (List) context.getClientArg( "trns" );
      final BlendContext        bc      = (BlendContext) context.getClientArg( "blend" );
      final Span            span    = (Span) context.getClientArg( "span" );
      final float[][]          srcBuf    = bc == null ? null : new float[ 2 ][ 4096 ];
      final double          t_norm;
      final float[][]          interpBuf;
      final float[]          warpedTime;
      final float            v_start_norm, dv_norm;
      final long            interpLen, progressLen;
      Transmitter            trns;
      AudioTrail            at;
      int                len;
      long              t, tt;
//      BlendSpan            bs;
      // interpLen entspricht 'T' in der Formel (Gesamtzeit), interpOff entspricht 't' (aktueller Zeitpunkt)
      long              start, interpOff;
      long              progress  = 0;
      AudioStake            as;
       
      interpLen   = span.getLength();
      warpedTime  = new float[(int) Math.min( interpLen, 4096 )];
      interpBuf   = new float[2][ warpedTime.length ];

      t_norm      = 1.0 / (interpLen - 1);
      v_start_norm  = (float) (vStart * t_norm);
      dv_norm      = (float) ((vStop - vStart) / 2 * t_norm * t_norm);

//      initFunctionEvaluation();
     
      progressLen      = interpLen*collTrns.size();
     
      try {
        for( int i = 0; i < collTrns.size(); i++ ) {
          trns  = (Transmitter) collTrns.get( i );
          at    = trns.getAudioTrail();

//          bs = at.beginOverwrite( span, bc, edit );
          as = at.alloc( span );

          // XXX has to be called for each trns?
          initFunctionEvaluation();

          for( start = span.getStart(), interpOff = 0; start < span.getStop();
             start += len, interpOff += len ) {
            
            len  = (int) Math.min( 4096, span.getStop() - start );
            t  = interpOff;
            for( int j = 0; j < len; j++, t++ ) {
              tt        = t*t;
              warpedTime[j]   = v_start_norm * t + dv_norm * tt;
//              warpedTime[j]   = (v_start_norm * t + dv_norm * tt) * 1.5f - 0.25f;  // extrap.
            }
            evaluateFunction( warpedTime, interpBuf, len );
            if( bc != null ) {
              at.readFrames( srcBuf, 0, new Span( start, start + len ));
              if( interpOff < bc.getLen() ) {  // EEE getLen?
                bc.blend( interpOff, srcBuf, 0, interpBuf, 0, interpBuf, 0, len );
              }
              if( interpLen - (interpOff + len) < bc.getLen() ) {  // EEE getLen?
                bc.blend( interpOff - (interpLen - bc.getLen()), interpBuf, 0, srcBuf, 0, interpBuf, 0, len );
              }
            }
            as.writeFrames( interpBuf, 0, new Span( start, start + len ));
//            at.continueWrite( bs, interpBuf, 0, len );
            progress += len;
            context.setProgression( (float) progress / (float) progressLen );
          }
          at.editBegin( edit );
          at.editClear( this, span, edit );
          at.editAdd( this, as, edit );
          at.editEnd( edit );
//          at.finishWrite( bs, edit );
        } // for( i = 0; i < collTransmitters.size(); i++ )
       
//        edit.perform();
//        edit.end(); // fires doc.tc.modified()
//        doc.getUndoManager().addEdit( edit );
        return DONE;
      }
      catch( IOException e1 ) {
        edit.cancel();
        context.setException( e1 );
        return FAILED;
      }
    } // run()
View Full Code Here

    final Span span    = doc.timeline.getSelectionSpan();
    final List collTrns  = doc.getSelectedTransmitters().getAll();
    if( span.isEmpty() || collTrns.isEmpty() ) return;

    final AbstractCompoundEdit edit;
    edit = new CompoundSessionObjEdit( this, collTrns, Transmitter.OWNER_TRAJ,
                                       null, null, "Geometric Tool" );

    renderThread = new ProcessingThread( this, root,
        AbstractApplication.getApplication().getResourceString( "toolWriteTransmitter" ));
    renderThread.putClientArg( "points", ctrlPoints );
View Full Code Here

    final ConsumerContext  consc;
    Transmitter        trns;
    AudioTrail        at;
   
    consc      = new ConsumerContext();
    consc.edit    = new CompoundSessionObjEdit( this, context.getTransmitters(), Transmitter.OWNER_TRAJ,
                            null, null, "Filter" );
//    consc.bs    = new BlendSpan[ source.numTrns ];
    consc.as    = new AudioStake[ source.numTrns ];
    consc.bc    = root.getBlending()// XXX THREAD XXX
//    if( consc.bc != null ) consc.srcBuf = new float[ 2 ][ 4096 ];
View Full Code Here

TOP

Related Classes of de.sciss.meloncillo.edit.CompoundSessionObjEdit

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.