Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

labels.h

Go to the documentation of this file.
00001 #ifndef LABEL_H
00002 #define LABEL_H
00003 
00004 #include <stdint.h>
00005 
00006 #include "edl.inc"
00007 #include "guicast.h"
00008 #include "filexml.inc"
00009 #include "labels.inc"
00010 #include "mwindow.inc"
00011 #include "recordlabel.inc"
00012 #include "stringfile.inc"
00013 #include "timebar.inc"
00014 
00015 #define LABELSIZE 15
00016 
00017 class LabelToggle : public BC_Label
00018 {
00019 public:
00020         LabelToggle(MWindow *mwindow, Label *label, int x, int y, long position);
00021         ~LabelToggle();
00022         
00023         int handle_event();
00024         MWindow *mwindow;
00025         Label *label;
00026 };
00027 
00028 class Label : public ListItem<Label>
00029 {
00030 public:
00031         Label(EDL *edl, Labels *labels, double position);
00032         Label();
00033         ~Label();
00034 
00035 
00036         EDL *edl;
00037         Labels *labels;
00038 // Seconds
00039         double position;
00040 };
00041 
00042 class Labels : public List<Label>
00043 {
00044 public:
00045         Labels(EDL *edl, char *xml_tag);
00046         virtual ~Labels();
00047 
00048         void dump();
00049 
00050         Labels& operator=(Labels &that);
00051         void copy_from(Labels *labels);
00052         int toggle_label(double start, double end);
00053         int delete_all();
00054         int save(FileXML *xml);
00055         int load(FileXML *xml, uint32_t load_flags);
00056         void insert_labels(Labels *labels, 
00057                 double start, 
00058                 double length, 
00059                 int paste_silence = 1);
00060 
00061         int modify_handles(double oldposition, 
00062                 double newposition, 
00063                 int currentend, 
00064                 int handle_mode,
00065                 int edit_labels);
00066         int copy(double start, double end, FileXML *xml);
00067         int copy_length(long start, long end); // return number of Labels in selection
00068         int insert(double start, double length);
00069         int paste(long start, long end, long total_length, FileXML *xml);
00070         int paste_output(long startproject, long endproject, long startsource, long endsource, RecordLabels *labels);
00071 // Setting follow to 1 causes labels to move forward after clear.
00072 // Setting it to 0 implies ignoring the labels follow edits setting.
00073         int clear(double start, double end, int follow = 1);
00074         int paste_silence(double start, double end);
00075         int optimize();  // delete duplicates
00076 // Get nearest labels or 0 if start or end of timeline
00077         Label* prev_label(double position);
00078         Label* next_label(double position);
00079 
00080         Label* label_of(double position); // first label on or after position
00081         MWindow *mwindow;
00082         TimeBar *timebar;
00083         EDL *edl;
00084         char *xml_tag;
00085 };
00086 
00087 #endif

Generated on Sun Jan 8 13:38:56 2006 for Cinelerra-svn by  doxygen 1.4.4