add_subwindow(new BC_Title(x, y, _("Plugin Icons:")));
add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow));
plugin_icons->create_objects();
- y += plugin_icons->get_h() + ys15;
+ y += plugin_icons->get_h() + ys10;
+ add_subwindow(new BC_Title(x, y, _("Locale:")));
+ LayoutLocale *layout_locale;
+ add_subwindow(layout_locale = new LayoutLocale(x1, y, pwindow));
+ layout_locale->create_objects();
+ y += layout_locale->get_h() + ys15;
x1 = get_w()/2;
int x2 = x1 + xS(160), y2 = y;
return 1;
}
+LayoutLocale::LayoutLocale(int x, int y, PreferencesWindow *pwindow)
+ : BC_PopupMenu(x, y, xS(200), pwindow->thread->preferences->locale, 1)
+{
+ this->pwindow = pwindow;
+}
+LayoutLocale::~LayoutLocale()
+{
+}
+
+const char *LayoutLocale::locale_list[] = { LOCALE_LIST, 0 };
+
+void LayoutLocale::create_objects()
+{
+ for( const char *tp, **lp=locale_list; (tp=*lp)!=0; ++lp )
+ add_item(new LayoutLocaleItem(this, tp));
+}
+
+int LayoutLocale::handle_event()
+{
+ return 1;
+}
+
+LayoutLocaleItem::LayoutLocaleItem(LayoutLocale *popup, const char *text)
+ : BC_MenuItem(text)
+{
+ this->popup = popup;
+}
+
+int LayoutLocaleItem::handle_event()
+{
+ popup->set_text(get_text());
+ strcpy(popup->pwindow->thread->preferences->locale, get_text());
+ popup->handle_event();
+ return 1;
+}
+
ViewLayoutScale::ViewLayoutScale(PreferencesWindow *pwindow,
AppearancePrefs *aprefs, int x, int y)
: BC_TumbleTextBox(aprefs,
ViewPluginIcons *popup;
};
+class LayoutLocale : public BC_PopupMenu
+{
+ static const char *locale_list[];
+public:
+ LayoutLocale(int x, int y, PreferencesWindow *pwindow);
+ ~LayoutLocale();
+
+ void create_objects();
+ int handle_event();
+
+ PreferencesWindow *pwindow;
+};
+
+class LayoutLocaleItem : public BC_MenuItem
+{
+public:
+ LayoutLocaleItem(LayoutLocale *popup, const char *text);
+ int handle_event();
+ LayoutLocale *popup;
+};
+
class ViewLayoutScale : public BC_TumbleTextBox
{
public:
class YuvColorRangeItem;
class PerpetualSession;
class Composer_BG_Color;
+class LayoutLocale;
#endif
new_edit->hard_left = edit->hard_right = 0;
}
new_edit->startproject = position;
- new_edit->startsource += edit->length;
+ int64_t edit_start = edit->startproject;
+ int64_t edit_end = edit_start + edit->length;
+ new_edit->startsource += track->speed_length(edit_start, edit_end);
// Decide what to do with the transition
if(edit->length && edit->transition) {
//printf("Edits::clear 3.5 %d %d %d %d\n", edit1->startproject, edit1->length, edit2->startproject, edit2->length);
edit1->length = start - edit1->startproject;
edit2->length -= end - edit2->startproject;
- edit2->startsource += end - edit2->startproject;
+ edit2->startsource += track->speed_length(edit2->startproject, end);
edit2->startproject += end - edit2->startproject;
// delete
current_edit = split_edit(start);
if( current_edit ) {
current_edit->length -= end - start;
- current_edit->startsource += end - start;
+ current_edit->startsource += track->speed_length(start, end);
// shift
while( (current_edit=current_edit->next) != 0 ) {
current_edit->startproject -= end - start;
this->mwindow = mwindow;
this->load = load;
this->window = 0;
- load_mode = LOADMODE_REPLACE;
+ load_mode = LOADMODE_RESOURCESONLY;
edl_mode = LOADMODE_EDL_CLIP;
}
#include "arraylist.h"
#include "batchrender.h"
#include "bcsignals.h"
+#include "cstrdup.h"
#include "edl.h"
#include "file.h"
#include "filexml.h"
batch_path[0] = 0;
deamon_path[0] = 0;
Units::init();
-
+ const char *lang = getenv("LANGUAGE");
+ if( lang ) lang = cstrdup(lang);
File::init_cin_path();
const char *locale_path = File::get_locale_path();
const char *cin = File::get_cin();
}
if( restart <= 0 )
done = 1;
-
mwindow.save_defaults();
mwindow.save_undo_data();
//PRINT_TRACE
}
if( restart < 0 ) {
+ if( lang ) // reset to cmdline state
+ setenv("LANGUAGE", lang, 1);
+ else
+ unsetenv("LANGUAGE");
char exe_path[BCTEXTLEN];
int len = readlink("/proc/self/exe", exe_path, sizeof(exe_path)-1);
if( len < 0 ) break;
}
filenames.remove_all_objects();
+ delete [] lang;
Units::finit();
BC_WindowBase::finit_resources();
void MWindow::check_language()
{
+ char pref_locale[BCSTRLEN];
+ strcpy(pref_locale, DEFAULT_LOCALE);
+ defaults->get("LOCALE",pref_locale);
+// set LANGUAGE if pref locale != sys
+ if( strcmp(pref_locale, DEFAULT_LOCALE) )
+ setenv("LANGUAGE", pref_locale, 1);
+
char curr_lang[BCTEXTLEN]; curr_lang[0] = 0;
const char *env_lang = getenv("LANGUAGE");
if( !env_lang ) env_lang = getenv("LC_ALL");
init_3d();
if(debug) PRINT_TRACE
- show_splash();
if(debug) PRINT_TRACE
default_standard = default_std();
init_defaults(defaults, config_path);
check_language();
+ show_splash();
init_preferences();
if(splash_window)
splash_window->update_status(_("Initializing Plugins"));
vicon_size = 50;
vicon_color_mode = VICON_COLOR_MODE_LOW;
theme[0] = 0;
+ strcpy(locale, DEFAULT_LOCALE);
plugin_icons[0] = 0;
strcpy(snapshot_path, DEFAULT_SNAPSHOT_PATH);
use_renderfarm = 0;
bd_warn_root = 1;
popupmenu_btnup = 1;
grab_input_focus = 1;
- textbox_focus_policy = 0;
+ textbox_focus_policy = CLICK_ACTIVATE | CLICK_DEACTIVATE;
auto_rotate = 1;
forward_render_displacement = 0;
dvd_yuv420p_interlace = 0;
yuv_color_space = BC_COLORS_BT601;
yuv_color_range = BC_COLORS_JPEG;
autocolor_assets = 0;
- ctrl_toggle = 0;
+ ctrl_toggle = 1;
rectify_audio = 0;
// Default brender asset
vicon_size = that->vicon_size;
vicon_color_mode = that->vicon_color_mode;
strcpy(theme, that->theme);
+ strcpy(locale, that->locale);
strcpy(plugin_icons, that->plugin_icons);
strcpy(snapshot_path, that->snapshot_path);
vicon_size = defaults->get("VICON_SIZE",vicon_size);
vicon_color_mode = defaults->get("VICON_COLOR_MODE",vicon_color_mode);
strcpy(theme, _(DEFAULT_THEME));
+ strcpy(locale, DEFAULT_LOCALE);
strcpy(plugin_icons, DEFAULT_PICON);
defaults->get("THEME", theme);
+ defaults->get("LOCALE", locale);
defaults->get("PLUGIN_ICONS", plugin_icons);
strcpy(snapshot_path, DEFAULT_SNAPSHOT_PATH);
defaults->get("SNAPSHOT_PATH", snapshot_path);
defaults->update("VICON_SIZE",vicon_size);
defaults->update("VICON_COLOR_MODE",vicon_color_mode);
defaults->update("THEME", theme);
+ defaults->update("LOCALE", locale);
defaults->update("PLUGIN_ICONS", plugin_icons);
defaults->update("SNAPSHOT_PATH", snapshot_path);
int vicon_size, vicon_color_mode;
float layout_scale;
// Title of theme
- char theme[BCTEXTLEN];
+ char theme[BCSTRLEN];
+ char locale[BCSTRLEN];
// plugin icon set
- char plugin_icons[BCTEXTLEN];
+ char plugin_icons[BCSTRLEN];
// snapshot directory path
char snapshot_path[BCTEXTLEN];
double render_preroll;
#define LAYOUT_FILE "layout%d_rc"
#define LAYOUT_NAME_LEN 8
#define LAYOUTS_MAX 4
+#define DEFAULT_LOCALE "sys"
+#define LOCALE_LIST DEFAULT_LOCALE, "en", "fr", "de", "ru", "es", "it", "nb"
#define DEFAULT_LV2_PATH CINDAT_DIR "/lv2"
#define DEFAULT_NESTED_PROXY_PATH NESTED_DIR
#define DEFAULT_SNAPSHOT_PATH SNAP_DIR
if( window ) window->lock_window("PreferencesThread::apply_settings 5");
if( strcmp(preferences->theme, mwindow->preferences->theme) ||
+ strcmp(preferences->locale, mwindow->preferences->locale) ||
strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) ||
preferences->awindow_picon_h != mwindow->preferences->awindow_picon_h ||
preferences->layout_scale != mwindow->preferences->layout_scale ||
return 0;
}
+int64_t Track::speed_length(int64_t start, int64_t end)
+{
+ if( !has_speed() ) return end - start;
+ FloatAutos *speeds = (FloatAutos *) automation->autos[AUTOMATION_SPEED];
+ return speeds->automation_integral(start, end-start, PLAY_FORWARD);
+}
+
int Track::show_assets()
{
return expand_view || edl->session->show_assets ? 1 : 0;
int edit_edits, int edit_labels, int edit_plugins,
int edit_autos, Edits *trim_edits)
{
+ if( edit_edits )
+ edits->clear(start, end);
//printf("Track::clear 1 %d %d %d\n", edit_edits, edit_labels, edit_plugins);
if( edit_autos )
automation->clear(start, end, 0, 1);
plugin_set.values[i]->clear(start, end, edit_keyframes);
}
}
- if( edit_edits )
- edits->clear(start, end);
return 0;
}
// Speed curve in use
int has_speed();
+// length when speed is applied
+ int64_t speed_length(int64_t start, int64_t end);
// Get length of track in seconds
double get_length();
// Get dimensions of source for convenience functions
idxbl->get_audio_samples() :
edit->track->data_type == TRACK_VIDEO ?
idxbl->get_video_frames() : -1;
- if( edit->startsource + edit->length >= source_len )
+ int64_t speed_start = edit->startproject;
+ int64_t speed_end = speed_start + edit->length;
+ int64_t speed_length = track->speed_length(speed_start, speed_end);
+ if( edit->startsource + speed_length >= source_len )
can_drag = 0;
}
else if( !edit->startsource )
mov prores
# ProRes, encoder prores_aw. Container Apple QuickTime movie (.mov).
-profile=2
+profile=3
# The possible video profile values for the ProRes codec are:
# 5 = 4444xq
# 4 = 4444