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"
25 #include "levelwindow.h"
26 #include "levelwindowgui.h"
28 #include "mainsession.h"
29 #include "meterpanel.h"
31 #include "mwindowgui.h"
32 #include "preferences.h"
35 LevelWindowGUI::LevelWindowGUI(MWindow *mwindow, LevelWindow *thread)
36 : BC_Window(_(PROGRAM_NAME ": Levels"),
37 mwindow->session->lwindow_x,
38 mwindow->session->lwindow_y,
39 mwindow->session->lwindow_w,
40 mwindow->session->lwindow_h,
47 this->thread = thread;
48 this->mwindow = mwindow;
51 LevelWindowGUI::~LevelWindowGUI()
56 void LevelWindowGUI::create_objects()
58 int border = mwindow->theme->widget_border;
59 lock_window("LevelWindowGUI::create_objects");
60 mwindow->theme->draw_lwindow_bg(this);
61 panel = new MeterPanel(mwindow,
67 mwindow->edl->session->audio_channels,
71 panel->create_objects();
76 int LevelWindowGUI::resize_event(int w, int h)
78 int border = mwindow->theme->widget_border;
79 mwindow->session->lwindow_x = get_x();
80 mwindow->session->lwindow_y = get_y();
81 mwindow->session->lwindow_w = w;
82 mwindow->session->lwindow_h = h;
84 mwindow->theme->draw_lwindow_bg(this);
86 panel->reposition_window(panel->x,
91 BC_WindowBase::resize_event(w, h);
95 int LevelWindowGUI::translation_event()
97 mwindow->session->lwindow_x = get_x();
98 mwindow->session->lwindow_y = get_y();
102 int LevelWindowGUI::close_event()
105 mwindow->session->show_lwindow = 0;
106 mwindow->gui->lock_window();
107 mwindow->gui->mainmenu->show_lwindow->set_checked(0);
108 mwindow->gui->unlock_window();
109 mwindow->save_defaults();
113 int LevelWindowGUI::keypress_event()
115 if(get_keypress() == 'w' || get_keypress() == 'W')
124 int LevelWindowGUI::reset_over()