46 #include "EST_FMatrix.h" 
   47 #include "EST_types.h" 
   48 #include "EST_TrackMap.h" 
   49 #include "EST_ChannelType.h" 
   50 #include "EST_Featured.h" 
   57 typedef enum EST_TrackFileType {
 
   78 typedef enum EST_InterpType {
 
  108     void default_channel_names();
 
  112     int interp_value(
float x, 
float f);
 
  113     float interp_amp(
float x, 
int c, 
float f);
 
  114     float estimate_shift(
float x);
 
  118     static const float default_frame_shift;
 
  119     static const int default_sample_rate;
 
  151     void resize(
int num_frames, 
int num_channels, 
bool preserve = 1);
 
  170     { 
resize(EST_CURRENT, n, preserve); }
 
  178     { 
resize(n, EST_CURRENT, preserve); }
 
  196        { 
return f_String(
"name");}
 
  210     { p_values.
row(fv, n, startf, nf); }
 
  215     { p_values.
column(cv, n, startf, nf); }
 
  235              int start_frame=0, 
int nframes=EST_ALL,
 
  236            int start_chan=0, 
int nchans=EST_ALL);
 
  251              int start_frame, 
int nframes,
 
  268              int start_frame, 
int nframes,
 
  286            int start_frame=0, 
int nframes=EST_ALL,
 
  287            int start_chan=0, 
int nchans=EST_ALL)
 const 
  288     { ((
EST_Track *)
this)->sub_track(st, start_frame, nframes, 
 
  289                      start_chan, nchans); } 
 
  303              int start_frame=0, 
int nframes=EST_ALL,
 
  304              int start_chan=0, 
int nchans=EST_ALL) 
const;
 
  321     const {p_values.
copy_row(n, buf, offset, num); } 
 
  325         const {p_values.
copy_row(n, f, offset, num); } 
 
  339              const EST_Track &from, 
int from_c, 
int from_offset=0,
 
  340              int offset=0, 
int num=EST_ALL)
 
  341     { p_values.
set_column(c, from.p_values, from_c, 
 
  342                   from_offset, offset, num); }
 
  347     { p_values.
set_row(n, buf, offset, num); }
 
  352     { p_values.
set_row(n, t, offset, num); }
 
  356            const EST_Track &from, 
int from_f, 
int from_offset=0, 
 
  357            int offset=0, 
int num=EST_ALL)
 
  358     { p_values.
set_row(i, from.p_values, from_f, from_offset, offset, 
 
  414     float &
a(
int i, 
int c=0);
 
  415     float a(
int i, 
int c=0) 
const;
 
  429     float &
a(
int i, 
const char *
name, 
int offset=0);
 
  431     float  a(
int i, 
const char *
name, 
int offset=0)
 const 
  432     { 
return ((
EST_Track *)
this)->a(i, name, offset); }
 
  434     { 
return a(i, (
const char *)name, offset); }
 
  435     float  a(
int i, 
EST_String name, 
int offset=0)
 const 
  436     { 
return ((
EST_Track *)
this)->a(i, (
const char *)name, offset); }
 
  449     float &
a(
float t, 
int c=0, EST_InterpType interp=it_nearest);   
 
  450     float  a(
float t, 
int c=0, EST_InterpType interp=it_nearest)
 const 
  451     { 
return ((
EST_Track *)
this)->a(t, c, interp); }    
 
  458     float  operator() (
int i, 
int c)
 const { 
return a(i,c); }   
 
  465     float  operator() (
float t, 
int c)
 const {
return a(t,c); }
 
  477     float &
t(
int i=0)              { 
return p_times[i]; }
 
  478     float  t(
int i=0)
 const                    { 
return p_times(i); } 
 
  481     float ms_t(
int i)
 const        { 
return p_times(i) * 1000.0; }
 
  551     EST_Val &aux(
int i, 
int c) 
const;
 
  553     EST_Val &aux(
int i, 
const char *name);
 
  554     EST_Val aux(
int i, 
const char *name)
 const 
  555     { 
return ((
EST_Track *)
this)->aux(i, name); }
 
  558     { 
return aux(i, (
const char *)name); }
 
  561     { 
return ((
EST_Track *)
this)->aux(i, (
const char *)name); }
 
  581     EST_read_status 
load(
const EST_String name, 
float ishift = 0.0, 
float startt = 0.0);
 
  607              float ishift = 0.0, 
float startt = 0.0 );
 
  615     EST_write_status 
save(FILE *fp,
 
  631     int val(
int i) 
const;
 
  644     int index(
float t) 
const;       
 
  661     void add_trailing_breaks();
 
  662     void rm_trailing_breaks();
 
  674     void set_equal_space(
bool t) {p_equal_space = 
t;}
 
  675     void set_single_break(
bool t) {p_single_break = 
t;}
 
  684     friend ostream& operator << (ostream& s, 
const EST_Track &tr);
 
  691     void assign_map(
EST_TrackMap &map) { assign_map(&map); }
 
  695     void create_map(
void) { create_map(EST_default_channel_names); }
 
  704     float &
a(
int i, EST_ChannelType c, 
int offset=0);
 
  705     float  a(
int i, EST_ChannelType c, 
int offset=0)
 const 
  706     { 
return ((
EST_Track *)
this)->a(i,c, offset); }
 
  709     float &
a(
float t, EST_ChannelType c, EST_InterpType interp=it_nearest);
 
  710     float  a(
float t, EST_ChannelType c, EST_InterpType interp=it_nearest)
 const 
  711     { 
return ((
EST_Track *)
this)->a(t, c, interp); }
 
  713     float &
operator() (
int i, EST_ChannelType c)       { 
return a(i,c); }
 
  714     float  operator() (
int i, EST_ChannelType c)
 const { 
return a(i,c); }
 
  716     float &t_offset()              { 
return p_t_offset; }
 
  717     float t_offset()
 const         { 
return p_t_offset; }
 
  720     EST_read_status load_channel_names(
const EST_String name);
 
  721     EST_write_status save_channel_names(
const EST_String name);
 
  725     { 
return channel_name(channel, EST_default_channel_names, strings_override); }
 
  728     { 
return p_aux_names(channel);}
 
  732     EST_TrackFileType file_type()
 const {
return (EST_TrackFileType)f_Int(
"file_type",0);}
 
  735     void set_file_type(EST_TrackFileType t) {f_set(
"file_type", (
int)t);}
 
  753   void point_to_first(
IPointer_f &ip)
 const { ip.i = 0; }
 
  754   void move_pointer_forwards(IPointer_f &ip)
 const { ip.i++; }
 
  755   bool points_to_something(
const IPointer_f &ip)
 const { 
return ip.i <
num_frames(); }
 
  757                      return *(ip.frame); }