package net.mkonrad.synes.data;

import javax.vecmath.Color3f;
import javax.vecmath.Point3f;

import net.mkonrad.synes.gui.elements.instruments.InstrumentShape;

public abstract class AbstractInstrument implements Instrument
{
  /**
   * Contains all valid arguments for a synth to be created. The order is very
   * important and must be according to the order in the SC SynthDef!
   */
  protected String[] _synthArgs;
  
  /**
   * Contains all valid arguments for a synth to be interactively modified
   */
  protected String[] _modArgs;
  
  protected int _key;
  
  protected String _name;
  
  protected String _iconName;
  
  protected String _texture;
  
  protected Color3f _color;
  
  public AbstractInstrument()
  {
    
  }
  
  public int getKey()
  {
    return _key;
  }
  
  public void setKey(int key)
  {
    _key = key;
  }

  public Color3f getColor()
  {
    return _color;
  }
  
  public void setColor(Color3f color)
  {
    _color = color;
  }
  
  public String getTexture()
  {
    return _texture;
  }
  
  public void setTexture(String tex)
  {
    _texture = tex;
  }

  public String getIcon()
  {
    return _iconName;
  }

  public String getName()
  {
    return _name;
  }

  public String[] getSynthArgs()
  {
    return _synthArgs;
  }
  
  public String[] getModArgs()
  {
   return _modArgs;
  }
  
  public float[] getAllSynthValues(SynthObj synthData)
  {
    float[] values = new float[_synthArgs.length];
    
    for (int i = 0; i < _synthArgs.length; i++)
    {
      values[i] = getValueForArg(_synthArgs[i], synthData);
    }
    
    return values;
  }
}
