Package de.sciss.eisenkraut.session

Examples of de.sciss.eisenkraut.session.Session


  }
 
  public ProcessingThread closeAll( boolean force, Flag confirmed )
  {
    final de.sciss.app.DocumentHandler  dh  = AbstractApplication.getApplication().getDocumentHandler();
    Session                doc;
    ProcessingThread          pt;

    while( dh.getDocumentCount() > 0 ) {
      doc  = (Session) dh.getDocument( 0 );
if( doc.getFrame() == null ) {
  System.err.println( "Yukk, no doc frame for "+doc.getDisplayDescr().file );
  try {
    Thread.sleep( 4000 );
  } catch( InterruptedException e1 ) { /* ignore */ }
  confirmed.set( true );
  return null;
}
      pt  = doc.getFrame().closeDocument( force, confirmed );
      if( pt == null ) {
        if( !confirmed.isSet() ) return null;
      } else {
        return pt;
      }
View Full Code Here


  {
    if( actionOpen.perform( f ) && postAction ) {
            final Preferences audioPrefs = getApplication().getUserPrefs().node( PrefsUtil.NODE_AUDIO );
            final String postActionValue = audioPrefs.get(PrefsUtil.KEY_AUTOPLAYFROMFINDER, PrefsUtil.AUTOPLAYFROMFINDER_NONE);
            if( !postActionValue.equals( PrefsUtil.AUTOPLAYFROMFINDER_NONE )) {
                final Session doc = findDocumentForPath( f );
                if( doc != null ) {
                    if( postActionValue.equals( PrefsUtil.AUTOPLAYFROMFINDER_LOOP )) {
                        final Span loopSpan = doc.getAudioTrail().getSpan();
                        // hmmm.... bit shaky all because we don't have a clean MVC
                        doc.timeline.setSelectionSpan( this, loopSpan );
                        doc.getFrame().setLoop( true );
//                        doc.getTransport().setLoop( loopSpan );
                    }
                    doc.getTransport().play( 1.0 );
                }
            }
        }
  }
View Full Code Here

  }
 
  protected Session findDocumentForPath( File f )
  {
    final de.sciss.app.DocumentHandler  dh  = AbstractApplication.getApplication().getDocumentHandler();
    Session                doc;
    AudioFileDescr[]          afds;
 
    for( int i = 0; i < dh.getDocumentCount(); i++ ) {
      doc    = (Session) dh.getDocument( i );
      afds  = doc.getDescr();
      for( int j = 0; j < afds.length; j++ ) {
        if( (afds[ j ].file != null) && afds[ j ].file.equals( f )) {
          return doc;
        }
      }
View Full Code Here

// ---------------- DocumentListener interface ----------------

  public void documentAdded( de.sciss.app.DocumentEvent e )
  {
    if( e.getDocument() instanceof Session ) {
      final Session        doc = (Session) e.getDocument();
      final SuperColliderPlayer  p  = superCollider.getPlayerForDocument( doc );
      if( (p != null) && !mapPlayers.containsKey( doc )) {
        lmm.addTaskSync( p.getOutputSync() );
        mapPlayers.put( doc, p );
      }
View Full Code Here

      }
    }
   
    protected Session perform( AudioFileDescr afd )
    {
      final Session doc;

      try {
        doc = Session.newEmpty( afd );
        AbstractApplication.getApplication().getDocumentHandler().addDocument( this, doc );
        doc.createFrame();
        return doc;
      }
      catch( IOException e1 ) {  // should never happen
        BasicWindowHandler.showErrorDialog( null, e1, getValue( Action.NAME ).toString() );
        return null;
View Full Code Here

    
     *  @synchronization  this method must be called in event thread
     */
    protected boolean perform( File path )
    {
      Session  doc;
     
      // check if the document is already open
      doc = findDocumentForPath( path );
      if( doc != null ) {
        doc.getFrame().setVisible( true );
        doc.getFrame().toFront();
        return true;
      }

      try {
        doc    = Session.newFrom( path );
        addRecent( doc.getDisplayDescr().file );
        AbstractApplication.getApplication().getDocumentHandler().addDocument( this, doc );
        doc.createFrame()// must be performed after the doc was added
                return true;
      }
      catch( IOException e1 ) {
        BasicWindowHandler.showErrorDialog( null, e1, getValue( Action.NAME ).toString() );
                return false;
View Full Code Here

     */
    protected void perform( File[] paths )
    {
      if( paths.length == 0 ) return;
   
      Session    doc;
//      File    f;
     
      // check if the document is already open
      for( int j = 0; j < paths.length; j++ ) {
        doc = findDocumentForPath( paths[ j ]);
        if( doc != null ) {
          doc.getFrame().setVisible( true );
          doc.getFrame().toFront();
          return;
        }
      }
   
      try {
        doc  = Session.newFrom( paths );
        addRecent( doc.getDisplayDescr().file );
        AbstractApplication.getApplication().getDocumentHandler().addDocument( this, doc );
        doc.createFrame()// must be performed after the doc was added
      }
      catch( IOException e1 ) {
        BasicWindowHandler.showErrorDialog( null, e1, getValue( Action.NAME ).toString() );
      }
    }
View Full Code Here

TOP

Related Classes of de.sciss.eisenkraut.session.Session

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.