package net.mkonrad.synes.data;

import java.security.InvalidParameterException;

public class SynthGraph extends AbstractGraph
{
  public final static int STATE_PERMANENTLY = 10;
  public final static int STATE_IMPRO = 11;
  
  /** Modulator for the other synths in this graph */
  private Modulator _mod = null;
  
  public SynthGraph()
  {
    super(STATE_PERMANENTLY);
  }
  
  public void addModulator(Modulator mod)
  {
    if (_mod != null)
      throw new InvalidParameterException(
          "Cannot add another modulator. One already exists!");

    _mod = (Modulator) mod;
    
    add(mod);
  }

  public void addSynthObj(SynthObj synth)
  { 
    add(synth);
  }
  
  public SynthObj getSynthObj(int index)
  {
    return (SynthObj)get(index);
  }
  
  public Modulator getModulator()
  {
    return _mod;
  }
}
