/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "asset.h"
void ResizeVTrackThread::start_window(int w, int h, int w1, int h1)
{
+ if( window && running() ) {
+ window->lock_window();
+ window->raise_window();
+ window->unlock_window();
+ return;
+ }
this->w = w; this->h = h;
this->w1 = w1; this->h1 = h1;
w_scale = h_scale = 1;
void ResizeVTrackThread::run()
{
- ResizeVTrackWindow *window = this->window =
- new ResizeVTrackWindow(mwindow,
- this,
+ window = new ResizeVTrackWindow(mwindow, this,
mwindow->gui->get_abs_cursor_x(1),
mwindow->gui->get_abs_cursor_y(1));
window->create_objects();
int result = window->run_window();
- this->window = 0;
- delete window;
-
- if(!result)
- {
+ delete window; window = 0;
+ if(!result) {
update();
}
- if(((w % 4) ||
- (h % 4)) &&
+ if(((w % 4) || (h % 4)) &&
mwindow->edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL)
{
MainError::show_error(
-ResizeVTrackWindow::ResizeVTrackWindow(MWindow *mwindow,
+ResizeVTrackWindow::ResizeVTrackWindow(MWindow *mwindow,
ResizeVTrackThread *thread,
int x,
int y)
- : BC_Window(_(PROGRAM_NAME ": Resize Track"),
+ : BC_Window(_(PROGRAM_NAME ": Resize Track"),
x - 320 / 2, y - get_resources()->ok_images[0]->get_h() + 100 / 2,
400, get_resources()->ok_images[0]->get_h() + 100,
400, get_resources()->ok_images[0]->get_h() + 100,
void ResizeVTrackWindow::create_objects()
{
- int x = 10, y = 10;
-
lock_window("ResizeVTrackWindow::create_objects");
+ int x = 10, y = 10;
BC_Title *size_title = new BC_Title(x, y, _("Size:"));
add_subwindow(size_title);
int x1 = x + size_title->get_w();
unlock_window();
}
-void ResizeVTrackWindow::update(int changed_scale,
- int changed_size,
+void ResizeVTrackWindow::update(int changed_scale,
+ int changed_size,
int changed_all)
{
//printf("ResizeVTrackWindow::update %d %d %d\n", changed_scale, changed_size, changed_all);
-ResizeVTrackSwap::ResizeVTrackSwap(ResizeVTrackWindow *gui,
- ResizeVTrackThread *thread,
- int x,
+ResizeVTrackSwap::ResizeVTrackSwap(ResizeVTrackWindow *gui,
+ ResizeVTrackThread *thread,
+ int x,
int y)
: BC_Button(x, y, thread->mwindow->theme->get_image_set("swap_extents"))
{
-ResizeVTrackWidth::ResizeVTrackWidth(ResizeVTrackWindow *gui,
+ResizeVTrackWidth::ResizeVTrackWidth(ResizeVTrackWindow *gui,
ResizeVTrackThread *thread,
int x,
int y)
return 1;
}
-ResizeVTrackHeight::ResizeVTrackHeight(ResizeVTrackWindow *gui,
+ResizeVTrackHeight::ResizeVTrackHeight(ResizeVTrackWindow *gui,
ResizeVTrackThread *thread,
int x,
int y)
}
-ResizeVTrackScaleW::ResizeVTrackScaleW(ResizeVTrackWindow *gui,
+ResizeVTrackScaleW::ResizeVTrackScaleW(ResizeVTrackWindow *gui,
ResizeVTrackThread *thread,
int x,
int y)
return 1;
}
-ResizeVTrackScaleH::ResizeVTrackScaleH(ResizeVTrackWindow *gui,
+ResizeVTrackScaleH::ResizeVTrackScaleH(ResizeVTrackWindow *gui,
ResizeVTrackThread *thread,
int x,
int y)
void ResizeTrackThread::update()
{
- mwindow->resize_track(track, w, h);
+ if( mwindow->edl->tracks->track_exists(track) )
+ mwindow->resize_track(track, w, h);
}
{
resize_asset_thread = 0;
this->fwindow = fwindow;
- set_underline(0);
}
ResizeAssetButton::~ResizeAssetButton()
int ResizeAssetButton::handle_event()
{
- resize_asset_thread = new ResizeAssetThread(fwindow);
+ if( !resize_asset_thread )
+ resize_asset_thread = new ResizeAssetThread(fwindow);
resize_asset_thread->start_window(fwindow->asset_edit->changed_params);
return 1;
}