r999: maintainers added to README_en.
[cinelerra_cv/mob.git] / cinelerra / levelwindowgui.C
blobac83e40750a01371ef2befa3fcf5981b36b6c53e
1 #include "edl.h"
2 #include "edlsession.h"
3 #include "levelwindow.h"
4 #include "levelwindowgui.h"
5 #include "mainmenu.h"
6 #include "mainsession.h"
7 #include "meterpanel.h"
8 #include "mwindow.h"
9 #include "mwindowgui.h"
10 #include "preferences.h"
11 #include "theme.h"
13 LevelWindowGUI::LevelWindowGUI(MWindow *mwindow, LevelWindow *thread)
14  : BC_Window(PROGRAM_NAME ": Levels", 
15         mwindow->session->lwindow_x, 
16         mwindow->session->lwindow_y, 
17         mwindow->session->lwindow_w, 
18         mwindow->session->lwindow_h, 
19         10,
20         10,
21         1,
22         0, 
23         1)
25         this->thread = thread;
26         this->mwindow = mwindow;
29 LevelWindowGUI::~LevelWindowGUI()
31         delete panel;
34 int LevelWindowGUI::create_objects()
36         mwindow->theme->draw_lwindow_bg(this);
37         panel = new MeterPanel(mwindow, 
38                 this, 
39                 5, 
40                 5,
41                 get_h() - 10,
42                 mwindow->edl->session->audio_channels,
43                 1);
44         panel->create_objects();
45         return 0;
49 int LevelWindowGUI::resize_event(int w, int h)
51         mwindow->session->lwindow_x = get_x();
52         mwindow->session->lwindow_y = get_y();
53         mwindow->session->lwindow_w = w;
54         mwindow->session->lwindow_h = h;
56         mwindow->theme->draw_lwindow_bg(this);
58         panel->reposition_window(panel->x,
59                 panel->y,
60                 h - 10);
62         BC_WindowBase::resize_event(w, h);
63         return 1;
66 int LevelWindowGUI::translation_event()
68         mwindow->session->lwindow_x = get_x();
69         mwindow->session->lwindow_y = get_y();
70         return 0;
73 int LevelWindowGUI::close_event()
75         hide_window();
76         mwindow->session->show_lwindow = 0;
77         mwindow->gui->lock_window();
78         mwindow->gui->mainmenu->show_lwindow->set_checked(0);
79         mwindow->gui->unlock_window();
80         mwindow->save_defaults();
81         return 1;
84 int LevelWindowGUI::keypress_event()
86         if(get_keypress() == 'w' || get_keypress() == 'W')
87         {
88                 close_event();
89                 return 1;
90         }
91         return 0;
95 int LevelWindowGUI::reset_over()
97         return 0;