00001 #ifndef LOCALSESSION_H 00002 #define LOCALSESSION_H 00003 00004 #include "bcwindowbase.inc" 00005 #include "bchash.inc" 00006 #include "edl.inc" 00007 #include "filexml.inc" 00008 00009 00010 // Unique session for every EDL 00011 00012 class LocalSession 00013 { 00014 public: 00015 LocalSession(EDL *edl); 00016 ~LocalSession(); 00017 00018 00019 // Get selected range based on precidence of in/out points and 00020 // highlighted region. 00021 // 1) If a highlighted selection exists it's used. 00022 // 2) If in_point or out_point exists they're used. 00023 // 3) If no in/out points exist, the insertion point is returned. 00024 // highlight_only - forces it to use highlighted region only. 00025 double get_selectionstart(int highlight_only = 0); 00026 double get_selectionend(int highlight_only = 0); 00027 double get_inpoint(); 00028 double get_outpoint(); 00029 int inpoint_valid(); 00030 int outpoint_valid(); 00031 void set_selectionstart(double value); 00032 void set_selectionend(double value); 00033 void set_inpoint(double value); 00034 void set_outpoint(double value); 00035 void unset_inpoint(); 00036 void unset_outpoint(); 00037 00038 00039 void copy_from(LocalSession *that); 00040 void save_xml(FileXML *file, double start); 00041 void load_xml(FileXML *file, unsigned long load_flags); 00042 int load_defaults(BC_Hash *defaults); 00043 int save_defaults(BC_Hash *defaults); 00044 // Used to copy parameters that affect rendering. 00045 void synchronize_params(LocalSession *that); 00046 00047 void boundaries(); 00048 00049 00050 EDL *edl; 00051 00052 00053 // Variables specific to each EDL 00054 // Number of samples if pasted from a clipboard. 00055 // If 0 use longest track 00056 double clipboard_length; 00057 // Title if clip 00058 char clip_title[BCTEXTLEN]; 00059 char clip_notes[BCTEXTLEN]; 00060 // Folder in parent EDL of clip 00061 char folder[BCTEXTLEN]; 00062 00063 int loop_playback; 00064 double loop_start; 00065 double loop_end; 00066 // Vertical start of track view 00067 int64_t track_start; 00068 // Horizontal start of view in pixels. This has to be pixels since either 00069 // samples or seconds would require drawing in fractional pixels. 00070 int64_t view_start; 00071 // Zooming of the timeline. Number of samples per pixel. 00072 int64_t zoom_sample; 00073 // Amplitude zoom 00074 int64_t zoom_y; 00075 // Track zoom 00076 int64_t zoom_track; 00077 // Vertical automation scale 00078 float automation_mins[6]; 00079 float automation_maxs[6]; 00080 int zoombar_showautotype; 00081 00082 // Eye dropper 00083 float red, green, blue; 00084 00085 // Range for CWindow and VWindow preview in seconds. 00086 double preview_start; 00087 double preview_end; 00088 00089 private: 00090 // The reason why selection ranges and inpoints have to be separate: 00091 // The selection position has to change to set new in points. 00092 // For editing functions we have a precidence for what determines 00093 // the selection. 00094 00095 double selectionstart, selectionend; 00096 double in_point, out_point; 00097 }; 00098 00099 #endif
1.5.5