Mercurial > hg > cmdp
view src/uk/ac/qmul/eecs/depic/patterns/SequenceMapping.java @ 2:c0412c81d274
Added documentation
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Thu, 18 Feb 2016 18:35:26 +0000 |
parents | 3074a84ef81e |
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.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; /** * renders a single value of the sequence * @param val */ public void renderValue(Sequence.Value val); /** * Renders the whole curve, from start to end * * @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 * * If sound is used for rendering, 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); }