view src/uk/ac/qmul/eecs/depic/daw/Parameter.java @ 4:473da40f3d39 tip

added html formatting to Daw/package-info.java
author Fiore Martin <f.martin@qmul.ac.uk>
date Thu, 25 Feb 2016 17:50:09 +0000
parents 629262395647
children
line wrap: on
line source
/*  
 Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation.

 Copyright (C) 2015  Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)
	
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package uk.ac.qmul.eecs.depic.daw;

import uk.ac.qmul.eecs.depic.patterns.Range;

/**
 * 
 * A parameter of the audio computation  
 *
 */
public interface Parameter {
	public interface Type {
		String getLabel();
		
		String getUnitofMeasurment();
	}
	
	public Type GAIN_TYPE = new Type(){
		@Override
		public String getLabel() {
			return "Gain ";
		}
		
		@Override
		public String getUnitofMeasurment(){
			return "db";
		}
	};
	
	public Type PAN_TYPE = new Type(){
		@Override
		public String getLabel() {
			return "Pan ";
		}
		
		@Override
		public String getUnitofMeasurment(){
			return "";
		}
	};
	
	public float getValue();
	
	public void setValue(float value);
	
	public float getInitialValue();
	
	public Range<Float> getRange();
	
	public Type getType();
	
	public void automate(Automation a);
	
	public static final Parameter NONE_PARAMETER = new Parameter() {
		private Type NONE_TYPE = new Type(){
			@Override
			public String getLabel() {
				return "None";
			}
			
			@Override
			public String getUnitofMeasurment(){
				return "";
			}
		};
		
		Range<Float> r = new Range<Float>(0.0f,0.0f);
		
		@Override
		public float getValue() {
			return 0;
		}

		@Override
		public void setValue(float value) {	}

		@Override
		public Range<Float> getRange() {
			return r;
		}

		@Override
		public Type getType() {
			return NONE_TYPE;
		}

		@Override
		public void automate(Automation a) {}

		@Override
		public float getInitialValue() {
			return 0;
		}
		
	};
}