package framework.modifiers;

import java.util.Observable;
import java.util.Observer;
import java.util.ArrayList;

import framework.Sound;
import framework.parameters.Parameter;

/**
 * Abstract class to represent all kind of filters and effects.
 */
public abstract class Modifier extends Observable implements Observer {
    /**
     * Create a Modifier object.
     */
    public Modifier(Sound s) {
        addObserver(s);
    }

    public void update(Observable o, Object arg) {
        // If a parameter has been modified
        // Inform the Sound object that the Modifier changed
        if(o instanceof Parameter && arg == true) {
            setChanged();
            notifyObservers();
        }
    }

    /**
     * Apply the transformations to the array and return the new data.
     * @param  data the current data
     * @return      the new data
     */
    public abstract Double[] apply(Double[] data);

    /**
     * Get all the parameters of the Modifier object.
     * @return the array of Parameter
     */
    public abstract Parameter[] getParameters();

    /**
     * Get the name of the Modifier (clearer than toString() for this purpose).
     * @return the name of the Modifier
     */
    public String getName() {
        return toString();
    }

    public abstract String toString();
}
@@ -170,16 +170,57 @@
 rameter;
+%0Aimport framework.editors.ModifierEditor;
 %0A%0A/**%0A *
@@ -746,24 +746,239 @@
    %7D%0A    %7D%0A%0A
+    /**%0A     * Attach a new ModifierEditor to the Modifier object.%0A     * @return the ModifierEditor newly attached%0A     */%0A    public ModifierEditor attachEditor() %7B%0A        return new ModifierEditor(this);%0A    %7D%0A%0A
     /**%0A    

Add attachEditor method to Modifier.