Package de.sciss.common

Examples of de.sciss.common.ProcessingThread$Event


    protected void perform()
    {   
      final Span        span  = timeline.getSelectionSpan(); // XXX sync
      if( span.isEmpty() ) return;
     
      final ProcessingThread  proc    = initiate( getValue( NAME ).toString(), span, getEditMode() );
      if( proc != null ) start( proc );
    }
View Full Code Here


          } // else visiSpan untouched
        }
        edit.addPerform( new EditSetTimelineLength( this, Session.this, newDocLength ));
      }

      final ProcessingThread proc = new ProcessingThread( this, getFrame(), procName );
      proc.putClientArg( "span", span );
      proc.putClientArg( "mode", new Integer( mode ));
      proc.putClientArg( "tis", tis );
      proc.putClientArg( "edit", edit );
      proc.putClientArg( "bc", bc );
      proc.putClientArg( "cut", new Boolean( cutTimeline ));
      proc.putClientArg( "cutSpan", cutTimelineSpan );
      return proc;
    }
View Full Code Here

    {
      final RecorderDialog    recDlg;
      final File          recFile;
      final Session        tmpDoc;
      final ClipboardTrackList  tl;
      final ProcessingThread    pt;
      final Session        targetDoc;
      final AudioFileDescr    afd, afd2;
   
      try {
        recDlg  = new RecorderDialog( doc );
      }
      catch( IOException e1 ) {
        BasicWindowHandler.showErrorDialog( getWindow(), e1, getValue( NAME ).toString() );
        return;
      }
      recFile  = recDlg.getResult();
     
      if( recFile != null ) {
        try {
//          if( true ) throw new IOException( "test" );
          tmpDoc  = Session.newFrom( recFile, false, false );
        }
        catch( IOException e1 ) {
          GUIUtil.displayError( getWindow(), e1, getValue( NAME ).toString() );
          confirmDelete( recFile );
          return;
        }
        tl    = new ClipboardTrackList( tmpDoc, new Span( 0, tmpDoc.timeline.getLength() ), tmpDoc.tracks.getAll() );
        if( doc.checkProcess()) {
          targetDoc      = doc;
        } else // doc busy, save the recording by creating a separate document
          afd          = doc.getDisplayDescr();
          afd2        = new AudioFileDescr();
          afd2.bitsPerSample  = afd.bitsPerSample;
          afd2.channels    = afd.channels;
          afd2.rate      = afd.rate;
          afd2.sampleFormat  = afd.sampleFormat;
          targetDoc      = ((MenuFactory) app.getMenuFactory()).newDocument( afd2 );
        }
//pt = null;
        pt = targetDoc == null ? null : targetDoc.pasteTrackList( tl, targetDoc.timeline.getPosition(), getValue( NAME ).toString(), targetDoc.getEditMode() );

        if( pt != null ) {
          pt.addListener( new ProcessingThread.Listener() {
            public void processStarted( ProcessingThread.Event e1 ) { /* ignored */ }
            public void processStopped( ProcessingThread.Event e2 )
            {
              tl.dispose();
              tmpDoc.dispose();
View Full Code Here

    protected void perform()
    {   
      final Span        span  = timeline.getSelectionSpan(); // XXX sync
      if( span.isEmpty() ) return;
     
      final ProcessingThread  proc    = initiate( getValue( NAME ).toString(), span, getEditMode() );
      if( proc != null ) start( proc );
    }
View Full Code Here

          } // else visiSpan untouched
        }
        edit.addPerform( new EditSetTimelineLength( this, Session.this, newDocLength ));
      }

      final ProcessingThread proc = new ProcessingThread( this, getFrame(), name );
      proc.putClientArg( "span", span );
      proc.putClientArg( "mode", new Integer( mode ));
      proc.putClientArg( "tis", tis );
      proc.putClientArg( "edit", edit );
      proc.putClientArg( "bc", bc );
      proc.putClientArg( "cut", new Boolean( cutTimeline ));
      proc.putClientArg( "cutSpan", cutTimelineSpan );
      return proc;
    }
View Full Code Here

//                                   AbstractApplication.getApplication().getResourceString( "toolWriteTransmitter" ),
//                                   null, Session.DOOR_TIMETRNSMTE );
          final String name = AbstractApplication.getApplication().
            getResourceString( "toolWriteTransmitter" );

          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,
View Full Code Here

      if( result == JOptionPane.OK_OPTION ) {
        value      = ggDuration.getValue();
        space      = ggDuration.getSpace();
        durationSmps  = timeTrans.translate( value, ParamSpace.spcTimeSmps );
        if( durationSmps.val > 0.0 ) {
          final ProcessingThread proc;
         
          proc = initiate( timeline.getPosition(), (long) durationSmps.val );
          if( proc != null ) start( proc );
        }
      }
View Full Code Here

      if( !checkProcess() || (numFrames == 0) ) return null;
     
      if( numFrames < 0 ) throw new IllegalArgumentException( String.valueOf( numFrames ));
      if( (pos < 0) || (pos > timeline.getLength()) ) throw new IllegalArgumentException( String.valueOf( pos ));

      final ProcessingThread     proc;
      final AbstractCompoundEdit  edit;
      final Span          oldSelSpan, insertSpan;

      proc = new ProcessingThread( this, getFrame(), getValue( NAME ).toString() );

      edit    = new BasicCompoundEdit( proc.getName() );
      oldSelSpan  = timeline.getSelectionSpan();
      insertSpan  = new Span( pos, pos + numFrames );

      if( !oldSelSpan.isEmpty() ) { // deselect
        edit.addPerform( TimelineVisualEdit.select( this, Session.this, new Span() ));
      }

      proc.putClientArg( "tis", Track.getInfos( selectedTracks.getAll(), tracks.getAll() ));
      proc.putClientArg( "edit", edit );
      proc.putClientArg( "span", insertSpan );
      return proc;
    }
