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@2
|
34 /**
|
f@2
|
35 * renders a single value of the sequence
|
f@2
|
36 * @param val
|
f@2
|
37 */
|
f@0
|
38 public void renderValue(Sequence.Value val);
|
f@0
|
39
|
f@0
|
40 /**
|
f@2
|
41 * Renders the whole curve, from start to end
|
f@0
|
42 *
|
f@0
|
43 * @param m
|
f@0
|
44 * @param startTime the time in millisecond the curve rendering has to start from, if
|
f@0
|
45 * -1 will immediately stop the rendering.
|
f@0
|
46 */
|
f@0
|
47 public void renderCurve(Sequence m, float startTime);
|
f@0
|
48
|
f@0
|
49 /**
|
f@0
|
50 *
|
f@2
|
51 * Render a curve at precise time
|
f@0
|
52 *
|
f@2
|
53 * If sound is used for rendering, the sound lasts {@code duration} milliseconds and then fades out.
|
f@0
|
54 * If {@code INF} is passed as duration the sound will go on forever. Successive calls with {@code INF} as duration
|
f@0
|
55 * will have the effect of changing the sound in order to represent the curve at the new {@code time} passed as argument.
|
f@0
|
56 * Successive calls with {@code duration} different from {@code DURATION_INF} will carry on the sound for {@code duration}
|
f@0
|
57 * millisecond (and therefore setting {@code duration} to 0 will stop the sound).
|
f@0
|
58 *
|
f@0
|
59 * @param sequence the sequence to render
|
f@0
|
60 * @param time the time at which the sequence has to be rendered
|
f@0
|
61 * @param duration the duration of sound in millisecond. If (@code DURATION_INF) is used the sound
|
f@0
|
62 * will go on forever until it's stopped. To stop the sound use {@code duration = -1};
|
f@0
|
63 */
|
f@0
|
64 public void renderCurveAt(Sequence sequence, float time, float duration);
|
f@0
|
65
|
f@0
|
66 }
|