f@0: /* f@0: Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation. f@0: f@0: Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/) f@0: f@0: This program is free software: you can redistribute it and/or modify f@0: it under the terms of the GNU General Public License as published by f@0: the Free Software Foundation, either version 3 of the License, or f@0: (at your option) any later version. f@0: f@0: This program is distributed in the hope that it will be useful, f@0: but WITHOUT ANY WARRANTY; without even the implied warranty of f@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the f@0: GNU General Public License for more details. f@0: f@0: You should have received a copy of the GNU General Public License f@0: along with this program. If not, see . f@0: */ f@0: package uk.ac.qmul.eecs.depic.patterns; f@0: f@0: /** f@0: * f@0: * A mapping of a sequence into some form of representation, e.g. visual, audio, audio-visual etc. f@0: * f@0: * The methods of this interface represent different ways a sequence can be rendered and f@0: * need not be all implemented in classes implementing this interface. f@0: * f@0: */ f@0: public interface SequenceMapping { f@0: f@0: public float DURATION_INF = Float.POSITIVE_INFINITY; f@0: public float DURATION_STOP = -1.0f; f@0: f@2: /** f@2: * renders a single value of the sequence f@2: * @param val f@2: */ f@0: public void renderValue(Sequence.Value val); f@0: f@0: /** f@2: * Renders the whole curve, from start to end f@0: * f@0: * @param m f@0: * @param startTime the time in millisecond the curve rendering has to start from, if f@0: * -1 will immediately stop the rendering. f@0: */ f@0: public void renderCurve(Sequence m, float startTime); f@0: f@0: /** f@0: * f@2: * Render a curve at precise time f@0: * f@2: * If sound is used for rendering, the sound lasts {@code duration} milliseconds and then fades out. f@0: * If {@code INF} is passed as duration the sound will go on forever. Successive calls with {@code INF} as duration f@0: * will have the effect of changing the sound in order to represent the curve at the new {@code time} passed as argument. f@0: * Successive calls with {@code duration} different from {@code DURATION_INF} will carry on the sound for {@code duration} f@0: * millisecond (and therefore setting {@code duration} to 0 will stop the sound). f@0: * f@0: * @param sequence the sequence to render f@0: * @param time the time at which the sequence has to be rendered f@0: * @param duration the duration of sound in millisecond. If (@code DURATION_INF) is used the sound f@0: * will go on forever until it's stopped. To stop the sound use {@code duration = -1}; f@0: */ f@0: public void renderCurveAt(Sequence sequence, float time, float duration); f@0: f@0: }