3 #include "recordlabel.h"
6 RecordLabel::RecordLabel(double position)
7 : ListItem<RecordLabel>()
9 this->position = position;
12 RecordLabel::~RecordLabel()
17 RecordLabels::RecordLabels()
22 RecordLabels::~RecordLabels()
26 int RecordLabels::delete_new_labels()
28 RecordLabel *current, *next_;
29 for(current = first; current; current = next_)
37 int RecordLabels::toggle_label(double position)
40 // find label the position is after
42 current && current->position < position;
50 //printf("position %ld current->position %ld current->original %d\n", position, current->position, current->original);
51 if(EQUIV(current->position, position))
59 insert_before(current);
60 current->position = position;
64 { // insert after last
65 //printf("position %ld\n", position);
66 append(new RecordLabel(position));
71 double RecordLabels::get_prev_label(double position)
76 current && current->position > position;
81 //printf("%ld\n", current->position);
82 if(current && current->position <= position)
83 return current->position;
89 double RecordLabels::get_next_label(double position)
94 current && current->position <= position;
99 if(current && current->position >= position) return current->position; else return -1;
103 double RecordLabels::goto_prev_label(double position)
105 RecordLabel *current;
108 current && current->position >= position;
113 //printf("%ld\n", current->position);
114 if(current && current->position <= position) return current->position; else return -1;
118 double RecordLabels::goto_next_label(double position)
120 RecordLabel *current;
123 current && current->position <= position;
128 if(current && current->position >= position) return current->position; else return -1;