r1014: Enable horizontal scrolling with the mouse wheel by pressing Ctrl.
[cinelerra_cv/ct.git] / cinelerra / labels.h
blob06eac33933e8636d6d5b4b988daaed4b63f2fd03
1 #ifndef LABEL_H
2 #define LABEL_H
4 #include <stdint.h>
6 #include "edl.inc"
7 #include "guicast.h"
8 #include "filexml.inc"
9 #include "labels.inc"
10 #include "mwindow.inc"
11 #include "recordlabel.inc"
12 #include "stringfile.inc"
13 #include "timebar.inc"
15 #define LABELSIZE 15
17 class LabelToggle : public BC_Label
19 public:
20 LabelToggle(MWindow *mwindow, Label *label, int x, int y, long position);
21 ~LabelToggle();
23 int handle_event();
24 MWindow *mwindow;
25 Label *label;
28 class Label : public ListItem<Label>
30 public:
31 Label(EDL *edl, Labels *labels, double position, char *textstr);
32 Label();
33 ~Label();
36 EDL *edl;
37 Labels *labels;
38 char textstr[BCTEXTLEN];
39 // Seconds
40 double position;
43 class Labels : public List<Label>
45 public:
46 Labels(EDL *edl, char *xml_tag);
47 virtual ~Labels();
49 void dump();
51 Labels& operator=(Labels &that);
52 void copy_from(Labels *labels);
53 int toggle_label(double start, double end);
54 int delete_all();
55 int save(FileXML *xml);
56 int load(FileXML *xml, uint32_t load_flags);
57 void insert_labels(Labels *labels,
58 double start,
59 double length,
60 int paste_silence = 1);
62 int modify_handles(double oldposition,
63 double newposition,
64 int currentend,
65 int handle_mode,
66 int edit_labels);
67 int copy(double start, double end, FileXML *xml);
68 int copy_length(long start, long end); // return number of Labels in selection
69 int insert(double start, double length);
70 int paste(long start, long end, long total_length, FileXML *xml);
71 int paste_output(long startproject, long endproject, long startsource, long endsource, RecordLabels *labels);
72 // Setting follow to 1 causes labels to move forward after clear.
73 // Setting it to 0 implies ignoring the labels follow edits setting.
74 int clear(double start, double end, int follow = 1);
75 int paste_silence(double start, double end);
76 int optimize(); // delete duplicates
77 // Get nearest labels or 0 if start or end of timeline
78 Label* prev_label(double position);
79 Label* next_label(double position);
81 Label* label_of(double position); // first label on or after position
82 MWindow *mwindow;
83 TimeBar *timebar;
84 EDL *edl;
85 char *xml_tag;
88 #endif