TitleWindow::TitleWindow(TitleMain *client)
: PluginClientWindow(client,
TitleWindow::TitleWindow(TitleMain *client)
: PluginClientWindow(client,
- client->config.window_w, client->config.window_h, 100, 100, 1)
+ client->config.window_w, client->config.window_h,
+ xS(100), yS(100), 1)
{
//printf("TitleWindow::TitleWindow %d %d %d\n", __LINE__, client->config.window_w, client->config.window_h);
this->client = client;
{
//printf("TitleWindow::TitleWindow %d %d %d\n", __LINE__, client->config.window_w, client->config.window_h);
this->client = client;
add_subwindow(font_tumbler = new TitleFontTumble(client, this, x, y+margin));
x += font_tumbler->get_w() + margin;
add_subwindow(font_tumbler = new TitleFontTumble(client, this, x, y+margin));
x += font_tumbler->get_w() + margin;
add_tool(size_title = new BC_Title(x1, y1+margin, _("Size:")));
sprintf(string, "%.2f", client->config.size);
x1 += size_title->get_w() + margin;
add_tool(size_title = new BC_Title(x1, y1+margin, _("Size:")));
sprintf(string, "%.2f", client->config.size);
x1 += size_title->get_w() + margin;
int x2 = x1 + size->get_w(), y2 = y1 + size->get_h() + margin;
add_subwindow(size_tumbler = new TitleSizeTumble(client, this, x2, y1+margin));
int x2 = x1 + size->get_w(), y2 = y1 + size->get_h() + margin;
add_subwindow(size_tumbler = new TitleSizeTumble(client, this, x2, y1+margin));
pitch = new TitlePitch(client, this, x1, y2+margin, &client->config.line_pitch);
pitch->create_objects();
pitch = new TitlePitch(client, this, x1, y2+margin, &client->config.line_pitch);
pitch->create_objects();
int y3 = pitch->get_y() + pitch->get_h();
add_tool(style_title = new BC_Title(x=x3, y, _("Style:")));
int y3 = pitch->get_y() + pitch->get_h();
add_tool(style_title = new BC_Title(x=x3, y, _("Style:")));
- add_tool(italic = new TitleItalic(client, this, x, y + 20));
+ add_tool(italic = new TitleItalic(client, this, x, y + yS(20)));
- add_tool(bold = new TitleBold(client, this, x, y + 50));
+ add_tool(bold = new TitleBold(client, this, x, y + yS(50)));
- add_tool(drag = new TitleDrag(client, this, x, y + 80));
+ if( client->drag && drag->drag_activate() ) {
+ eprintf("drag enabled, but compositor already grabbed\n");
+ client->drag = 0;
+ }
+ add_tool(drag = new TitleDrag(client, this, x, y + yS(80)));
- add_tool(alias = new TitleAlias(client, this, x, y+110));
+ add_tool(alias = new TitleAlias(client, this, x, y+yS(110)));
- add_tool(justify_title = new BC_Title(x+50, y, _("Justify:")));
- add_tool(left = new TitleLeft(client, this, x, y + 20));
+ add_tool(justify_title = new BC_Title(x+xS(50), y, _("Justify:")));
+ add_tool(left = new TitleLeft(client, this, x, y + yS(20)));
- add_tool(center = new TitleCenter(client, this, x, y + 50));
+ add_tool(center = new TitleCenter(client, this, x, y + yS(50)));
- add_tool(right = new TitleRight(client, this, x, y + 80));
+ add_tool(right = new TitleRight(client, this, x, y + yS(80)));
- add_tool(top = new TitleTop(client, this, x, y + 20));
- add_tool(mid = new TitleMid(client, this, x, y + 50));
- add_tool(bottom= new TitleBottom(client, this, x, y + 80));
+ add_tool(top = new TitleTop(client, this, x, y + yS(20)));
+ add_tool(mid = new TitleMid(client, this, x, y + yS(50)));
+ add_tool(bottom= new TitleBottom(client, this, x, y + yS(80)));
w1 = BC_Title::calculate_w(this, _("X:"));
if( (x1 = BC_Title::calculate_w(this, _("Y:"))) > w1 ) w1 = x1;
w1 = BC_Title::calculate_w(this, _("X:"));
if( (x1 = BC_Title::calculate_w(this, _("Y:"))) > w1 ) w1 = x1;
add_tool(motion_title = new BC_Title(x1=x, y, _("Motion:")));
x1 += motion_title->get_w()+margin;
motion = new TitleMotion(client, this, x1, y);
motion->create_objects();
add_tool(loop = new TitleLoop(client, this, x, y1));
add_tool(motion_title = new BC_Title(x1=x, y, _("Motion:")));
x1 += motion_title->get_w()+margin;
motion = new TitleMotion(client, this, x1, y);
motion->create_objects();
add_tool(loop = new TitleLoop(client, this, x, y1));
add_tool(dropshadow_title = new BC_Title(x, y, _("Drop shadow:")));
w1 = dropshadow_title->get_w();
add_tool(dropshadow_title = new BC_Title(x, y, _("Drop shadow:")));
w1 = dropshadow_title->get_w();
- dropshadow = new TitleDropShadow(client, this, x, y + 20);
+ dropshadow = new TitleDropShadow(client, this, x, y + yS(20));
dropshadow->create_objects();
if( dropshadow->get_w() > w1 ) w1 = dropshadow->get_w();
x += w1 + margin;
add_tool(fadein_title = new BC_Title(x, y, _("Fade in (sec):")));
w1 = fadein_title->get_w();
dropshadow->create_objects();
if( dropshadow->get_w() > w1 ) w1 = dropshadow->get_w();
x += w1 + margin;
add_tool(fadein_title = new BC_Title(x, y, _("Fade in (sec):")));
w1 = fadein_title->get_w();
- add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + 20));
+ add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + yS(20)));
if( fade_in->get_w() > w1 ) w1 = fade_in->get_w();
x += w1 + margin;
add_tool(fadeout_title = new BC_Title(x, y, _("Fade out (sec):")));
w1 = fadeout_title->get_w();
if( fade_in->get_w() > w1 ) w1 = fade_in->get_w();
x += w1 + margin;
add_tool(fadeout_title = new BC_Title(x, y, _("Fade out (sec):")));
w1 = fadeout_title->get_w();
- add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + 20));
+ add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + yS(20)));
if( fade_out->get_w() > w1 ) w1 = fade_out->get_w();
x += w1 + margin;
add_tool(speed_title = new BC_Title(x, y, _("Speed:")));
w1 = speed_title->get_w();
if( fade_out->get_w() > w1 ) w1 = fade_out->get_w();
x += w1 + margin;
add_tool(speed_title = new BC_Title(x, y, _("Speed:")));
w1 = speed_title->get_w();
speed = new TitleSpeed(client, this, x, y);
speed->create_objects();
if( speed->get_w() > w1 ) w1 = speed->get_w();
x += w1 + margin;
speed = new TitleSpeed(client, this, x, y);
speed->create_objects();
if( speed->get_w() > w1 ) w1 = speed->get_w();
x += w1 + margin;
- add_tool(color_button_title = new BC_Title(x3, y1+10, _("Color:")));
- x1 = x3 + color_button_title->get_w() + 30;
+ add_tool(color_button_title = new BC_Title(x3, y1+yS(10), _("Color:")));
+ x1 = x3 + color_button_title->get_w() + xS(30);
add_tool(color_button = new TitleColorButton(client, this, x1, y1));
add_tool(color_button = new TitleColorButton(client, this, x1, y1));
- y1 += color_button->get_h() + 10;
- add_tool(outline_button_title = new BC_Title(x3, y1+10, _("Outline:")));
+ y1 += color_button->get_h() + yS(10);
+ add_tool(outline_button_title = new BC_Title(x3, y1+yS(10), _("Outline:")));
add_tool(outline_button = new TitleOutlineColorButton(client, this, x1, y1));
add_tool(outline_button = new TitleOutlineColorButton(client, this, x1, y1));
add_tool(outline_title = new BC_Title(x, y, _("Outline:")));
y1 = y + outline_title->get_h() + margin;
outline = new TitleOutline(client, this, x, y1);
outline->create_objects();
add_tool(outline_title = new BC_Title(x, y, _("Outline:")));
y1 = y + outline_title->get_h() + margin;
outline = new TitleOutline(client, this, x, y1);
outline->create_objects();
#ifdef USE_STROKER
add_tool(stroker_title = new BC_Title(x, y, _("Stroker:")));
stroker = new TitleStroker(client, this, x, y1);
#ifdef USE_STROKER
add_tool(stroker_title = new BC_Title(x, y, _("Stroker:")));
stroker = new TitleStroker(client, this, x, y1);
add_tool(background = new TitleBackground(client, this, x, y));
x += background->get_w() + margin;
add_tool(background_path = new TitleBackgroundPath(client, this, x, y));
add_tool(background = new TitleBackground(client, this, x, y));
x += background->get_w() + margin;
add_tool(background_path = new TitleBackgroundPath(client, this, x, y));
add_tool(background_browse = new BrowseButton(
client->server->mwindow->theme, this, background_path,
x, y, "", _("background media"), _("Select background media path")));
add_tool(background_browse = new BrowseButton(
client->server->mwindow->theme, this, background_path,
x, y, "", _("background media"), _("Select background media path")));
add_tool(loop_playback = new TitleLoopPlayback(client, this, x, y));
add_tool(loop_playback = new TitleLoopPlayback(client, this, x, y));
- x += text_title->get_w() + 20;
- int wid = BC_Title::calculate_w(this,"0")*10;
+ x += text_title->get_w() + xS(20);
+ int wid = BC_Title::calculate_w(this,"0")*xS(10);
add_tool(text_chars = new TitleTextChars(x,y,wid));
y += text_title->get_h() + margin;
x = margin;
add_tool(text_chars = new TitleTextChars(x,y,wid));
y += text_title->get_h() + margin;
x = margin;
- text = new TitleText(client, this, x, y, get_w()-margin - x, get_h() - y - 10);
+ text = new TitleText(client, this, x, y, get_w()-margin - x, get_h() - y - yS(10));
fade_out->reposition_window(fade_out->get_x(), fade_out->get_y());
text_title->reposition_window(text_title->get_x(), text_title->get_y());
timecode->reposition_window(timecode->get_x(), timecode->get_y());
fade_out->reposition_window(fade_out->get_x(), fade_out->get_y());
text_title->reposition_window(text_title->get_x(), text_title->get_y());
timecode->reposition_window(timecode->get_x(), timecode->get_y());
- text->reposition_window(text->get_x(), text->get_y(), w - text->get_x() - 10,
- BC_TextBox::pixels_to_rows(this, MEDIUMFONT, h - text->get_y() - 10));
+ text->reposition_window(text->get_x(), text->get_y(), w - text->get_x() - xS(10),
+ BC_TextBox::pixels_to_rows(this, MEDIUMFONT, h - text->get_y() - yS(10)));
justify_title->reposition_window(justify_title->get_x(), justify_title->get_y());
left->reposition_window(left->get_x(), left->get_y());
center->reposition_window(center->get_x(), center->get_y());
justify_title->reposition_window(justify_title->get_x(), justify_title->get_y());
left->reposition_window(left->get_x(), left->get_y());
center->reposition_window(center->get_x(), center->get_y());
- (char*)txt,ilen, (char *)wtxt,ilen*sizeof(wtxt[0])) / sizeof(wchar_t);
+ (char*)txt,ilen, (char *)wtxt,ilen*sizeof(wtxt[0])) / sizeof(wchr_t);
client->insert_text(wtxt, ibeam);
while( len > 0 && !wtxt[len] ) --len;
int adv = len+1 + ofs;
client->insert_text(wtxt, ibeam);
while( len > 0 && !wtxt[len] ) --len;
int adv = len+1 + ofs;
title_y->update((int64_t)client->config.title_y);
title_w->update((int64_t)client->config.title_w);
title_h->update((int64_t)client->config.title_h);
title_y->update((int64_t)client->config.title_y);
title_w->update((int64_t)client->config.title_w);
title_h->update((int64_t)client->config.title_h);
italic->update(client->config.style & BC_FONT_ITALIC);
bold->update(client->config.style & BC_FONT_BOLD);
alias->update(client->config.style & FONT_ALIAS);
italic->update(client->config.style & BC_FONT_ITALIC);
bold->update(client->config.style & BC_FONT_BOLD);
alias->update(client->config.style & FONT_ALIAS);
fade_out->update((float)client->config.fade_out);
font->update(client->config.font);
check_style(client->config.font,0);
fade_out->update((float)client->config.fade_out);
font->update(client->config.font);
check_style(client->config.font,0);
speed->update(client->config.pixels_per_second);
outline->update((int64_t)client->config.outline_size);
#ifdef USE_STROKER
speed->update(client->config.pixels_per_second);
outline->update((int64_t)client->config.outline_size);
#ifdef USE_STROKER
TitleSize::TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text)
TitleSize::TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text)
- : BC_PopupTextBox(window, &window->sizes, text, x, y, 64, 300)
+ : BC_PopupTextBox(window, &window->sizes, text, x, y, xS(64), yS(300))
TitlePitch::
TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value)
TitlePitch::
TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value)
- : BC_TumbleTextBox(window, *value, 0, INT_MAX, x, y, 64)
+ : BC_TumbleTextBox(window, *value, 0, INT_MAX, x, y, xS(64))
TitleMotion::TitleMotion(TitleMain *client, TitleWindow *window, int x, int y)
: BC_PopupTextBox(window, &window->paths,
client->motion_to_text(client->config.motion_strategy),
TitleMotion::TitleMotion(TitleMain *client, TitleWindow *window, int x, int y)
: BC_PopupTextBox(window, &window->paths,
client->motion_to_text(client->config.motion_strategy),
TitleTimecodeFormat::TitleTimecodeFormat(TitleMain *client, TitleWindow *window,
int x, int y, int tw, const char *text)
TitleTimecodeFormat::TitleTimecodeFormat(TitleMain *client, TitleWindow *window,
int x, int y, int tw, const char *text)
- : BC_PopupMenu(x, y, BC_PopupMenu::calculate_w(tw)+10, text, 1)
+ : BC_PopupMenu(x, y, BC_PopupMenu::calculate_w(tw)+xS(10), text, 1)
TitleFade::TitleFade(TitleMain *client, TitleWindow *window,
double *value, int x, int y)
TitleFade::TitleFade(TitleMain *client, TitleWindow *window,
double *value, int x, int y)
- : BC_TextBox(x, y, 80, 1, (float)*value)
+ : BC_TextBox(x, y, xS(80), 1, (float)*value)
int style = stroker && atof(stroker->get_text()) ? BC_FONT_OUTLINE : 0;
if( bold->get_value() ) style |= BC_FONT_BOLD;
if( italic->get_value() ) style |= BC_FONT_ITALIC;
int style = stroker && atof(stroker->get_text()) ? BC_FONT_OUTLINE : 0;
if( bold->get_value() ) style |= BC_FONT_BOLD;
if( italic->get_value() ) style |= BC_FONT_ITALIC;
client->config.style = style;
}
}
TitleFont::TitleFont(TitleMain *client, TitleWindow *window, int x, int y)
: BC_PopupTextBox(window, &window->fonts, client->config.font,
client->config.style = style;
}
}
TitleFont::TitleFont(TitleMain *client, TitleWindow *window, int x, int y)
: BC_PopupTextBox(window, &window->fonts, client->config.font,
- x, y, 340, 300, LISTBOX_ICON_LIST)
+ x, y, xS(340), yS(300), LISTBOX_ICON_LIST)
TitleDropShadow::TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.dropshadow,
TitleDropShadow::TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.dropshadow,
TitleOutline::TitleOutline(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.outline_size,
TitleOutline::TitleOutline(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.outline_size,
TitleStroker::TitleStroker(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.stroke_width,
TitleStroker::TitleStroker(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.stroke_width,
TitleX::TitleX(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_x,
TitleX::TitleX(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_x,
- -32767.f, 32767.f, x, y, 50)
+ -32767.f, 32767.f, x, y, xS(50))
TitleY::TitleY(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_y,
TitleY::TitleY(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_y,
- -32767.f, 32767.f, x, y, 50)
+ -32767.f, 32767.f, x, y, xS(50))
TitleW::TitleW(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_w,
TitleW::TitleW(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_w,
TitleH::TitleH(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_h,
TitleH::TitleH(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_h,
TitleSpeed::TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.pixels_per_second,
TitleSpeed::TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.pixels_per_second,
- 0.f, 1000.f, x, y, 100)
+ 0.f, 1000.f, x, y, xS(100))
}
TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y)
}
TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y)
- : DragCheckBox(client->server->mwindow, x, y, _("Drag"), &client->config.drag,
+ : DragCheckBox(client->server->mwindow, x, y, _("Drag"), &client->drag,
client->config.title_x, client->config.title_y,
client->config.title_w, client->config.title_h)
{
client->config.title_x, client->config.title_y,
client->config.title_w, client->config.title_h)
{
- return !client->server->plugin ? 0 :
- client->server->plugin->track;
+ PluginServer *server = client->server;
+ int plugin_id = server->plugin_id;
+ Plugin *plugin = server->edl->tracks->plugin_exists(plugin_id);
+ return !plugin ? 0 : plugin->track;
client->config.title_x = drag_x;
client->config.title_y = drag_y;
client->config.title_w = drag_w+0.5;
client->config.title_x = drag_x;
client->config.title_y = drag_y;
client->config.title_w = drag_w+0.5;
}
TitleBackgroundPath::TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y)
}
TitleBackgroundPath::TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_TextBox(x, y, 240, 1, client->config.background_path)
+ : BC_TextBox(x, y, xS(240), 1, client->config.background_path)
- window->fonts_popup->activate(px, py, 300,200);
+ window->fonts_popup->activate(px, py, xS(300),yS(200));
if( result ) return;
BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui();
const char *path = gui->get_submitted_path();
if( result ) return;
BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui();
const char *path = gui->get_submitted_path();
- char txt[BCSTRLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path);
+ char txt[BCTEXTLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path);
int x, y; mwindow->gui->get_abs_cursor(x, y);
BC_Window *gui = new BrowseButtonWindow(mwindow->theme,
int x, y; mwindow->gui->get_abs_cursor(x, y);
BC_Window *gui = new BrowseButtonWindow(mwindow->theme,
- x-25, y-100, window, "", _("Png file"), _("Png path"), 0);
+ x-xS(25), y-yS(100), window, "", _("Png file"), _("Png path"), 0);