1 #include "featheredits.h"
4 #include "mwindowgui.h"
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
13 FeatherEdits::FeatherEdits(MWindow *mwindow, int audio, int video)
14 : BC_MenuItem("Feather Edits..."), Thread()
16 this->mwindow = mwindow;
21 int FeatherEdits::handle_event()
28 void FeatherEdits::run()
34 feather_samples = mwindow->get_feather(audio, video);
36 FeatherEditsWindow window(mwindow, feather_samples);
38 window.create_objects(audio, video);
39 result = window.run_window();
40 feather_samples = window.feather_samples;
45 mwindow->gui->lock_window();
46 // mwindow->undo->update_undo_edits(_("Feather"), 0);
48 mwindow->feather_edits(feather_samples, audio, video);
50 // mwindow->undo->update_undo_edits();
51 mwindow->gui->unlock_window();
56 FeatherEditsWindow::FeatherEditsWindow(MWindow *mwindow, long feather_samples)
57 : BC_Window(PROGRAM_NAME ": Feather Edits",
58 mwindow->gui->get_abs_cursor_x(),
59 mwindow->gui->get_abs_cursor_y(),
63 this->feather_samples = feather_samples;
66 FeatherEditsWindow::~FeatherEditsWindow()
71 int FeatherEditsWindow::create_objects(int audio, int video)
79 add_subwindow(new BC_Title(x, y, _("Feather by how many samples:")));
81 add_subwindow(new BC_Title(x, y, _("Feather by how many frames:")));
85 sprintf(string, "%d", feather_samples);
86 add_subwindow(text = new FeatherEditsTextBox(this, string, x, y));
89 add_subwindow(new BC_OKButton(x, y));
90 add_subwindow(new BC_CancelButton(x, y));
94 FeatherEditsTextBox::FeatherEditsTextBox(FeatherEditsWindow *window, char *text, int x, int y)
95 : BC_TextBox(x, y, 100, 1, text)
97 this->window = window;
100 int FeatherEditsTextBox::handle_event()
102 window->feather_samples = atol(get_text());