ForkBase::ppid = atoi(av[3]);
}
else {
- int sample_rate = 48000, bfrsz = 4096;
+ int sample_rate = samplerate, bfrsz = block_length;
if( ac > 2 ) sample_rate = atoi(av[2]);
if( init_ui(av[1], sample_rate, bfrsz) ) {
fprintf(stderr," init_ui failed\n");
this->thread = thread;
}
+TransitionSetDefault::TransitionSetDefault(TransitionDialog *window, int x, int y)
+ : BC_GenericButton(x, y, _("Set Default Transition"))
+{
+ this->window = window;
+}
+
+TransitionSetDefault::~TransitionSetDefault()
+{
+}
+
+int TransitionSetDefault::handle_event()
+{
+ TransitionDialogThread *thread = (TransitionDialogThread *)window->thread;
+ const char *transition_title = thread->transition_title;
+ EDL *edl = window->mwindow->edl;
+ switch( thread->data_type ) {
+ case TRACK_AUDIO:
+ strcpy(edl->session->default_atransition, transition_title);
+ break;
+ case TRACK_VIDEO:
+ strcpy(edl->session->default_vtransition, transition_title);
+ break;
+ }
+ window->set_default_text->update(transition_title);
+ return 1;
+}
+
+TransitionDefaultText::TransitionDefaultText(TransitionDialog *window,
+ int x, int y, int w, const char * text)
+ : BC_TextBox(x, y, w, 1, text)
+{
+ this->window = window;
+}
+
+TransitionDefaultText::~TransitionDefaultText()
+{
+}
+
+
void TransitionDialog::create_objects()
{
int x = 10;
x,
y,
get_w() - x - x,
- get_h() - y - BC_OKButton::calculate_h() - 10));
+ get_h() - y - BC_OKButton::calculate_h() - 100));
+ y += name_list->get_h() + 20;
+ add_subwindow(set_default = new TransitionSetDefault(this, x, y));
+ y += set_default->get_h() + 10;
+ const char *default_transition = "";
+ EDL *edl = mwindow->edl;
+ switch( thread->data_type ) {
+ case TRACK_AUDIO:
+ default_transition = edl->session->default_atransition;
+ break;
+ case TRACK_VIDEO:
+ default_transition = edl->session->default_vtransition;
+ break;
+ }
+ add_subwindow(set_default_text = new TransitionDefaultText(this, x, y,
+ get_w()-x-20, default_transition));
if( thread->number >= 0 ) {
name_list->update_selection(&thread->transition_names, thread->number, 0);
name_list->draw_items(0);
name_title->reposition_window(x, y);
y += name_title->get_h() + 5;
- name_list->reposition_window(x,
- y,
- w - x - x,
- h - y - BC_OKButton::calculate_h() - 10);
-
+ name_list->reposition_window(x, y,
+ w - x - x, h - y - BC_OKButton::calculate_h() - 100);
+ y += name_list->get_h() + 20;
+ set_default->reposition_window(x, y);
+ y += set_default->get_h() + 10;
+ set_default_text->reposition_window(x, y, get_w()-x-20);
return 1;
}
};
+class TransitionSetDefault : public BC_GenericButton
+{
+public:
+ TransitionSetDefault(TransitionDialog *window, int x, int y);
+ ~TransitionSetDefault();
+ int handle_event();
+
+ TransitionDialog *window;
+};
+
+class TransitionDefaultText : public BC_TextBox
+{
+public:
+ TransitionDefaultText(TransitionDialog *window,
+ int x, int y, int w, const char *text);
+ ~TransitionDefaultText();
+
+ TransitionDialog *window;
+};
class TransitionDialogThread : public BC_DialogThread
TransitionDialogThread *thread;
TransitionDialogName *name_list;
BC_Title *name_title;
+ TransitionSetDefault *set_default;
+ TransitionDefaultText *set_default_text;
};
class TransitionDialogName : public BC_ListBox
double end = edl->local_session->get_selectionend();
edl->tracks->paste_transitions(start, end, track_type, title);
+ switch( track_type ) {
+ case TRACK_AUDIO:
+ strcpy(edl->session->default_atransition, title);
+ break;
+ case TRACK_VIDEO:
+ strcpy(edl->session->default_vtransition, title);
+ break;
+ }
+
save_backup();
undo->update_undo_after(_("attach transitions"), LOAD_EDITS);
features.append(new Lv2Feature(LV2_BUF_SIZE__boundedBlockLength, 0));
features.append(new Lv2Feature(LV2_WORKER__schedule, &schedule));
- if( sample_rate < 64 ) sample_rate = 44100;
+ if( sample_rate < 64 ) sample_rate = samplerate;
atom_int = uri_table.map(LV2_ATOM__Int);
atom_float = uri_table.map(LV2_ATOM__Float);
int PluginLV2Client::init_lv2()
{
- int bfrsz = 4096;
+ int bfrsz = block_length;
EDL *edl = server->edl;
if( edl ) {
PlaybackConfig *playback_config = edl->session->playback_config;
bfrsz = playback_config->aconfig->fragment_size;
}
int sample_rate = get_project_samplerate();
- if( sample_rate < 64 ) sample_rate = 48000;
+ if( sample_rate < 64 ) sample_rate = samplerate;
return PluginLV2::init_lv2(config, sample_rate, bfrsz);
}
// main loop
int PluginLV2ChildUI::run_ui()
{
- double last_time = 0, fps = 30;
- int64_t frame_usecs = 1e6 / fps;
+ double last_time = 0;
+ int64_t frame_usecs = 1e6 / refreshrate;
running = 1;
done = 0;
while( !done ) {
const char *path = url;
const char *subfilter1 = string, *subfilter2 = 0;
int token_done = 0;
+ result = 0;
do {
string2[0] = 0;
subfilter2 = strchr(subfilter1, '*');
outgoing->clear_frame();
overlayer->overlay(outgoing, incoming,
in_x, in_y, in_x + in_w, in_y + in_h,
- 0, 0, temp->get_w(), temp->get_h(),
+ 0, 0, outgoing->get_w(), outgoing->get_h(),
1.0, TRANSFER_REPLACE, CUBIC_LINEAR);
}