Package de.sciss.eisenkraut.gui

Examples of de.sciss.eisenkraut.gui.ObserverPalette


    // ---- component views ----

    mainFrame    = new MainFrame();
    ((BasicWindowHandler) getWindowHandler()).setDefaultBorrower( mainFrame );
    final AppWindow ctrlRoom  = new ControlRoomFrame();
    final AppWindow observer  = new ObserverPalette();

    // means no preferences found, so
    // do some more default initializations
    // and display splash screen
    if( prefsVersion == 0.0 ) {
      ctrlRoom.setVisible( true );
      observer.setVisible( true );
      if( cache.getFolder().isDirectory() ) {
        cache.setActive( true );
      }
        new WelcomeScreen( this );
    }
View Full Code Here


      }
    }

    public void mouseDragged( MouseEvent e )
    {
      final ObserverPalette observer;
     
      super.mouseDragged( e );

      if( validDrag ) {
        if( !dragStarted ) {
          if( shiftDrag || ctrlDrag || Math.abs( e.getX() - startX ) > 2 ) {
            dragStarted = true;
          } else return;
        }
        processDrag( e, true );
      }
     
      // cursor information
      observer = (ObserverPalette) app.getComponent( Main.COMP_OBSERVER );
      if( (observer != null) && observer.isVisible() && (observer.getShownTab() == ObserverPalette.CURSOR_TAB) ) {       
        showCursorInfo( SwingUtilities.convertPoint( e.getComponent(), e.getPoint(), waveView ));
      }
    }
View Full Code Here

      }
    }
   
    private void showCursorInfo( Point screenPt )
    {
      final ObserverPalette  observer;
     
      final int        ch    = waveView.channelForPoint( screenPt );
      if( ch == -1 ) return;

      final DecimationInfo  info  = waveView.getDecimationInfo();
      if( info == null ) return;

      final long        pos    = timelineVis.getStart() + (long)
                    ((double) screenPt.x / (double) waveView.getWidth() *
                     timelineVis.getLength());
      if( (pos < 0) || (pos >= timelineLen) ) return;
   
      final String      chName  = doc.audioTracks.get( ch ).getName();
      final double      seconds  = pos / timelineRate;
      final AudioTrail     at;
      final DecimatedWaveTrail  dt;
      final float[][]      data;
      final float[]      frame;
      float          f1;
     
      argsCsr[3]    = chName;
      argsCsr[0]    = new Long( pos );
      argsCsr[1]    = new Integer( (int) (seconds / 60) );
      argsCsr[2]    = new Float( seconds % 60 );
     
      csrInfo[0]    = msgCsr1.format( argsCsr );
     
      switch( info.model ) {
      case DecimatedTrail.MODEL_PCM:
        at      = doc.getAudioTrail();
        data    = new float[ at.getChannelNum() ][];
        data[ ch = new float[ 1 ];
        try {
          at.readFrames( data, 0, new Span( pos, pos + 1 ));
        }
        catch( IOException e1 ) { return; }
        f1      = data[ ch ][ 0 ];
        argsCsr[4= new Float( f1 );
        argsCsr[5= new Float( Math.log( Math.abs( f1 )) * TWENTYDIVLOG10 );
        csrInfo[1= msgCsr2PCMFloat.format( argsCsr );
        if( csrInfoIsInt ) {
          argsCsr[6= new Long( (long) (f1 * (1L << (csrInfoBits - 1))) );
          argsCsr[7= new Integer( csrInfoBits );
          csrInfo[2= msgCsr3PCMInt.format( argsCsr );
        } else {
          csrInfo[2= "";
        }
        break;
       
      case DecimatedTrail.MODEL_FULLWAVE_PEAKRMS:
        dt      = doc.getDecimatedWaveTrail();
        if( dt == null ) return;
        frame    = new float[ dt.getNumModelChannels() ];
        try {
          dt.readFrame( Math.min( dt.getNumDecimations() - 1, info.idx + 1 ), pos, ch, frame );
        }
        catch( IOException e1 ) { return; }
        f1      = Math.max( frame[ 0 ], -frame[ 1 ] )// peak pos/neg
        argsCsr[4= new Float( f1 );
        argsCsr[5= new Float( Math.log( f1 ) * TWENTYDIVLOG10 );
        f1      = (float) Math.sqrt( frame[ 2 ])// mean sqr pos/neg
        argsCsr[6= new Float( f1 );
        argsCsr[7= new Float( Math.log( f1 ) * TWENTYDIVLOG10 );
        csrInfo[1= msgCsr2Peak.format( argsCsr );
        csrInfo[2= msgCsr3RMS.format( argsCsr );
        break;
       
      default:
        return;
      }

      observer = (ObserverPalette) app.getComponent( Main.COMP_OBSERVER );
      if( observer != null ) observer.showCursorInfo( csrInfo );
    }
View Full Code Here

TOP

Related Classes of de.sciss.eisenkraut.gui.ObserverPalette

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.