20 #include "../basic_types.h"
22 #include "../exception.h"
Base class for all exceptions.
Represents a continuous set of data samples.
AccessException(const char *message, const Sequence &sequence)
Points to a position within a sequence.
void moveTo(dtime time)
Sets pointer to a specific time.
FragmentPtr pointer
pointed fragment
void jump(dtime by)
Moves the pointer by a given number of samples relatively to the current position.
void watch()
Enables "watching mode", i.e., if the sequence is modified, the pointer will follow the modifications...
Pointer(Sequence &sequence, dtime time, bool writing)
void step()
Moves the pointer forward an arbitrary number of samples.
bool writing
if true, the pointer is used to modify the data
bool watching
if true, the pointer will remain valid even if the sequence is being modified
int samplesAvailable() const
Fragmented signal in time domain.
std::vector< Pointer * > pointers
pointers currently accessing the sequence
int findFragment(dtime time) const
Log search for a fragment containing given time moment.
void remove(dtime fromTime, dtime toTime)
Erases a part of the sequence between two given time moments.
void shrink(dtime timeLeft, dtime timeRight)
Shrinks the sequence to given time bounds.
const dtime getDuration() const
Returns sequence duration in number of samples.
static const int VOID_RIGHT
returned by getFragment() when the entire sequence is on the left of the given time moment
void splitFragment(int index, dtime delta)
Splits a given fragment in two.
void split(dtime time, Sequence *left, Sequence *right) const
Splits the sequence in two at a specific time.
std::vector< dtime > cumTimes
cumulative sum of fragment lengths, starts from 0, of N+1 entries (N = num. of fragments)
virtual Sequence * createEmpty() const =0
Initializes an empty sequence, used to bootstrap copying operations.
void syncPointers()
Resets pointers once the sequence changes to keep them consistent.
void concatenate(Fragment &fragment, dtime offset, dtime length)
Adds a new fragment at the end of the sequence.
void clear()
Removes the content of the sequence making it empty (of zero duration).
bool isEmpty() const
Returns true if sequence contains no samples.
std::vector< FragmentPtr > fragments
the content
static const int VOID_LEFT
returned by getFragment() when the entire sequence is on the right of the given time moment
void insert(const Sequence &sequence, dtime time)
Inserts a Sequence at a given position in time.
Sequence * copy(dtime fromTime, dtime toTime) const
Copies a given piece of the current sequence into new Sequence.
Beatmup object base class
int length
number of samples to use from the fragment
JNIEnv jobject jint jint jint jfloat fragment
jlong jlong jint jint jint jint jint left