11 static std::vector<SeqTrack> tracks;
20 int ntrk = tracks.size();
21 for(int i=0; i<ntrk; i++) {
22 delete tracks[i].track;
23 delete [] tracks[i].name;
28 int add_seq_track(const char *name, InterpMode inmode, ExtrapMode exmode, float defval)
30 int idx = find_seq_track(name);
31 if(idx >= 0) return idx;
34 st.name = new char[strlen(name) + 1];
35 strcpy(st.name, name);
37 st.track->defval = defval;
38 st.track->interp = inmode;
39 st.track->extrap = exmode;
41 return tracks.size() - 1;
44 int find_seq_track(const char *name)
46 int ntrk = tracks.size();
47 for(int i=0; i<ntrk; i++) {
48 if(strcmp(tracks[i].name, name) == 0) {
55 Track *get_seq_track(int idx)
57 return tracks[idx].track;
60 void clear_seq_track(int idx)
62 tracks[idx].track->clear();
65 void clear_seq_track(const char *name)
67 int idx = find_seq_track(name);
69 tracks[idx].track->clear();
73 void set_seq_value(int idx, long tm, float val)
75 tracks[idx].track->set_key(tm, val);
78 void set_seq_value(const char *name, long tm, float val)
80 int idx = find_seq_track(name);
82 tracks[idx].track->set_key(tm, val);
86 float get_seq_value(int idx, long tm)
88 return (*tracks[idx].track)(tm);
91 float get_seq_value(const char *name, long tm)
93 int idx = find_seq_track(name);
97 return (*tracks[idx].track)(tm);
100 bool load_seq(const char *fname)
102 return false; /* TODO */