r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / vtracking.C
blob04325c28fa652ffc76f998e50b7117ce326ca2b3
1 #include "edl.h"
2 #include "edlsession.h"
3 #include "localsession.h"
4 #include "mainclock.h"
5 #include "meterpanel.h"
6 #include "mwindow.h"
7 #include "vplayback.h"
8 #include "vtimebar.h"
9 #include "vtracking.h"
10 #include "vwindow.h"
11 #include "vwindowgui.h"
14 VTracking::VTracking(MWindow *mwindow, VWindow *vwindow)
15  : Tracking(mwindow)
17         this->vwindow = vwindow;
20 VTracking::~VTracking()
24 PlaybackEngine* VTracking::get_playback_engine()
26         return vwindow->playback_engine;
29 void VTracking::update_tracker(double position)
31 //printf("VTracking::update_tracker %ld\n", position);
32         vwindow->gui->lock_window();
33         vwindow->get_edl()->local_session->selectionstart = 
34                 vwindow->get_edl()->local_session->selectionend = 
35                 position;
36         vwindow->gui->slider->update(position);
37         vwindow->gui->clock->update(position);
39 // This is going to boost the latency but we need to update the timebar
40         vwindow->gui->timebar->draw_range();
41         vwindow->gui->timebar->flash();
43         vwindow->gui->unlock_window();
45         update_meters((int64_t)(position * mwindow->edl->session->frame_rate));
48 void VTracking::update_meters(int64_t position)
50         double output_levels[MAXCHANNELS];
51         int do_audio = get_playback_engine()->get_output_levels(output_levels, position);
52         if(do_audio)
53         {
54                 vwindow->gui->lock_window();
55                 vwindow->gui->meters->update(output_levels);
56                 vwindow->gui->unlock_window();
57         }
60 void VTracking::stop_meters()
62         vwindow->gui->lock_window();
63         vwindow->gui->meters->stop_meters();
64         vwindow->gui->unlock_window();
67 void VTracking::draw()