4 #include "edlsession.h"
5 #include "localsession.h"
7 #include "meterpanel.h"
9 #include "renderengine.h"
10 #include "mainclock.h"
11 #include "vplayback.h"
14 #include "vtracking.h"
16 #include "vwindowgui.h"
19 VTracking::VTracking(MWindow *mwindow, VWindow *vwindow)
22 this->vwindow = vwindow;
25 VTracking::~VTracking()
29 PlaybackEngine* VTracking::get_playback_engine()
31 return vwindow->playback_engine;
34 void VTracking::update_tracker(double position)
36 Asset *asset = vwindow->get_edl()->assets->first;
37 //printf("VTracking::update_tracker %ld\n", position);
38 vwindow->gui->lock_window("VTracking::update_tracker");
39 vwindow->get_edl()->local_session->set_selectionstart(position);
40 vwindow->get_edl()->local_session->set_selectionend(position);
41 vwindow->gui->slider->update(position);
43 vwindow->gui->clock->update(position +
44 asset->tcstart / (asset->video_data ?
48 // This is going to boost the latency but we need to update the timebar
49 vwindow->gui->timebar->draw_range();
50 vwindow->gui->timebar->flash();
52 vwindow->gui->unlock_window();
54 update_meters((int64_t)(position * mwindow->edl->session->sample_rate));
57 void VTracking::update_meters(int64_t position)
59 double output_levels[MAXCHANNELS];
61 int do_audio = get_playback_engine()->get_output_levels(output_levels,
65 vwindow->gui->lock_window("VTracking::update_meters");
66 vwindow->gui->meters->update(output_levels);
67 vwindow->gui->unlock_window();
71 void VTracking::stop_meters()
73 vwindow->gui->lock_window("VTracking::stop_meters");
74 vwindow->gui->meters->stop_meters();
75 vwindow->gui->unlock_window();
78 void VTracking::draw()