Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / cinelerra / localsession.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef LOCALSESSION_H
23 #define LOCALSESSION_H
24
25 #include "bcwindowbase.inc"
26 #include "bchash.inc"
27 #include "edl.inc"
28 #include "filexml.inc"
29 #include "mwindowgui.inc"
30
31 // Unique session for every EDL
32
33 class LocalSession
34 {
35 public:
36         LocalSession(EDL *edl);
37         ~LocalSession();
38
39 // Get selected range based on precidence of in/out points and
40 // highlighted region.
41 // 1) If a highlighted selection exists it's used.
42 // 2) If in_point or out_point exists they're used.
43 // 3) If no in/out points exist, the insertion point is returned.
44 // highlight_only - forces it to use highlighted region only.
45         double get_selectionstart(int highlight_only = 0);
46         double get_selectionend(int highlight_only = 0);
47         double get_inpoint();
48         double get_outpoint();
49         int inpoint_valid();
50         int outpoint_valid();
51         void set_selectionstart(double value);
52         void set_selectionend(double value);
53         void set_inpoint(double value);
54         void set_outpoint(double value);
55         void unset_inpoint();
56         void unset_outpoint();
57         void set_playback_start(double value);
58         void set_playback_end(double value);
59
60         void copy_from(LocalSession *that);
61         void save_xml(FileXML *file, double start);
62         void load_xml(FileXML *file, unsigned long load_flags);
63         int load_defaults(BC_Hash *defaults);
64         int save_defaults(BC_Hash *defaults);
65 // Used to copy parameters that affect rendering.
66         void synchronize_params(LocalSession *that);
67
68         void boundaries();
69
70         EDL *edl;
71
72 // Variables specific to each EDL
73 // Number of samples if pasted from a clipboard.
74 // If 0 use longest track
75         double clipboard_length;
76 // Title if clip
77         char clip_title[BCTEXTLEN];
78         char clip_notes[BCTEXTLEN];
79 // Folder in parent EDL of clip
80         char folder[BCTEXTLEN];
81
82         int loop_playback;
83         double loop_start, loop_end;
84         double playback_start, playback_end;
85         double preview_start, preview_end;
86
87 // Vertical start of track view in pixels
88         int64_t track_start[TOTAL_PANES];
89 // Horizontal start of view in pixels.  This has to be pixels since either
90 // samples or seconds would require drawing in fractional pixels.
91         int64_t view_start[TOTAL_PANES];
92 // position of pane dividers or -1 if none
93         int x_pane, y_pane;
94
95 // Zooming of the timeline.  Number of samples per pixel.
96         int64_t zoom_sample;
97 // Amplitude zoom
98         int64_t zoom_y;
99 // Track zoom
100         int64_t zoom_track;
101 // Vertical automation scale
102
103         float automation_mins[6];
104         float automation_maxs[6];
105         int zoombar_showautotype;
106 // Default type of float keyframe
107         int floatauto_type;
108
109 // Eye dropper
110         float red, green, blue;
111 private:
112 // The reason why selection ranges and inpoints have to be separate:
113 // The selection position has to change to set new in points.
114 // For editing functions we have a precidence for what determines
115 // the selection.
116
117         double selectionstart, selectionend;
118         double in_point, out_point;
119 };
120
121 #endif