Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

featheredits.C

Go to the documentation of this file.
00001 #include "featheredits.h"
00002 #include "mainundo.h"
00003 #include "mwindow.h"
00004 #include "mwindowgui.h"
00005 
00006 #include <libintl.h>
00007 #define _(String) gettext(String)
00008 #define gettext_noop(String) String
00009 #define N_(String) gettext_noop (String)
00010 
00011 
00012 
00013 FeatherEdits::FeatherEdits(MWindow *mwindow, int audio, int video)
00014  : BC_MenuItem("Feather Edits..."), Thread()
00015 { 
00016         this->mwindow = mwindow; 
00017         this->audio = audio; 
00018         this->video = video; 
00019 }
00020 
00021 int FeatherEdits::handle_event()
00022 {
00023         set_synchronous(0);
00024         Thread::start();
00025 }
00026 
00027 
00028 void FeatherEdits::run()
00029 {
00030         int result;
00031         long feather_samples;
00032 
00033         {
00034                 feather_samples = mwindow->get_feather(audio, video);
00035 
00036                 FeatherEditsWindow window(mwindow, feather_samples);
00037 
00038                 window.create_objects(audio, video);
00039                 result = window.run_window();
00040                 feather_samples = window.feather_samples;
00041         }
00042 
00043         if(!result)
00044         {
00045                 mwindow->gui->lock_window();
00046 //              mwindow->undo->update_undo_edits(_("Feather"), 0);
00047                 
00048                 mwindow->feather_edits(feather_samples, audio, video);
00049 
00050 //              mwindow->undo->update_undo_edits();
00051                 mwindow->gui->unlock_window();
00052         }
00053 }
00054 
00055 
00056 FeatherEditsWindow::FeatherEditsWindow(MWindow *mwindow, long feather_samples)
00057  : BC_Window(PROGRAM_NAME ": Feather Edits", 
00058         mwindow->gui->get_abs_cursor_x(), 
00059         mwindow->gui->get_abs_cursor_y(), 
00060         340, 
00061         140)
00062 {
00063         this->feather_samples = feather_samples;
00064 }
00065 
00066 FeatherEditsWindow::~FeatherEditsWindow()
00067 {
00068         delete text;
00069 }
00070 
00071 int FeatherEditsWindow::create_objects(int audio, int video)
00072 {
00073         int x = 10;
00074         int y = 10;
00075         this->audio = audio;
00076         this->video = video;
00077 
00078         if(audio)
00079                 add_subwindow(new BC_Title(x, y, _("Feather by how many samples:")));
00080         else
00081                 add_subwindow(new BC_Title(x, y, _("Feather by how many frames:")));
00082 
00083         y += 20;
00084         char string[1024];
00085         sprintf(string, "%d", feather_samples);
00086         add_subwindow(text = new FeatherEditsTextBox(this, string, x, y));
00087 
00088         y += 20;
00089         add_subwindow(new BC_OKButton(x, y));
00090         add_subwindow(new BC_CancelButton(x, y));
00091         return 0;
00092 }
00093 
00094 FeatherEditsTextBox::FeatherEditsTextBox(FeatherEditsWindow *window, char *text, int x, int y)
00095  : BC_TextBox(x, y, 100, 1, text)
00096 {
00097         this->window = window;
00098 }
00099 
00100 int FeatherEditsTextBox::handle_event()
00101 {
00102         window->feather_samples = atol(get_text());
00103         return 0;
00104 }

Generated on Sun Jan 8 13:38:54 2006 for Cinelerra-svn by  doxygen 1.4.4