sequence class
[FTS Data Classes]


Detailed Description

The sequence class.

List of time-tagged values.


Functions

event_t * sequence_get_first (sequence_t *sequence)
 Get first event of a sequence.
event_t * sequence_get_last (sequence_t *sequence)
 Get last event of a sequence.
int sequence_get_size (sequence_t *sequence)
 Get size (number of events) of a sequence.
double sequence_get_last_time (sequence_t *sequence)
 Get timetag of last event in a sequence.
FTS_API double sequence_get_total_duration (sequence_t *sequence)
 Get duration of a sequence taking into account the duration of the events.
FTS_API void sequence_add_event (sequence_t *sequence, double time, event_t *event)
 Add an event to a sequence at a given time.
FTS_API void sequence_add_event_after (sequence_t *sequence, double time, event_t *event, event_t *after)
 Add an event to a sequence at a given time after a given event.
FTS_API void sequence_add_event_before (sequence_t *sequence, double time, event_t *event, event_t *before)
 Add an event to a sequence at a given time before a given event.
FTS_API void sequence_append_event (sequence_t *sequence, double time, event_t *event)
 Append an event to a sequence.
FTS_API void sequence_move_event (sequence_t *sequence, event_t *event, double time)
 Move an event within a sequence.
FTS_API void sequence_remove_event (sequence_t *sequence, event_t *event)
 Remove an event from a sequence.
FTS_API void sequence_copy (sequence_t *org, sequence_t *copy)
 Copy the events of a sequence to another.
FTS_API void sequence_copy_locked (sequence_t *from, sequence_t *to)
 Copy the events of a sequence to another with locks on both.
FTS_API void sequence_merge (sequence_t *sequence, sequence_t *merge)
 Merge the events of another sequence into a sequence.
FTS_API void sequence_merge_clear (sequence_t *sequence, sequence_t *merge)
 Merge and and clear the events of another sequence into a sequence.
FTS_API void sequence_clear (sequence_t *sequence)
 Remove all events from a sequence.
FTS_API event_t * sequence_get_event_by_time (sequence_t *sequence, double time)
 Get the first event at or after a given time of a sequence.
FTS_API event_t * sequence_get_event_by_index (sequence_t *sequence, int index)
 Get the event at a given index of a sequence.
FTS_API event_t * sequence_get_next_by_time (sequence_t *sequence, double time)
 Get the next event after given time of a sequence.
FTS_API event_t * sequence_get_next_by_time_after (sequence_t *sequence, double time, event_t *here)
 Get the next event after given time (starting from a given event).
FTS_API event_t * sequence_get_left_by_time_from (sequence_t *sequence, double time, event_t *here)
 Get event before or at given time (starting from a given event).
FTS_API void sequence_segment_get (sequence_t *sequence, double begin, double end, event_t **first, event_t **after)
 Get segment by time (begin and end).
FTS_API void sequence_segment_shift (sequence_t *sequence, event_t *first, event_t *after, double begin, double end, double shift)
 Move all events in a given segment of a sequence.
FTS_API void sequence_segment_stretch (sequence_t *sequence, double begin, double end, double stretch)
 Time-stretch all events in a given segment of a sequence.
FTS_API void sequence_segment_quantize (sequence_t *sequence, double begin, double end, double quantize)
 Quantize time and duration of all events in a given segment of a sequence.

Variables

FTS_API fts_class_tsequence_class
 The sequence class identifier (pointer to class instance).


Function Documentation

FTS_API void sequence_add_event ( sequence_t *  sequence,
double  time,
event_t *  event 
)

Add an event to a sequence at a given time.

Parameters:
sequence the sequence
time timetag for event
event to be added event

FTS_API void sequence_add_event_after ( sequence_t *  sequence,
double  time,
event_t *  event,
event_t *  after 
)

Add an event to a sequence at a given time after a given event.

Parameters:
sequence the sequence
time timetag for event
event to be added event
after add new event after this one ...

FTS_API void sequence_add_event_before ( sequence_t *  sequence,
double  time,
event_t *  event,
event_t *  before 
)

Add an event to a sequence at a given time before a given event.

Parameters:
sequence the sequence
time timetag for event
event to be added event
before add new event before this one ...

FTS_API void sequence_append_event ( sequence_t *  sequence,
double  time,
event_t *  event 
)

Append an event to a sequence.

Parameters:
sequence the sequence
time timetag for event
event to be added event

FTS_API void sequence_clear ( sequence_t *  sequence  ) 

Remove all events from a sequence.

Parameters:
sequence the sequence

FTS_API void sequence_copy ( sequence_t *  org,
sequence_t *  copy 
)

Copy the events of a sequence to another.

Parameters:
org the original sequence
copy copy sequence