View Full Code Here

    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 );
    renderThread.putClientArg( "span", span );
    renderThread.putClientArg( "trns", collTrns );
    renderThread.putClientArg( "edit", edit );
View Full Code Here

      getTransport().stop();
      ((MainFrame) root.getComponent( Main.COMP_MAIN )).clearLog();
//      Map options = new HashMap();
//      options.put( "file", path );
//      return( new ProcessingThread( this, root, root, doc, text, options, Session.DOOR_ALL ));
      final ProcessingThread pt;
      final Map options = new HashMap();
      pt = new ProcessingThread( this, root, getResourceString( "menuOpen" ));
      options.put( "file", path );
      options.put( XMLRepresentation.KEY_BASEPATH, path.getParentFile() );
      pt.putClientArg( "options", options );
//      pt.start();
     
      final org.w3c.dom.Document    domDoc;
      final DocumentBuilderFactory  builderFactory;
      final DocumentBuilder      builder;

      builderFactory  = DocumentBuilderFactory.newInstance();
      builderFactory.setValidating( true );
      getUndoManager().discardAllEdits();

      try {
        builder  =   builderFactory.newDocumentBuilder();
        builder.setEntityResolver( Session.this );
        domDoc  =   builder.parse( path );
//        context.setProgression( -1f );
        fromXML( domDoc, domDoc.getDocumentElement(), options );
//        doc.getMap().putValue( this, Session.MAP_KEY_PATH, f );
//        doc.setName( f.getName() );
//        setFile( path );

//        context.setProgression( 1.0f );
//        success = true;
      }
      catch( ParserConfigurationException e1 ) {
        pt.putClientArg( "exception", e1 );
      }
      catch( SAXParseException e1 ) {
        pt.putClientArg( "exception", e1 );
      }
      catch( SAXException e1 ) {
        pt.putClientArg( "exception", e1 );
      }
      catch( IOException e1 ) {
        pt.putClientArg( "exception", e1 );
      }
   
      return pt;
    }
View Full Code Here

TOP

Related Classes of de.sciss.common.ProcessingThread$Event

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.