////////////////////////////////////////////////////////////////////////////////
// Copyright 2013 Michael Schmalle - Teoti Graphix, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License
//
// Author: Michael Schmalle, Principal Architect
// mschmalle at teotigraphix dot com
////////////////////////////////////////////////////////////////////////////////
package com.teotigraphix.caustk.tone.components.modular;
import com.teotigraphix.caustk.controller.ICaustkController;
public class CrossoverModule extends ModularComponentBase {
//----------------------------------
// frequency
//----------------------------------
private float frequency;
public float getFrequency() {
return frequency;
}
float getFrequency(boolean restore) {
return getValue("frequency");
}
/**
* @param value (0..1)
*/
public void setFrequency(float value) {
if (value == frequency)
return;
frequency = value;
if (value < 0f || value > 1f)
newRangeException("frequency", "0..1", value);
setValue("frequency", value);
}
//----------------------------------
// inGain
//----------------------------------
private float inGain;
public float getInGain() {
return inGain;
}
float getInGain(boolean restore) {
return getValue("in_gain");
}
/**
* @param value (0..1)
*/
public void setInGain(float value) {
if (value == inGain)
return;
inGain = value;
if (value < 0f || value > 1f)
newRangeException("in_gain", "0..1", value);
setValue("in_gain", value);
}
//----------------------------------
// lowGain
//----------------------------------
private float lowGain;
public float getLowGain() {
return lowGain;
}
float getLowGain(boolean restore) {
return getValue("low_gain");
}
/**
* @param value (0..1)
*/
public void setLowGain(float value) {
if (value == lowGain)
return;
lowGain = value;
if (value < 0f || value > 1f)
newRangeException("low_gain", "0..1", value);
setValue("low_gain", value);
}
//----------------------------------
// highGain
//----------------------------------
private float highGain;
public float getHighGain() {
return highGain;
}
float getHighGain(boolean restore) {
return getValue("high_gain");
}
/**
* @param value (0..1)
*/
public void setHighGain(float value) {
if (value == highGain)
return;
highGain = value;
if (value < 0f || value > 1f)
newRangeException("high_gain", "0..1", value);
setValue("high_gain", value);
}
public CrossoverModule() {
}
public CrossoverModule(ICaustkController controller, int bay) {
super(controller, bay);
}
@Override
protected int getNumBays() {
return 0;
}
public enum CrossoverModuleJack implements IModularJack {
InInput(0),
OutLow(0),
OutHigh(1);
private int value;
@Override
public final int getValue() {
return value;
}
CrossoverModuleJack(int value) {
this.value = value;
}
}
}