FTS_API void sequence_copy_locked ( sequence_t *  from,
sequence_t *  to 
)

Copy the events of a sequence to another with locks on both.

Parameters:
org the original sequence
copy copy sequence

FTS_API event_t* sequence_get_event_by_index ( sequence_t *  sequence,
int  index 
)

Get the event at a given index of a sequence.

Parameters:
sequence the sequence
index the index
Returns:
the event

FTS_API event_t* sequence_get_event_by_time ( sequence_t *  sequence,
double  time 
)

Get the first event at or after a given time of a sequence.

Parameters:
sequence the sequence
time the time
Returns:
the event

event_t* sequence_get_first ( sequence_t *  sequence  ) 

Get first event of a sequence.

Parameters:
sequence the sequence
Returns:
first event in sequence

event_t* sequence_get_last ( sequence_t *  sequence  ) 

Get last event of a sequence.

Parameters:
sequence the sequence
Returns:
last event in sequence

double sequence_get_last_time ( sequence_t *  sequence  ) 

Get timetag of last event in a sequence.

Also known as sequence_get_duration().

Parameters:
sequence the sequence
Returns:
timetag of last event

FTS_API event_t* sequence_get_left_by_time_from ( sequence_t *  sequence,
double  time,
event_t *  here 
)

Get event before or at given time (starting from a given event).

Parameters:
sequence the sequence
time the time
here search starts from this event
Returns:
the event
get event before or at given time, search in descending time order starts at given event, if not NULL (N.B.: if time is before first event, the first event is returned(?)

FTS_API event_t* sequence_get_next_by_time ( sequence_t *  sequence,
double  time 
)

Get the next event after given time of a sequence.

Parameters:
sequence the sequence
time the time
Returns:
the event

FTS_API event_t* sequence_get_next_by_time_after ( sequence_t *  sequence,
double  time,
event_t *  here 
)

Get the next event after given time (starting from a given event).

Parameters:
sequence the sequence
time the time
here search start from this event
Returns:
the event

int sequence_get_size ( sequence_t *  sequence  ) 

Get size (number of events) of a sequence.

Parameters:
sequence the sequence
Returns:
sequence size

FTS_API double sequence_get_total_duration ( sequence_t *  sequence  ) 

Get duration of a sequence taking into account the duration of the events.

Parameters:
sequence the sequence
Returns:
sequence duration

FTS_API void sequence_merge ( sequence_t *  sequence,
sequence_t *  merge 
)

Merge the events of another sequence into a sequence.

Parameters:
sequence the sequence
merge another sequence of which the elements are merged into the first sequence.

FTS_API void sequence_merge_clear ( sequence_t *  sequence,
sequence_t *  merge 
)

Merge and and clear the events of another sequence into a sequence.

The sequence given as second argument is empty after calling this function.

Parameters:
sequence first sequence
merge merge in sequence and clear it

FTS_API void sequence_move_event ( sequence_t *  sequence,
event_t *  event,
double  time 
)

Move an event within a sequence.

Parameters:
sequence the sequence
event to be added event
time new timetag for event

FTS_API void sequence_remove_event ( sequence_t *  sequence,
event_t *  event 
)

Remove an event from a sequence.

Parameters:
sequence the sequence
event to be removed event

FTS_API void sequence_segment_get ( sequence_t *  sequence,
double  begin,
double  end,
event_t **  first,
event_t **  after 
)

Get segment by time (begin and end).

The function returns the event at the beginning of the segment and the next event after the end of the segment (or NULL if the segment end with the last event of the sequence).

Parameters:
sequence the sequence
begin starting time
end end time
first start search from this event
after next event after the segment

FTS_API void sequence_segment_quantize ( sequence_t *  sequence,
double  begin,
double  end,
double  quantize 
)

Quantize time and duration of all events in a given segment of a sequence.

The function multiplies all event times and durations (if any).

Parameters:
sequence the sequence
begin starting time
end end time
quantize quantization period

FTS_API void sequence_segment_shift ( sequence_t *  sequence,
event_t *  first,
event_t *  after,
double  begin,
double  end,
double  shift 
)

Move all events in a given segment of a sequence.

Parameters:
sequence the sequence
first start search from this event
after next event after the segment
begin starting time
end end time
shift shift in milliseconds

FTS_API void sequence_segment_stretch ( sequence_t *  sequence,
double  begin,
double  end,
double  stretch 
)

Time-stretch all events in a given segment of a sequence.

The function multiplies all event times and durations (if any). The events after the given segment will be simply sgifted.

Parameters:
sequence the sequence
begin starting time
end end time
stretch stretch factor


Generated on Wed Aug 24 18:28:43 2011 for FTM API by  doxygen 1.5.6