Mercurial > hg > cmdp
diff src/uk/ac/qmul/eecs/depic/patterns/Sequence.java @ 0:3074a84ef81e
first import
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Wed, 26 Aug 2015 16:16:53 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/uk/ac/qmul/eecs/depic/patterns/Sequence.java Wed Aug 26 16:16:53 2015 +0100 @@ -0,0 +1,62 @@ +/* + 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 sequence of values arranged over time. + * + * The values are ordered by time, therefore given @ {@code i} and {@code j} such that {@code (i < j)}, the following expression is always true : + * {@code sequence.getValueAt(i).getTimePosition() <= sequence.getValueAt(j).getTimePosition()} + * + * The values are limited in range. {@code getRange()) returns the range + * of float values that a sequence value can assume. + * + */ +public interface Sequence { + public float getBegin(); + + public float getEnd(); + + public int getValuesNum(); + + public Value getValueAt(int index); + + public Range<Float> getRange(); + + public void addSequenceListener(SequenceListener l); + + public void removeSequenceListener(SequenceListener l); + + /** + * The length of the sequence in millisecons + * @return + */ + public float getLen(); + + public interface Value { + public float getValue(); + + public float getTimePosition(); + + public Sequence getSequence(); + + public int index(); + } +}