Examples of DecimatedWaveTrail


Examples of de.sciss.eisenkraut.io.DecimatedWaveTrail

  public DecimatedWaveTrail createDecimatedWaveTrail()
  throws IOException
  {
    if( dwt == null ) {
      dwt  = new DecimatedWaveTrail( at, DecimatedTrail.MODEL_FULLWAVE_PEAKRMS, waveDecims );
    }
    return dwt;
  }
View Full Code Here

Examples of de.sciss.eisenkraut.io.DecimatedWaveTrail

  }
 
  private void paintAmpLin( Graphics2D g2 )
  {

    final DecimatedWaveTrail  dt    = doc.getDecimatedWaveTrail();
    if( dt == null ) return;
   
    final int  w  = getWidth();
    Rectangle  cr;
    int      y;
   
    info = dt.getBestSubsample( new Span( viewSpan.start, viewSpan.stop + 1 ), w );
    dt.drawWaveform( info, this, g2 );

    if( nullLinie ) {
      g2.setPaint( pntNull );
      g2.setStroke( strkNull );
      for( int ch = 0; ch < fullChannels; ch++ ) {
View Full Code Here

Examples of de.sciss.eisenkraut.io.DecimatedWaveTrail

  }

  private void paintAmpLog( Graphics2D g2 )
  {

    final DecimatedWaveTrail  dt    = doc.getDecimatedWaveTrail();
    if( dt == null ) return;
   
    final int  w  = getWidth();
    Rectangle  cr;
    int      y;
   
    info = dt.getBestSubsample( new Span( viewSpan.start, viewSpan.stop + 1 ), w );
    dt.drawWaveform( info, this, g2 );

    if( nullLinie ) {
      g2.setPaint( pntNull );
      g2.setStroke( strkNull );
      for( int ch = 0; ch < fullChannels; ch++ ) {
View Full Code Here

Examples of de.sciss.eisenkraut.io.DecimatedWaveTrail

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

Examples of de.sciss.meloncillo.io.DecimatedWaveTrail

   
    channelOffset = 0;
    for( int i = 0; i < doc.getActiveTransmitters().size(); i++ ) {
      final Transmitter t = (Transmitter) doc.getActiveTransmitters().get( i );
      final AudioTrail at = t.getAudioTrail();
      final DecimatedWaveTrail dt = t.getDecimatedWaveTrail();
      if( dt == null ) continue;
      info = dt.getBestSubsample( new Span( viewSpan.start, viewSpan.stop + 1 ), w );
//      fullChannels = at.getChannelNum(); // XXX dirty shit
      dt.drawWaveform( info, this, g2 );
 
      if( nullLinie ) {
        g2.setPaint( pntNull );
        g2.setStroke( strkNull );
        for( int ch = 0; ch < fullChannels; ch++ ) {
View Full Code Here

Examples of de.sciss.meloncillo.io.DecimatedWaveTrail

        float[][]        frames  = null;
        float[]          x, y;
        GeneralPath        path  = null;
    DecimationInfo      info;
//    AudioTrail        at;
    DecimatedWaveTrail    dwt;     
    float          lx, ly;
    List          collTrns;
       
    try {
      doc.bird.waitShared( Session.DOOR_TIMETRNSMTE | Session.DOOR_GRP );
      span = doc.timeline.getSelectionSpan();
      collTransmitterPath.clear();
      if( span.getLength() < 2 ) return;

      collTrns  = doc.getActiveTransmitters().getAll();
      collTrns.retainAll( doc.getSelectedTransmitters().getAll() );
     
      for( int i = 0; i < collTrns.size(); i++ ) {
        trns  = (Transmitter) collTrns.get( i );
//        at    = trns.getTrackEditor();
        dwt    = trns.getDecimatedWaveTrail();
       
        // performance measures show that this routine is
        // vey fast, like one or two millisecs, while the draw method
        // of the Graphics2D called in redrawImage() becomes hell
        // slow if the GeneralPath contains more than say 250 lines.
        // therefore we start with a fairly big subsample to get a
        // good resolution; however in the path creation loop, points
        // are skipped if they lie very close to each other. therefore,
        // right after the creation of the path we know how many lines
        // it actually contains, and if these exceed 256 we'll restart
        // with a smaller subsample.
        for( reqLen = 1024, pathLen = 257, len = -1; pathLen > 256; reqLen >>= 1 ) {
          info  = dwt.getBestSubsample( span, reqLen );
          lastLen = len;
          len    = (int) info.sublength;
          if( lastLen == len ) continue;

          if( frames == null || frames[0].length < len ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.