4 * Copyright (C) 1997-2011 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 "edlsession.h"
26 #include "levelwindow.h"
27 #include "levelwindowgui.h"
29 #include "mainsession.h"
30 #include "meterpanel.h"
32 #include "mwindowgui.h"
33 #include "preferences.h"
36 LevelWindowGUI::LevelWindowGUI(MWindow *mwindow, LevelWindow *thread)
37 : BC_Window(_(PROGRAM_NAME ": Levels"),
38 mwindow->session->lwindow_x, mwindow->session->lwindow_y,
39 mwindow->session->lwindow_w, mwindow->session->lwindow_h,
40 xS(10), yS(10), 1, 0, 1)
42 this->thread = thread;
43 this->mwindow = mwindow;
46 LevelWindowGUI::~LevelWindowGUI()
51 void LevelWindowGUI::create_objects()
53 int border = mwindow->theme->widget_border;
54 lock_window("LevelWindowGUI::create_objects");
55 mwindow->theme->draw_lwindow_bg(this);
56 panel = new MeterPanel(mwindow,
62 mwindow->edl->session->audio_channels,
66 panel->create_objects();
71 int LevelWindowGUI::resize_event(int w, int h)
73 int border = mwindow->theme->widget_border;
74 mwindow->session->lwindow_x = get_x();
75 mwindow->session->lwindow_y = get_y();
76 mwindow->session->lwindow_w = w;
77 mwindow->session->lwindow_h = h;
79 mwindow->theme->draw_lwindow_bg(this);
81 panel->reposition_window(panel->x,
86 BC_WindowBase::resize_event(w, h);
90 int LevelWindowGUI::translation_event()
92 mwindow->session->lwindow_x = get_x();
93 mwindow->session->lwindow_y = get_y();
97 int LevelWindowGUI::close_event()
100 mwindow->session->show_lwindow = 0;
101 mwindow->gui->lock_window();
102 mwindow->gui->mainmenu->show_lwindow->set_checked(0);
103 mwindow->gui->unlock_window();
104 mwindow->save_defaults();
108 int LevelWindowGUI::keypress_event()
110 switch( get_keypress() ) {
119 if( ctrl_down() && shift_down() ) {
120 resend_event(mwindow->gui);
127 int LevelWindowGUI::reset_over()