4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
23 #include "audiodevice.h"
24 #include "cplayback.h"
25 #include "ctracking.h"
27 #include "cwindowgui.h"
29 #include "edlsession.h"
31 #include "mwindowgui.h"
32 #include "playtransport.h"
33 #include "renderengine.h"
34 #include "trackcanvas.h"
35 #include "transportque.h"
37 // Playback engine for composite window
39 CPlayback::CPlayback(MWindow *mwindow, CWindow *cwindow, Canvas *output)
40 : PlaybackEngine(mwindow, output)
42 this->cwindow = cwindow;
45 int CPlayback::create_render_engine()
47 return PlaybackEngine::create_render_engine();
50 void CPlayback::init_cursor(int active)
52 mwindow->gui->lock_window("CPlayback::init_cursor");
53 mwindow->gui->deactivate_timeline();
54 mwindow->gui->unlock_window();
55 cwindow->playback_cursor->start_playback(tracking_position, active);
58 void CPlayback::init_meters()
60 AudioDevice *audio = render_engine->audio;
61 int dmix = audio && (audio->get_idmix() || audio->get_odmix());
62 cwindow->gui->meters->init_meters(dmix);
65 void CPlayback::stop_cursor()
67 cwindow->playback_cursor->stop_playback();
71 int CPlayback::brender_available(long position)
73 return mwindow->brender_available(position);