r105: This commit was manufactured by cvs2svn to create tag
[cinelerra_cv/mob.git] / hvirtual / cinelerra / labels.h
blob7e365f182297f6ba39e0a66f6ed86d76be555a1f
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);
32 Label();
33 ~Label();
36 EDL *edl;
37 Labels *labels;
38 // Seconds
39 double position;
42 class Labels : public List<Label>
44 public:
45 Labels(EDL *edl, char *xml_tag);
46 virtual ~Labels();
48 void dump();
50 Labels& operator=(Labels &that);
51 void copy_from(Labels *labels);
52 int toggle_label(double start, double end);
53 int delete_all();
54 int save(FileXML *xml);
55 int load(FileXML *xml, uint32_t load_flags);
56 void insert_labels(Labels *labels,
57 double start,
58 double length,
59 int paste_silence = 1);
61 int modify_handles(double oldposition,
62 double newposition,
63 int currentend,
64 int handle_mode,
65 int edit_labels);
66 int copy(double start, double end, FileXML *xml);
67 int copy_length(long start, long end); // return number of Labels in selection
68 int insert(double start, double length);
69 int paste(long start, long end, long total_length, FileXML *xml);
70 int paste_output(long startproject, long endproject, long startsource, long endsource, RecordLabels *labels);
71 // Setting follow to 1 causes labels to move forward after clear.
72 // Setting it to 0 implies ignoring the labels follow edits setting.
73 int clear(double start, double end, int follow = 1);
74 int paste_silence(double start, double end);
75 int optimize(); // delete duplicates
76 // Get nearest labels or 0 if start or end of timeline
77 Label* prev_label(double position);
78 Label* next_label(double position);
80 Label* label_of(double position); // first label on or after position
81 MWindow *mwindow;
82 TimeBar *timebar;
83 EDL *edl;
84 char *xml_tag;
87 #endif