3947ac6d3a3270cbd9666bbee53ea46267ef5083
[goodguy/history.git] / cinelerra-5.1 / 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         void run();
60
61 // Values to return from playback_engine to update_meter .
62 // Use ArrayList to simplify module counting
63         ArrayList<double> module_levels;
64         int state;
65
66         void show_playback_cursor(int64_t position);
67         int view_follows_playback;
68 // Delay until startup
69         Condition *startup_lock;
70         MWindow *mwindow;
71         double last_position;
72         Timer timer;
73 };
74
75 #endif