com.softsynth.jmsl.score.transforms
Class HoldTransform

java.lang.Object
  extended by com.softsynth.jmsl.score.NotePropertiesTransform
      extended by com.softsynth.jmsl.score.transforms.HoldTransform

public class HoldTransform
extends NotePropertiesTransform

Change hold (sustain time) of selected notes based on a ratio to its duration. Brings up dialog for user input.

Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved

Field Summary
static java.lang.String copyright
           
 
Constructor Summary
HoldTransform()
          Constructor gives unique name, this.name = "Transpose: " + interval;
HoldTransform(java.awt.Frame f)
           
 
Method Summary
 void operate(Score score, SelectionBuffer selectionBuffer)
           public void operate(Score score, SelectionBuffer selectionBuffer) { HoldDialog vd = new HoldDialog(this, parent, ratio); (new HoldDialog(this, parent, ratio)).setVisible(true); if (!proceed) { // System.out.println("Bailing"); } else { for (Enumeration e = selectionBuffer.elements(); e.hasMoreElements();) { Note note = (Note) e.nextElement(); if (!note.isRest()) { double duration = note.getDurationData(); double hold = ratio * duration; note.setHoldData(hold); } } } score.setDirty(true); }
 
Methods inherited from class com.softsynth.jmsl.score.NotePropertiesTransform
getName, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values
Constructor Detail

HoldTransform

public HoldTransform()
Constructor gives unique name, this.name = "Transpose: " + interval;


HoldTransform

public HoldTransform(java.awt.Frame f)
Method Detail

operate

public void operate(Score score,
                    SelectionBuffer selectionBuffer)
 
 public void operate(Score score, SelectionBuffer selectionBuffer) {
     HoldDialog vd = new HoldDialog(this, parent, ratio);
     (new HoldDialog(this, parent, ratio)).setVisible(true);
     if (!proceed) {
         // System.out.println("Bailing");
     } else {
         for (Enumeration e = selectionBuffer.elements(); e.hasMoreElements();) {
             Note note = (Note) e.nextElement();
             if (!note.isRest()) {
                 double duration = note.getDurationData();
                 double hold = ratio * duration;
                 note.setHoldData(hold);
             }
         }
     }
     score.setDirty(true);
 }
 
 
 

Specified by:
operate in class NotePropertiesTransform