Package de.sciss.util

Examples of de.sciss.util.Param


  }

  protected void updateButtonText()
  {
//    final Param    p;
    final Param    p    = current.duration;
    final Object  view;
    final String  text;
   
//    p = Param.fromPrefs( prefs, KEY_DURATION, null );
    if( p != null ) {
View Full Code Here


  {
    if( !java.awt.EventQueue.isDispatchThread() ) throw new IllegalMonitorStateException();
    if( !active ) return null;
   
    final long  blendLen;
    final Param  p;

    p = current.duration; // Param.fromPrefs( prefs, KEY_DURATION, null );
    if( p != null ) {
      ut.setLengthAndRate( 0, timeline.getRate() );
      blendLen  = (long) (ut.translate( p, ParamSpace.spcTimeSmps ).val + 0.5);
View Full Code Here

    doc  = newDoc;
    afd  = newDoc == null ? null : newDoc.getDisplayDescr();
 
    if( doc == null ) {
      ggRate.setEnabled( false );
      ggRate.setValue( new Param( Double.NaN, ParamSpace.FREQ | ParamSpace.HERTZ ));
      lbName.setText( "" );
      ggComment.setEnabled( false );
      ggComment.setText( "" );
    } else {
      comment    = (String) afd.getProperty( AudioFileDescr.KEY_COMMENT );
      ggRate.setEnabled( true );
      ggRate.setValue( new Param( doc.timeline.getRate(), ParamSpace.FREQ | ParamSpace.HERTZ ));
//      ggRate.setNumber( new Double( doc.timeline.getRate() ));  // XXX sync?
      setDocumentName();
      ggComment.setEnabled( true );
      ggComment.setText( comment )// null allowed
      p.makeCompactGrid();
View Full Code Here

// ---------------- TimelineListener interface ----------------

  public void timelineChanged( TimelineEvent e )
  {
    if( (e.getSource() != this) && (doc != null) ) {
      ggRate.setValue( new Param( doc.timeline.getRate(), ParamSpace.FREQ | ParamSpace.HERTZ ));
    }
  }
View Full Code Here

    return bandsPerOct;
  }
 
  public void readPrefs( Preferences prefs )
  {
    Param p;
    String s;
   
    p = Param.fromPrefs( prefs, KEY_MINFREQ, null );
    if( p != null ) minFreq = Math.max( 1, (float) p.val );
    p = Param.fromPrefs( prefs, KEY_MAXFREQ, null );
View Full Code Here

    }
  }
 
  public void writePrefs( Preferences prefs )
  {
    prefs.put( KEY_MINFREQ, new Param( minFreq, ParamSpace.FREQ | ParamSpace.HERTZ ).toString() );
    prefs.put( KEY_MAXFREQ, new Param( maxFreq, ParamSpace.FREQ | ParamSpace.HERTZ ).toString() );
    prefs.put( KEY_BANDSPEROCT, new Param( bandsPerOct, ParamSpace.NONE ).toString() );
    prefs.put( KEY_MAXTIMERES, new Param( maxTimeRes, ParamSpace.TIME | ParamSpace.MILLI | ParamSpace.SECS ).toString() );
    prefs.put( KEY_MAXFFTSIZE, String.valueOf( maxFFTSize ));
  }
View Full Code Here

    protected ActionGoToTime() { /* empty */ }

    public void actionPerformed( ActionEvent e )
    {
      final int          result;
      final Param          positionSmps;
      final Box          msgPane;
      final DefaultUnitTranslator  timeTrans;
      final ParamField      ggPosition;
//      final JComboBox        ggPosCombo;
      final Application      app  = AbstractApplication.getApplication();
     
      msgPane      = Box.createVerticalBox();
      // XXX sync
      timeTrans    = new DefaultUnitTranslator();
      ggPosition    = new ParamField( timeTrans );
      ggPosition.addSpace( ParamSpace.spcTimeHHMMSS );
      ggPosition.addSpace( ParamSpace.spcTimeSmps );
      ggPosition.addSpace( ParamSpace.spcTimeMillis );
      ggPosition.addSpace( ParamSpace.spcTimePercentF );
      timeTrans.setLengthAndRate( doc.timeline.getLength(), doc.timeline.getRate() )// XXX sync
      if( value != null ) {
        ggPosition.setSpace( space );
        ggPosition.setValue( value );
      }
//      ggPosition.setValue( position );
//      lbCurrentTime  = new TimeLabel( new Color( 0xE0, 0xE0, 0xE0 ));

//      ggPosition.setBorder( new ComboBoxEditorBorder() );
//      ggPosCombo = new JComboBox();
//      ggPosCombo.setEditor( ggPosition );
//      ggPosCombo.setEditable( true );

//      msgPane.gridAdd( ggPosCombo, 0, 1, -1, 1 );
      msgPane.add( Box.createVerticalGlue() );
//      msgPane.add( ggPosCombo );
JButton ggCurrent = new JButton( app.getResourceString( "buttonSetCurrent" ))// "Current"
ggCurrent.setFocusable( false );
//JLabel lbArrow = new JLabel( "\u2193" );  // "\u2939"
//Box b = Box.createHorizontalBox();
//b.add( lbArrow );
//b.add( ggCurrent );
ggCurrent.addActionListener( new ActionListener() {
  public void actionPerformed( ActionEvent ae )
  {
    final long pos = transport.isRunning() ? transport.getCurrentFrame() : doc.timeline.getPosition();
    ggPosition.setValue( new Param( pos, ParamSpace.TIME | ParamSpace.SMPS ))// XXX sync
    ggPosition.requestFocusInWindow();
  }
});
//msgPane.add( b );
msgPane.add( ggCurrent );
View Full Code Here

    }
    catch( BackingStoreException e1 ) {
      warnings.add( e1.toString() );
    }

    putDontOverwrite( childPrefs, KEY_AUDIORATE, new Param( 0, ParamSpace.FREQ | ParamSpace.HERTZ ).toString() );
    putDontOverwrite( childPrefs, KEY_AUDIOBUSSES, new Param( 256, ParamSpace.NONE ).toString() );
    putDontOverwrite( childPrefs, KEY_SCMEMSIZE, new Param( 8, ParamSpace.NONE ).toString() );
    putDontOverwrite( childPrefs, KEY_SCBLOCKSIZE, new Param( 64, ParamSpace.NONE ).toString() );
    putBooleanDontOverwrite( childPrefs, KEY_SCRENDEZVOUS, true );
//    putBooleanDontOverwrite( childPrefs, KEY_AUTOBOOT, false );

    // outputconfigs
    value = "out1to2";
    putDontOverwrite( childPrefs, KEY_OUTPUTCONFIG, value );
    try {
      if( !childPrefs.nodeExists( NODE_OUTPUTCONFIGS )) {
        childPrefs2 = childPrefs.node( NODE_OUTPUTCONFIGS );
        new RoutingConfig( value, "Out 1-2", new int[] { 0, 1 }, -90f ).toPrefs(
          childPrefs2.node( value ));
        value = "out1to8";
        new RoutingConfig( value, "Out 1-8", new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }, -45f ).toPrefs(
          childPrefs2.node( value ));
//        // ok dis wan is rather for demonstration purpose
//        new RoutingConfig( value, 2, new int[] { 1, 0 }, -90f ).toPrefs(
//          childPrefs2.node( "Reversed Stereo" ));
      }
    }
    catch( BackingStoreException e1 ) {
      warnings.add( e1.toString() );
    }

    // inputconfigs
    try {
      if( !childPrefs.nodeExists( NODE_INPUTCONFIGS )) {
        childPrefs2 = childPrefs.node( NODE_INPUTCONFIGS );
        value = "in1";
        new RoutingConfig( value, "In 1", new int[] { 0 }, 0f ).toPrefs(
          childPrefs2.node( value ));
        value = "in1to2";
        new RoutingConfig( value, "In 1-2", new int[] { 0, 1 }, 0f ).toPrefs(
          childPrefs2.node( value ));
        value = "in1to8";
        new RoutingConfig( value, "In 1-8", new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }, 0f ).toPrefs(
          childPrefs2.node( value ));
//        // ok dis wan is rather for demonstration purpose
//        new RoutingConfig( value, 2, new int[] { 1, 0 }, -90f ).toPrefs(
//          childPrefs2.node( "Reversed Stereo" ));
      }
    }
    catch( BackingStoreException e1 ) {
      warnings.add( e1.toString() );
    }

//    try {
//      value   = InetAddress.getLocalHost().getHostName() + ":57110";
//    }
//    catch( IOException e1 ) {
//      System.err.println( e1.toString() );
//      value   = "127.0.0.1:57109";  // not 57110 which may interfere with a running copy of sclang
//    }
//    putDontOverwrite( childPrefs, KEY_SUPERCOLLIDEROSC, value );
    putDontOverwrite( childPrefs, KEY_SCPROTOCOL, OSCChannel.TCP );
    putDontOverwrite( childPrefs, KEY_SCPORT, new Param( 0, ParamSpace.NONE | ParamSpace.ABS ).toString() );
   
    // sc app
    if( childPrefs.get( KEY_SUPERCOLLIDERAPP, null ) == null ) {
      f  = findFile( isWindows ? "scsynth.exe" : "scsynth", new String[] {
        fs + "Applications" + fs + "SuperCollider_f",
View Full Code Here

//System.err.println( "//////////// boot /////////////" );
    dispose();
 
    String          val;
    int            serverPort;  // , idx;
    Param          p;
    final String      abCfgID    = audioPrefs.get( PrefsUtil.KEY_AUDIOBOX, AudioBoxConfig.ID_DEFAULT );
    final AudioBoxConfig  abCfg    = new AudioBoxConfig( audioPrefs.node( PrefsUtil.NODE_AUDIOBOXES ).node( abCfgID ));
   
    p  = Param.fromPrefs( audioPrefs, PrefsUtil.KEY_AUDIORATE, null );
    if( p != null ) so.setSampleRate( p.val );
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

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.