Package de.sciss.util

Examples of de.sciss.util.Param


        if( ggLockLen.isLocked() ) {
          n2  = n + span.getLength();
          if( n2 > doc.timeline.getLength() ) {
            n2  = doc.timeline.getLength();
            n  = n2 - span.getLength();
            ggTimelineStart.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n, n2 );
          ggTimelineStop.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        } else {
          n2 = span.getStop();
          if( n > n2 ) {
            n = n2;
            ggTimelineStart.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n, n2 );
          ggTimelineLen.setValue( new Param( span.getLength(), ParamSpace.spcTimeSmps.unit ));
        }
      // ----- stop was adjusted -----
      } else if( e.getSource() == ggTimelineStop ) {
        if( ggLockLen.isLocked() ) {
          n2    = n - span.getLength();
          if( n2 < 0 ) {
            n2  = 0;
            n  = n2 + span.getLength();
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          if( n > doc.timeline.getLength() ) {
            n  = doc.timeline.getLength();
            n2  = n - span.getLength();
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2, n );
          ggTimelineStart.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        } else {
          n2    = span.getStart();
          if( n < n2 ) {
            n  = n2;
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          if( n > doc.timeline.getLength() ) {
            n  = doc.timeline.getLength();
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2, n );
          ggTimelineLen.setValue( new Param( span.getLength(), ParamSpace.spcTimeSmps.unit ));
        }
      // ----- len was adjusted -----
      } else {
        if( ggLockStop.isLocked() ) {
          n2    = span.getStop() - n;
          if( n2 < 0 ) {
            n2  = 0;
            n  = span.getStop();
            ggTimelineLen.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2, n2 + n );
          ggTimelineStart.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        } else {
          n2    = span.getStart() + n;
          if( n2 > doc.timeline.getLength() ) {
            n2  = doc.timeline.getLength();
            n  = n2 - span.getStart();
            ggTimelineLen.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2 - n, n2 );
          ggTimelineStop.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        }
      }
      doc.timeline.editSelect( this, span );
    }
  }
View Full Code Here


   
  public void setFolderAndCapacity( File folder, int capacity )
  {
    super.setFolderAndCapacity( folder, capacity );
    prefs.put( KEY_FOLDER, folder.getPath() );
    prefs.put( KEY_CAPACITY, new Param( capacity, ParamSpace.NONE | ParamSpace.ABS ).toString() );
  }
View Full Code Here

   
    instance    = this;
 
    this.prefs    = prefs;
   
    defaultPortParam = new Param( defaultPort, ParamSpace.NONE | ParamSpace.ABS );
   
    if( prefs.get( KEY_PORT, null ) == null ) {  // create defaults
      prefs.putBoolean( KEY_ACTIVE, false );
      prefs.put( KEY_PORT, defaultPortParam.toString() );
    }
