4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef LOCALSESSION_H
23 #define LOCALSESSION_H
25 #include "bcwindowbase.inc"
28 #include "filexml.inc"
29 #include "mwindowgui.inc"
32 // Unique session for every EDL
37 LocalSession(EDL *edl);
41 // Get selected range based on precidence of in/out points and
42 // highlighted region.
43 // 1) If a highlighted selection exists it's used.
44 // 2) If in_point or out_point exists they're used.
45 // 3) If no in/out points exist, the insertion point is returned.
46 // highlight_only - forces it to use highlighted region only.
47 double get_selectionstart(int highlight_only = 0);
48 double get_selectionend(int highlight_only = 0);
50 double get_outpoint();
53 void set_selectionstart(double value);
54 void set_selectionend(double value);
55 void set_inpoint(double value);
56 void set_outpoint(double value);
58 void unset_outpoint();
61 void copy_from(LocalSession *that);
62 void save_xml(FileXML *file, double start);
63 void load_xml(FileXML *file, unsigned long load_flags);
64 int load_defaults(BC_Hash *defaults);
65 int save_defaults(BC_Hash *defaults);
66 // Used to copy parameters that affect rendering.
67 void synchronize_params(LocalSession *that);
75 // Variables specific to each EDL
76 // Number of samples if pasted from a clipboard.
77 // If 0 use longest track
78 double clipboard_length;
80 char clip_title[BCTEXTLEN];
81 char clip_notes[BCTEXTLEN];
82 // Folder in parent EDL of clip
83 char folder[BCTEXTLEN];
91 // Vertical start of track view in pixels
92 int64_t track_start[TOTAL_PANES];
93 // Horizontal start of view in pixels. This has to be pixels since either
94 // samples or seconds would require drawing in fractional pixels.
95 int64_t view_start[TOTAL_PANES];
96 // position of pane dividers or -1 if none
101 // Zooming of the timeline. Number of samples per pixel.
107 // Vertical automation scale
108 float automation_min;
109 float automation_max;
110 // Default type of float keyframe
114 float red, green, blue;
116 double preview_start;
120 // The reason why selection ranges and inpoints have to be separate:
121 // The selection position has to change to set new in points.
122 // For editing functions we have a precidence for what determines
125 double selectionstart, selectionend;
126 double in_point, out_point;