{
this->mwindow = mwindow;
this->data_type = data_type;
+ this->number = -1;
}
TransitionDialogThread::~TransitionDialogThread()
{
if(!transition_names.total)
{
+ strcpy(transition_title, data_type == TRACK_AUDIO ?
+ mwindow->edl->session->default_atransition :
+ mwindow->edl->session->default_vtransition);
+
// Construct listbox names
ArrayList<PluginServer*> plugindb;
mwindow->search_plugindb(data_type == TRACK_AUDIO,
- data_type == TRACK_VIDEO,
- 0,
- 1,
- 0,
- plugindb);
- for(int i = 0; i < plugindb.total; i++)
- transition_names.append(new BC_ListBoxItem(_(plugindb.values[i]->title)));
+ data_type == TRACK_VIDEO, 0, 1, 0, plugindb);
+ for(int i = 0; i < plugindb.total; i++) {
+ const char *title = _(plugindb.values[i]->title);
+ if( !strcmp(transition_title, title) ) number = i;
+ transition_names.append(new BC_ListBoxItem(title));
+ }
}
- if(data_type == TRACK_AUDIO)
- strcpy(transition_title, mwindow->edl->session->default_atransition);
- else
- strcpy(transition_title, mwindow->edl->session->default_vtransition);
-
mwindow->gui->unlock_window();
BC_DialogThread::start();
mwindow->gui->lock_window("TransitionDialogThread::start");
mwindow->session->transitiondialog_w / 2;
int y = mwindow->gui->get_abs_cursor_y(0) -
mwindow->session->transitiondialog_h / 2;
- TransitionDialog *window = new TransitionDialog(mwindow,
- this,
- x,
- y);
+ TransitionDialog *window = new TransitionDialog(mwindow, this, x, y);
window->create_objects();
mwindow->gui->unlock_window();
return window;
TransitionDialog::TransitionDialog(MWindow *mwindow,
- TransitionDialogThread *thread,
- int x,
- int y)
- : BC_Window(_("Attach Transition"),
- x,
- y,
+ TransitionDialogThread *thread, int x, int y)
+ : BC_Window(_("Attach Transition"), x, y,
mwindow->session->transitiondialog_w,
mwindow->session->transitiondialog_h,
- 320,
- 240,
- 1,
- 0,
- 1)
+ 320, 240, 1, 0, 1)
{
this->mwindow = mwindow;
this->thread = thread;
y,
get_w() - x - x,
get_h() - y - BC_OKButton::calculate_h() - 10));
+ if( thread->number >= 0 ) {
+ name_list->update_selection(&thread->transition_names, thread->number, 0);
+ name_list->draw_items(0);
+ }
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
- flush();
unlock_window();
}
TransitionDialogName::TransitionDialogName(TransitionDialogThread *thread,
- ArrayList<BC_ListBoxItem*> *standalone_data,
- int x,
- int y,
- int w,
- int h)
+ ArrayList<BC_ListBoxItem*> *standalone_data, int x, int y, int w, int h)
: BC_ListBox(x,
y,
w,
int TransitionDialogName::selection_changed()
{
- int number = get_selection_number(0, 0);
+ thread->number = get_selection_number(0, 0);
strcpy(thread->transition_title,
- thread->transition_names.values[number]->get_text());
+ thread->transition_names.values[thread->number]->get_text());
return 1;
}
#include "bcdisplayinfo.h"
#include "bchash.h"
+#include "cstrdup.h"
#include "edl.inc"
#include "filesystem.h"
#include "filexml.h"
preserve_aspect = 0;
last_preserve_aspect = 0;
shapes_initialized = 0;
+ shape_paths.set_array_delete();
+ shape_titles.set_array_delete();
}
ShapeWipeMain::~ShapeWipeMain()
FileItem *file_item = fs.get_entry(i);
if(!file_item->get_is_dir())
{
- shape_paths.append(strdup(file_item->get_path()));
- char *ptr = strdup(file_item->get_name());
+ shape_paths.append(cstrdup(file_item->get_path()));
+ char *ptr = cstrdup(file_item->get_name());
char *ptr2 = strrchr(ptr, '.');
if(ptr2) *ptr2 = 0;
shape_titles.append(ptr);
type *in_row; \
type *out_row; \
\
- for(j = 0; j < h; j++) \
- { \
- in_row = (type*) in_rows[j]; \
- out_row = (type*)out_rows[j]; \
- pattern_row = pattern_image[j]; \
- \
- col_offset = 0; \
- for(k = 0; k < w; k++) \
- { \
- value = pattern_row[k]; \
- if ((direction == 0 && value >= threshold) || \
- (direction == 1 && value <= threshold)) \
- { \
+ if( !direction ) { \
+ for(j = 0; j < h; j++) { \
+ in_row = (type*) in_rows[j]; \
+ out_row = (type*)out_rows[j]; \
+ pattern_row = pattern_image[j]; \
+ \
+ col_offset = 0; \
+ for(k = 0; k < w; k++, col_offset += components ) { \
+ value = pattern_row[k]; \
+ if (value < threshold) continue; \
+ out_row[col_offset] = in_row[col_offset]; \
+ out_row[col_offset + 1] = in_row[col_offset + 1]; \
+ out_row[col_offset + 2] = in_row[col_offset + 2]; \
+ if(components == 4) \
+ out_row[col_offset + 3] = in_row[col_offset + 3]; \
+ } \
+ } \
+ } \
+ else { \
+ for(j = 0; j < h; j++) { \
+ in_row = (type*) in_rows[j]; \
+ out_row = (type*)out_rows[j]; \
+ pattern_row = pattern_image[j]; \
+ \
+ col_offset = 0; \
+ for(k = 0; k < w; k++, col_offset += components ) { \
+ value = pattern_row[k]; \
+ if (value > threshold) continue; \
out_row[col_offset] = in_row[col_offset]; \
out_row[col_offset + 1] = in_row[col_offset + 1]; \
out_row[col_offset + 2] = in_row[col_offset + 2]; \
if(components == 4) \
out_row[col_offset + 3] = in_row[col_offset + 3]; \
} \
- col_offset += components; \
} \
} \
}