annotate 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
rev   line source
f@0 1 /*
f@0 2 Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation.
f@0 3
f@0 4 Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)
f@0 5
f@0 6 This program is free software: you can redistribute it and/or modify
f@0 7 it under the terms of the GNU General Public License as published by
f@0 8 the Free Software Foundation, either version 3 of the License, or
f@0 9 (at your option) any later version.
f@0 10
f@0 11 This program is distributed in the hope that it will be useful,
f@0 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
f@0 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f@0 14 GNU General Public License for more details.
f@0 15
f@0 16 You should have received a copy of the GNU General Public License
f@0 17 along with this program. If not, see <http://www.gnu.org/licenses/>.
f@0 18 */
f@0 19 package uk.ac.qmul.eecs.depic.patterns;
f@0 20
f@0 21 /**
f@0 22 *
f@0 23 * A mapping of a sequence into some form of representation, e.g. visual, audio, audio-visual etc.
f@0 24 *
f@0 25 * The methods of this interface represent different ways a sequence can be rendered and
f@0 26 * need not be all implemented in classes implementing this interface.
f@0 27 *
f@0 28 */
f@0 29 public interface SequenceMapping {
f@0 30
f@0 31 public float DURATION_INF = Float.POSITIVE_INFINITY;
f@0 32 public float DURATION_STOP = -1.0f;
f@0 33
f@0 34 public void renderValue(Sequence.Value val);
f@0 35
f@0 36 /**
f@0 37 *
f@0 38 * @param m
f@0 39 * @param startTime the time in millisecond the curve rendering has to start from, if
f@0 40 * -1 will immediately stop the rendering.
f@0 41 */
f@0 42 public void renderCurve(Sequence m, float startTime);
f@0 43
f@0 44 /**
f@0 45 *
f@0 46 * Render a curve at precise time in sound.
f@0 47 *
f@0 48 * The sound lasts {@code duration} milliseconds and then fades out.
f@0 49 * If {@code INF} is passed as duration the sound will go on forever. Successive calls with {@code INF} as duration
f@0 50 * will have the effect of changing the sound in order to represent the curve at the new {@code time} passed as argument.
f@0 51 * Successive calls with {@code duration} different from {@code DURATION_INF} will carry on the sound for {@code duration}
f@0 52 * millisecond (and therefore setting {@code duration} to 0 will stop the sound).
f@0 53 *
f@0 54 * @param sequence the sequence to render
f@0 55 * @param time the time at which the sequence has to be rendered
f@0 56 * @param duration the duration of sound in millisecond. If (@code DURATION_INF) is used the sound
f@0 57 * will go on forever until it's stopped. To stop the sound use {@code duration = -1};
f@0 58 */
f@0 59 public void renderCurveAt(Sequence sequence, float time, float duration);
f@0 60
f@0 61 }