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
22 #include "bcsignals.h"
23 #include "cplayback.h"
25 #include "editpanel.h"
27 #include "edlsession.h"
30 #include "localsession.h"
34 #include "mwindowgui.h"
35 #include "playbackengine.h"
36 #include "playtransport.h"
37 #include "preferences.h"
39 #include "mainsession.h"
43 MButtons::MButtons(MWindow *mwindow, MWindowGUI *gui)
44 : BC_SubWindow(mwindow->theme->mbuttons_x,
45 mwindow->theme->mbuttons_y,
46 mwindow->theme->mbuttons_w,
47 mwindow->theme->mbuttons_h)
50 this->mwindow = mwindow;
59 void MButtons::create_objects()
62 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
63 transport = new MainTransport(mwindow, this, x, y);
64 transport->create_objects();
65 transport->set_engine(mwindow->cwindow->playback_engine);
66 x += transport->get_w();
67 x += mwindow->theme->mtransport_margin;
69 edit_panel = new MainEditing(mwindow, this, x, y);
71 edit_panel->create_objects();
73 x += edit_panel->get_w();
77 int MButtons::resize_event()
79 reposition_window(mwindow->theme->mbuttons_x,
80 mwindow->theme->mbuttons_y,
81 mwindow->theme->mbuttons_w,
82 mwindow->theme->mbuttons_h);
83 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
88 int MButtons::keypress_event()
94 result = transport->keypress_event();
100 void MButtons::update()
102 edit_panel->update();
120 MainTransport::MainTransport(MWindow *mwindow, MButtons *mbuttons, int x, int y)
121 : PlayTransport(mwindow, mbuttons, x, y)
125 void MainTransport::goto_start()
127 mwindow->gui->unlock_window();
128 handle_transport(REWIND, 1);
129 mwindow->gui->lock_window();
130 mwindow->goto_start();
134 void MainTransport::goto_end()
136 mwindow->gui->unlock_window();
137 handle_transport(GOTO_END, 1);
138 mwindow->gui->lock_window();
142 MainEditing::MainEditing(MWindow *mwindow, MButtons *mbuttons, int x, int y)
147 mwindow->edl->session->editing_mode,
163 mwindow->has_commercials())
165 this->mwindow = mwindow;
166 this->mbuttons = mbuttons;