mask xy scale, mask boundary only overlay, fix 8 char mask nm bug, rework maskgui...
[goodguy/cinelerra.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 "automation.inc"
26 #include "bcwindowbase.inc"
27 #include "bchash.inc"
28 #include "edl.inc"
29 #include "filexml.inc"
30 #include "mwindowgui.inc"
31
32 // Unique session for every EDL
33
34 class LocalSession
35 {
36 public:
37         LocalSession(EDL *edl);
38         ~LocalSession();
39
40 // Get selected range based on precidence of in/out points and
41 // highlighted region.
42 // 1) If a highlighted selection exists it's used.
43 // 2) If in_point or out_point exists they're used.
44 // 3) If no in/out points exist, the insertion point is returned.
45 // highlight_only - forces it to use highlighted region only.
46         double get_selectionstart(int highlight_only = 0);
47         double get_selectionend(int highlight_only = 0);
48         double get_inpoint();
49         double get_outpoint();
50         int inpoint_valid();
51         int outpoint_valid();
52         void set_selectionstart(double value);
53         void set_selectionend(double value);
54         void set_inpoint(double value);
55         void set_outpoint(double value);
56         void unset_inpoint();
57         void unset_outpoint();
58         void set_playback_start(double value);
59         void set_playback_end(double value);
60
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);
68
69         void boundaries();
70
71         EDL *edl;
72
73 // Variables specific to each EDL
74 // Number of samples if pasted from a clipboard.
75 // If 0 use longest track
76         double clipboard_length;
77 // edl created by asset_to_edl
78         int asset2edl;
79 // Title if clip
80         char clip_title[BCTEXTLEN];
81         char clip_notes[BCTEXTLEN];
82         char clip_icon[BCSTRLEN];
83
84         int loop_playback;
85         double loop_start, loop_end;
86         double playback_start, playback_end;
87         double preview_start, preview_end;
88
89 // Vertical start of track view in pixels
90         int track_start[TOTAL_PANES];
91 // Horizontal start of view in pixels.  This has to be pixels since either
92 // samples or seconds would require drawing in fractional pixels.
93         int64_t view_start[TOTAL_PANES];
94 // position of pane dividers or -1 if none
95         int x_pane, y_pane;
96
97 // Zooming of the timeline.  Number of samples per pixel.
98         int64_t zoom_sample;
99 // Amplitude zoom
100         int64_t zoom_y;
101 // Track zoom
102         int64_t zoom_track;
103 // Vertical automation scale
104
105         float automation_mins[AUTOGROUPTYPE_COUNT];
106         float automation_maxs[AUTOGROUPTYPE_COUNT];
107         int zoombar_showautotype, zoombar_showautocolor;
108 // Default type of float keyframe
109         int floatauto_type;
110
111 // Eye dropper
112         float red, green, blue;
113         float red_max, green_max, blue_max;
114         int use_max;
115 // mask solo track, or -1
116         int solo_track_id;
117 private:
118 // The reason why selection ranges and inpoints have to be separate:
119 // The selection position has to change to set new in points.
120 // For editing functions we have a precidence for what determines
121 // the selection.
122
123         double selectionstart, selectionend;
124         double in_point, out_point;
125 };
126
127 #endif