X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fchanneledit.C;h=9a81984e5d907a981f89d0b2058a472f9fe94963;hb=c279e21fc2394a7908bbd1ba8c79b116fe9fb14a;hp=6c49c075bb9573288f92c719dbafb2720b06a5ac;hpb=0b78779e9e75131eee81d2e4689b98df0e91c092;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/channeledit.C b/cinelerra-5.1/cinelerra/channeledit.C index 6c49c075..9a81984e 100644 --- a/cinelerra-5.1/cinelerra/channeledit.C +++ b/cinelerra-5.1/cinelerra/channeledit.C @@ -39,6 +39,8 @@ #include #include +#define MSG_NO_PIC_CONTROLS _("Device has no picture controls.") +//#define MSG_NO_INP_SELECTION _("Device has no input selection.") ChannelEditThread::ChannelEditThread(ChannelPicker *channel_picker, ChannelDB *channeldb) @@ -163,7 +165,7 @@ ChannelEditWindow::ChannelEditWindow(ChannelEditThread *thread, : BC_Window(_(PROGRAM_NAME ": Channels"), channel_picker->mwindow->session->channels_x, channel_picker->mwindow->session->channels_y, - 350, 400, 350, 400, 0, 0, 1) + 375, 400, 375, 400, 0, 0, 1) { this->thread = thread; this->channel_picker = channel_picker; @@ -184,6 +186,7 @@ ChannelEditWindow::~ChannelEditWindow() void ChannelEditWindow::create_objects() { + lock_window("ChannelEditWindow::create_objects"); int x = 10, y = 10; // Create channel list @@ -229,6 +232,7 @@ void ChannelEditWindow::create_objects() edit_thread = new ChannelEditEditThread(this, channel_picker); picture_thread = new ChannelEditPictureThread(channel_picker); show_window(); + unlock_window(); } int ChannelEditWindow::close_event() @@ -625,36 +629,19 @@ int ChannelEditPicture::handle_event() } - - - - - - - - - - -// ========================= confirm overwrite by channel scannin - +// ========================= confirm overwrite by channel scanning ConfirmScan::ConfirmScan(ChannelEditWindow *gui, int x, int y) : BC_Window(_(PROGRAM_NAME ": Scan confirm"), - x, - y, - 350, - BC_OKButton::calculate_h() + 130, - 0, - 0, - 0, - 0, - 1) + x, y, 350, BC_OKButton::calculate_h() + 130, + 0, 0, 0, 0, 1) { this->gui = gui; } void ConfirmScan::create_objects() { + lock_window("ConfirmScan::create_objects"); int x = 10, y = 10; int y2 = 0, x2 = 0; BC_Title *title; @@ -702,14 +689,9 @@ void ConfirmScan::create_objects() add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); show_window(); + unlock_window(); } - - - - - - ConfirmScanThread::ConfirmScanThread(ChannelEditWindow *gui) : BC_DialogThread() { @@ -994,13 +976,7 @@ ChannelEditEditWindow::ChannelEditEditWindow(ChannelEditEditThread *thread, : BC_Window(_(PROGRAM_NAME ": Edit Channel"), channel_picker->parent_window->get_abs_cursor_x(1), channel_picker->parent_window->get_abs_cursor_y(1), - 390, - 300, - 390, - 300, - 0, - 0, - 1) + 390, 300, 390, 300, 0, 0, 1) { this->channel_picker = channel_picker; this->window = window; @@ -1009,8 +985,10 @@ ChannelEditEditWindow::ChannelEditEditWindow(ChannelEditEditThread *thread, ChannelEditEditWindow::~ChannelEditEditWindow() { } + void ChannelEditEditWindow::create_objects(Channel *channel) { + lock_window("ChannelEditEditWindow::create_objects"); this->new_channel = channel; Channel *channel_usage = channel_picker->get_channel_usage(); title_text = 0; @@ -1022,7 +1000,7 @@ void ChannelEditEditWindow::create_objects(Channel *channel) // !channel_usage->use_norm && // !channel_usage->use_input)) // { -// add_subwindow(new BC_Title(x, y, "Device has no input selection.")); +// add_subwindow(new BC_Title(x, y, MSG_NO_INP_SELECTION)); // y += 30; // } // else @@ -1086,6 +1064,7 @@ void ChannelEditEditWindow::create_objects(Channel *channel) x += 200; add_subwindow(new BC_CancelButton(this)); show_window(); + unlock_window(); } ChannelEditEditTitle::ChannelEditEditTitle(int x, @@ -1390,10 +1369,8 @@ ChannelEditPictureWindow::ChannelEditPictureWindow(ChannelEditPictureThread *thr : BC_Window(_(PROGRAM_NAME ": Picture"), channel_picker->mwindow->session->picture_x, channel_picker->mwindow->session->picture_y, - calculate_w(channel_picker), - calculate_h(channel_picker), - calculate_w(channel_picker), - calculate_h(channel_picker)) + calculate_w(channel_picker), calculate_h(channel_picker), + calculate_w(channel_picker), calculate_h(channel_picker)) { this->thread = thread; this->channel_picker = channel_picker; @@ -1406,12 +1383,21 @@ int ChannelEditPictureWindow::calculate_h(ChannelPicker *channel_picker) { PictureConfig *picture_usage = channel_picker->get_picture_usage(); int pad = BC_Pot::calculate_h(); - int result = 20 + - channel_picker->parent_window->get_text_height(MEDIUMFONT) + 5 + - BC_OKButton::calculate_h(); + int text_h = channel_picker->parent_window->get_text_height(MEDIUMFONT); + int result = 20 + text_h + 5 + BC_OKButton::calculate_h(); // Only used for Video4Linux 1 - if(picture_usage) + if( !picture_usage || ( + !picture_usage->use_brightness && + !picture_usage->use_contrast && + !picture_usage->use_color && + !picture_usage->use_hue && + !picture_usage->use_whiteness && + !channel_picker->get_controls() ) ) { + result += BC_Title::calculate_h(channel_picker->parent_window, + MSG_NO_PIC_CONTROLS); + } + else { if(picture_usage->use_brightness) result += pad; @@ -1446,8 +1432,7 @@ int ChannelEditPictureWindow::calculate_w(ChannelPicker *channel_picker) !channel_picker->get_controls())) { result = BC_Title::calculate_w(channel_picker->parent_window, - _("Device has no picture controls.")) + - 2 * widget_border; + MSG_NO_PIC_CONTROLS) + 20; } // Only used for Video4Linux 1 @@ -1494,6 +1479,7 @@ int ChannelEditPictureWindow::calculate_w(ChannelPicker *channel_picker) void ChannelEditPictureWindow::create_objects() { + lock_window("ChannelEditPictureWindow::create_objects"); int x = 10, y = 10; int widget_border = ((Theme*)channel_picker->get_theme())->widget_border; int x1 = get_w() - BC_Pot::calculate_w() * 2 - widget_border * 2; @@ -1513,7 +1499,7 @@ void ChannelEditPictureWindow::create_objects() !picture_usage->use_whiteness && !channel_picker->get_controls())) { - add_subwindow(new BC_Title(x, y, "Device has no picture controls.")); + add_subwindow(new BC_Title(x, y, MSG_NO_PIC_CONTROLS)); y += 50; } @@ -1582,6 +1568,7 @@ void ChannelEditPictureWindow::create_objects() y += pad; add_subwindow(new BC_OKButton(this)); show_window(); + unlock_window(); } int ChannelEditPictureWindow::translation_event()