View Full Code Here

    private void perform()
    {
      final SpringPanel      msgPane;
      final int          result;
      final ParamField      ggDuration;
      final Param          durationSmps;
      final DefaultUnitTranslator  timeTrans;
     
      msgPane      = new SpringPanel( 4, 2, 4, 2 );
      timeTrans    = new DefaultUnitTranslator();
      ggDuration    = new ParamField( timeTrans );
      ggDuration.addSpace( ParamSpace.spcTimeHHMMSS );
      ggDuration.addSpace( ParamSpace.spcTimeSmps );
      ggDuration.addSpace( ParamSpace.spcTimeMillis );
      ggDuration.addSpace( ParamSpace.spcTimePercentF );
      msgPane.gridAdd( ggDuration, 0, 0 );
      msgPane.makeCompactGrid();
      GUIUtil.setInitialDialogFocus( ggDuration );

      timeTrans.setLengthAndRate( timeline.getLength(), timeline.getRate() );

      if( value == null ) {
        ggDuration.setValue( new Param( 1.0, ParamSpace.TIME | ParamSpace.SECS ));
      } else {
        ggDuration.setSpace( space );
        ggDuration.setValue( value );
      }
View Full Code Here

  protected void updateEditMarker()
  {
    final MarkerStake mark = doc.markers.get( editIdx );
    if( mark == null ) return;

    ggMarkPos.setValue( new Param( mark.pos, ParamSpace.TIME | ParamSpace.SMPS ));
    ggMarkName.setText( mark.name );
   
    ggEditPrev.setEnabled( editIdx > 0 );
    ggEditNext.setEnabled( (editIdx + 1) < doc.markers.getNumStakes() );
   
View Full Code Here

      final int          result;
//      final Object        result;
//      final Component        c      = ((AbstractWindow) root.getComponent( Main.COMP_MAIN )).getWindow();
      final Server.Status      status;
      final double        sampleRate;
      final Param          param;
      final Preferences      audioPrefs;

      if( p == null ) {
        affp    = new AudioFileFormatPane( AudioFileFormatPane.NEW_FILE_FLAGS );
        p      = new JPanel( new BorderLayout() );
View Full Code Here

   
  public void setFolderAndCapacity( File folder, int capacity )
  {
    super.setFolderAndCapacity( folder, capacity );
    prefs.put( KEY_FOLDER, folder.getPath() );
    prefs.put( KEY_CAPACITY, new Param( capacity, ParamSpace.NONE | ParamSpace.ABS ).toString() );
  }
View Full Code Here

      final Span  span  = doc.timeline.getSelectionSpan();
      final double rate  = doc.timeline.getRate();

      timeTrans.setLengthAndRate( doc.timeline.getLength(), rate );
      ggTimelineStart.setValue( new Param( span.getStart(), ParamSpace.spcTimeSmps.unit ));
      ggTimelineStop.setValue( new Param( span.getStop(), ParamSpace.spcTimeSmps.unit ));
      ggTimelineLen.setValue( new Param( span.getLength(), ParamSpace.spcTimeSmps.unit ));
      if( !ggTimelineStart.isEnabled() ) ggTimelineStart.setEnabled( true );
      if( !ggTimelineStop.isEnabled() )  ggTimelineStop.setEnabled( true );
      if( !ggTimelineLen.isEnabled() )  ggTimelineLen.setEnabled( true );
     
    } else {
View Full Code Here

        if( ggLockLen.isLocked() ) {
          n2  = n + span.getLength();
          if( n2 > doc.timeline.getLength() ) {
            n2  = doc.timeline.getLength();
            n  = n2 - span.getLength();
            ggTimelineStart.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n, n2 );
          ggTimelineStop.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        } else {
          n2 = span.getStop();
          if( n > n2 ) {
            n = n2;
            ggTimelineStart.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n, n2 );
          ggTimelineLen.setValue( new Param( span.getLength(), ParamSpace.spcTimeSmps.unit ));
        }
      // ----- stop was adjusted -----
      } else if( e.getSource() == ggTimelineStop ) {
        if( ggLockLen.isLocked() ) {
          n2    = n - span.getLength();
          if( n2 < 0 ) {
            n2  = 0;
            n  = n2 + span.getLength();
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          if( n > doc.timeline.getLength() ) {
            n  = doc.timeline.getLength();
            n2  = n - span.getLength();
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2, n );
          ggTimelineStart.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        } else {
          n2    = span.getStart();
          if( n < n2 ) {
            n  = n2;
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          if( n > doc.timeline.getLength() ) {
            n  = doc.timeline.getLength();
            ggTimelineStop.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2, n );
          ggTimelineLen.setValue( new Param( span.getLength(), ParamSpace.spcTimeSmps.unit ));
        }
      // ----- len was adjusted -----
      } else {
        if( ggLockStop.isLocked() ) {
          n2    = span.getStop() - n;
          if( n2 < 0 ) {
            n2  = 0;
            n  = span.getStop();
            ggTimelineLen.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2, n2 + n );
          ggTimelineStart.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        } else {
          n2    = span.getStart() + n;
          if( n2 > doc.timeline.getLength() ) {
            n2  = doc.timeline.getLength();
            n  = n2 - span.getStart();
            ggTimelineLen.setValue( new Param( n, ParamSpace.spcTimeSmps.unit ));
          }
          span  = new Span( n2 - n, n2 );
          ggTimelineStop.setValue( new Param( n2, ParamSpace.spcTimeSmps.unit ));
        }
      }
      doc.timeline.editSelect( this, span );
    }
  }
View Full Code Here

    private void perform()
    {
      final SpringPanel      msgPane;
      final int          result;
      final ParamField      ggDuration;
      final Param          durationSmps;
      final DefaultUnitTranslator  timeTrans;
     
      msgPane      = new SpringPanel( 4, 2, 4, 2 );
      timeTrans    = new DefaultUnitTranslator();
      ggDuration    = new ParamField( timeTrans );
      ggDuration.addSpace( ParamSpace.spcTimeHHMMSS );
      ggDuration.addSpace( ParamSpace.spcTimeSmps );
      ggDuration.addSpace( ParamSpace.spcTimeMillis );
      ggDuration.addSpace( ParamSpace.spcTimePercentF );
      msgPane.gridAdd( ggDuration, 0, 0 );
      msgPane.makeCompactGrid();
      GUIUtil.setInitialDialogFocus( ggDuration );

      timeTrans.setLengthAndRate( timeline.getLength(), timeline.getRate() );

      if( value == null ) {
        ggDuration.setValue( new Param( 60.0, ParamSpace.TIME | ParamSpace.SECS ));
      } else {
        ggDuration.setSpace( space );
        ggDuration.setValue( value );
      }
View Full Code Here

TOP

Related Classes of de.sciss.util.Param

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.