Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vtracking.C

Go to the documentation of this file.
00001 #include "asset.h"
00002 #include "assets.h"
00003 #include "edl.h"
00004 #include "edlsession.h"
00005 #include "localsession.h"
00006 #include "mainclock.h"
00007 #include "meterpanel.h"
00008 #include "mwindow.h"
00009 #include "renderengine.h"
00010 #include "mainclock.h"
00011 #include "vplayback.h"
00012 #include "vrender.h"
00013 #include "vtimebar.h"
00014 #include "vtracking.h"
00015 #include "vwindow.h"
00016 #include "vwindowgui.h"
00017 
00018 
00019 VTracking::VTracking(MWindow *mwindow, VWindow *vwindow)
00020  : Tracking(mwindow)
00021 {
00022         this->vwindow = vwindow;
00023 }
00024 
00025 VTracking::~VTracking()
00026 {
00027 }
00028 
00029 PlaybackEngine* VTracking::get_playback_engine()
00030 {
00031         return vwindow->playback_engine;
00032 }
00033 
00034 void VTracking::update_tracker(double position)
00035 {
00036         Asset *asset = vwindow->get_edl()->assets->first;
00037 //printf("VTracking::update_tracker %ld\n", position);
00038         vwindow->gui->lock_window("VTracking::update_tracker");
00039         vwindow->get_edl()->local_session->set_selectionstart(position);
00040         vwindow->get_edl()->local_session->set_selectionend(position);
00041         vwindow->gui->slider->update(position);
00042 
00043         vwindow->gui->clock->update(position + 
00044                 asset->tcstart / (asset->video_data ?
00045                                                         asset->frame_rate :
00046                                                         asset->sample_rate));
00047 
00048 // This is going to boost the latency but we need to update the timebar
00049         vwindow->gui->timebar->draw_range();
00050         vwindow->gui->timebar->flash();
00051 
00052         vwindow->gui->unlock_window();
00053 
00054         update_meters((int64_t)(position * mwindow->edl->session->sample_rate));
00055 }
00056 
00057 void VTracking::update_meters(int64_t position)
00058 {
00059         double output_levels[MAXCHANNELS];
00060 
00061         int do_audio = get_playback_engine()->get_output_levels(output_levels, 
00062                 position);
00063         if(do_audio)
00064         {
00065                 vwindow->gui->lock_window("VTracking::update_meters");
00066                 vwindow->gui->meters->update(output_levels);
00067                 vwindow->gui->unlock_window();
00068         }
00069 }
00070 
00071 void VTracking::stop_meters()
00072 {
00073         vwindow->gui->lock_window("VTracking::stop_meters");
00074         vwindow->gui->meters->stop_meters();
00075         vwindow->gui->unlock_window();
00076 }
00077 
00078 void VTracking::draw()
00079 {
00080 }

Generated on Sun Jan 8 13:39:02 2006 for Cinelerra-svn by  doxygen 1.4.4