X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=fc4fc8f87ab5515bcd922baf00d63577699be7ed;hp=84f50a36ca6dd01a2b25b8edd5ef781f66b738f5;hb=6e880be00673eac08e9463e3ce752aaf4c18085b;hpb=d17640d4122d028eee849d9fedf8ba35f7f0f6e0 diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 84f50a36..fc4fc8f8 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -40,6 +40,7 @@ #include "pluginserver.h" #include "theme.h" #include "track.h" +#include "tracks.h" #include "titlerwindow.h" #include "bcfontentry.h" @@ -530,9 +531,9 @@ int TitleWindow::insert_ibeam(const char *txt, int ofs) { int ibeam = cur_ibeam; int ilen = strlen(txt)+1; - wchar_t wtxt[ilen]; + wchr_t wtxt[ilen]; int len = BC_Resources::encode(client->config.encoding, BC_Resources::wide_encoding, - (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; @@ -582,7 +583,8 @@ void TitleWindow::update_gui() fade_out->update((float)client->config.fade_out); font->update(client->config.font); check_style(client->config.font,0); - text->update(client->config.wtext ? &client->config.wtext[0] : L""); + wchr_t wz[1] = { 0 }; + text->update(client->config.wtext ? &client->config.wtext[0] : wz); speed->update(client->config.pixels_per_second); outline->update((int64_t)client->config.outline_size); #ifdef USE_STROKER @@ -987,10 +989,10 @@ int TitleText::button_press_event() int TitleText::handle_event() { window->fonts_popup->deactivate(); - const wchar_t *wtext = get_wtext(); - long wlen = wcslen(wtext); + const wchr_t *wtext = get_wtext(); + long wlen = wstrlen(wtext); client->config.demand(wlen); - wcsncpy(client->config.wtext, wtext, client->config.wsize); + wstrncpy(client->config.wtext, wtext, client->config.wsize); client->config.wlen = wlen; window->update_stats(); window->send_configure_change(); @@ -1236,8 +1238,10 @@ TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y) Track *TitleDrag::get_drag_track() { - 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; } int64_t TitleDrag::get_drag_position() { @@ -1545,7 +1549,7 @@ void TitlePngPopup::handle_done_event(int result) 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); window->lock_window("TitlePngPopup::handle_done_event"); window->insert_ibeam(txt); window->unlock_window();