Mercurial > hg > cmdp
diff src/uk/ac/qmul/eecs/depic/patterns/SequenceMapping.java @ 0:3074a84ef81e
first import
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Wed, 26 Aug 2015 16:16:53 +0100 |
parents | |
children | c0412c81d274 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/uk/ac/qmul/eecs/depic/patterns/SequenceMapping.java Wed Aug 26 16:16:53 2015 +0100 @@ -0,0 +1,61 @@ +/* + 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.patterns; + +/** + * + * A mapping of a sequence into some form of representation, e.g. visual, audio, audio-visual etc. + * + * The methods of this interface represent different ways a sequence can be rendered and + * need not be all implemented in classes implementing this interface. + * + */ +public interface SequenceMapping { + + public float DURATION_INF = Float.POSITIVE_INFINITY; + public float DURATION_STOP = -1.0f; + + public void renderValue(Sequence.Value val); + + /** + * + * @param m + * @param startTime the time in millisecond the curve rendering has to start from, if + * -1 will immediately stop the rendering. + */ + public void renderCurve(Sequence m, float startTime); + + /** + * + * Render a curve at precise time in sound. + * + * The sound lasts {@code duration} milliseconds and then fades out. + * If {@code INF} is passed as duration the sound will go on forever. Successive calls with {@code INF} as duration + * will have the effect of changing the sound in order to represent the curve at the new {@code time} passed as argument. + * Successive calls with {@code duration} different from {@code DURATION_INF} will carry on the sound for {@code duration} + * millisecond (and therefore setting {@code duration} to 0 will stop the sound). + * + * @param sequence the sequence to render + * @param time the time at which the sequence has to be rendered + * @param duration the duration of sound in millisecond. If (@code DURATION_INF) is used the sound + * will go on forever until it's stopped. To stop the sound use {@code duration = -1}; + */ + public void renderCurveAt(Sequence sequence, float time, float duration); + +}