initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / tracking.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 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 TRACKING_H
23 #define TRACKING_H
24
25 #include <sys/time.h>
26 #include <sys/types.h>
27 #include <unistd.h>
28
29 #include "condition.inc"
30 #include "mwindow.inc"
31 #include "mwindowgui.inc"
32 #include "playbackengine.inc"
33 #include "thread.h"
34 #include "bctimer.h"
35
36 class Tracking : public Thread
37 {
38 public:
39         Tracking(MWindow *mwindow);
40         virtual ~Tracking();
41
42         void create_objects();
43         virtual int start_playback(double new_position);
44         virtual int stop_playback();
45
46 // Called by the tracker to get the current position
47         virtual PlaybackEngine* get_playback_engine();
48         virtual double get_tracking_position();
49 // Update position displayed
50         virtual void update_tracker(double position);
51 // Update meters
52         virtual void update_meters(int64_t position);
53         virtual void stop_meters();
54 //      int get_pixel(double position);
55
56 // Erase cursor if it's visible.  Called by start_playback
57 // Draw new cursor at last_position if invisible
58         virtual void draw();
59
60
61
62         void run();
63
64 // Values to return from playback_engine to update_meter .
65 // Use ArrayList to simplify module counting
66         ArrayList<double> module_levels;
67         int state;
68
69
70
71
72
73
74
75
76
77
78         void show_playback_cursor(int64_t position);
79         int view_follows_playback;
80 // Delay until startup
81         Condition *startup_lock;
82         MWindow *mwindow;
83         MWindowGUI *gui;
84         double last_position;
85         int follow_loop;
86         int64_t current_offset;
87         int reverse;
88         int double_speed;
89         Timer timer;
90 // Pixel of last drawn cursor
91         int pixel;
92 // Cursor is visible
93         int visible;
94 };
95
96 #endif