00001 #include "cplayback.h"
00002 #include "cwindow.h"
00003 #include "editpanel.h"
00004 #include "edl.h"
00005 #include "edlsession.h"
00006 #include "filexml.h"
00007 #include "keys.h"
00008 #include "localsession.h"
00009 #include "mbuttons.h"
00010 #include "mainundo.h"
00011 #include "mwindow.h"
00012 #include "mwindowgui.h"
00013 #include "playbackengine.h"
00014 #include "playtransport.h"
00015 #include "preferences.h"
00016 #include "record.h"
00017 #include "mainsession.h"
00018 #include "theme.h"
00019 #include "tracks.h"
00020
00021 MButtons::MButtons(MWindow *mwindow, MWindowGUI *gui)
00022 : BC_SubWindow(mwindow->theme->mbuttons_x,
00023 mwindow->theme->mbuttons_y,
00024 mwindow->theme->mbuttons_w,
00025 mwindow->theme->mbuttons_h)
00026 {
00027 this->gui = gui;
00028 this->mwindow = mwindow;
00029 }
00030
00031 MButtons::~MButtons()
00032 {
00033 delete transport;
00034 delete edit_panel;
00035 }
00036
00037 int MButtons::create_objects()
00038 {
00039 int x = 3, y = 0;
00040 BC_SubWindow *button;
00041
00042 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
00043 transport = new MainTransport(mwindow, this, x, y);
00044 transport->create_objects();
00045 transport->set_engine(mwindow->cwindow->playback_engine);
00046 x += transport->get_w();
00047 x += mwindow->theme->mtransport_margin;
00048
00049 edit_panel = new MainEditing(mwindow, this, x, y);
00050
00051 edit_panel->create_objects();
00052
00053 x += edit_panel->get_w();
00054 flash();
00055 return 0;
00056 }
00057
00058 int MButtons::resize_event()
00059 {
00060 reposition_window(mwindow->theme->mbuttons_x,
00061 mwindow->theme->mbuttons_y,
00062 mwindow->theme->mbuttons_w,
00063 mwindow->theme->mbuttons_h);
00064 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
00065 flash();
00066 }
00067
00068 int MButtons::keypress_event()
00069 {
00070 int result = 0;
00071
00072 if(!result)
00073 {
00074 result = transport->keypress_event();
00075 }
00076
00077 return result;
00078 }
00079
00080 void MButtons::update()
00081 {
00082 edit_panel->update();
00083 }
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 MainTransport::MainTransport(MWindow *mwindow, MButtons *mbuttons, int x, int y)
00101 : PlayTransport(mwindow, mbuttons, x, y)
00102 {
00103 }
00104
00105 void MainTransport::goto_start()
00106 {
00107 mwindow->gui->unlock_window();
00108 handle_transport(REWIND, 1);
00109 mwindow->gui->lock_window();
00110 mwindow->goto_start();
00111 }
00112
00113
00114 void MainTransport::goto_end()
00115 {
00116 mwindow->gui->unlock_window();
00117 handle_transport(GOTO_END, 1);
00118 mwindow->gui->lock_window();
00119 mwindow->goto_end();
00120 }
00121
00122 MainEditing::MainEditing(MWindow *mwindow, MButtons *mbuttons, int x, int y)
00123 : EditPanel(mwindow,
00124 mbuttons,
00125 x,
00126 y,
00127 mwindow->edl->session->editing_mode,
00128 1,
00129 1,
00130 0,
00131 0,
00132 1,
00133 1,
00134 1,
00135 1,
00136 1,
00137 1,
00138 1,
00139 1,
00140 0,
00141 1,
00142 1)
00143 {
00144 this->mwindow = mwindow;
00145 this->mbuttons = mbuttons;
00146 }
00147
00148
00149
00150
00151
00152
00153