BD_WarnRoot *bdwr_warn = new BD_WarnRoot(pwindow, x, y);
add_subwindow(bdwr_warn);
y += bdwr_warn->get_h() + ys5;
+ UseWarnFileRef *warn_ref = new UseWarnFileRef(pwindow, x, y);
+ add_subwindow(warn_ref);
+ y += warn_ref->get_h() + ys5;
x = get_w() / 3 + xs30;
y = y1;
return 1;
}
+UseWarnFileRef::UseWarnFileRef(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->warn_fileref,
+ _("Warn on creating file references"))
+{
+ this->pwindow = pwindow;
+}
+
+int UseWarnFileRef::handle_event()
+{
+ pwindow->thread->preferences->warn_fileref = get_value();
+ return 1;
+}
+
+
PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
: BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup,
_("Popups activate on button up"))
PreferencesWindow *pwindow;
};
+class UseWarnFileRef : public BC_CheckBox
+{
+public:
+ UseWarnFileRef(PreferencesWindow *pwindow, int x, int y);
+ int handle_event();
+ PreferencesWindow *pwindow;
+};
+
class PopupMenuBtnup : public BC_CheckBox
{
public:
int is_clip = 0;
if( this->indexable ) {
- fs.extract_name(name, indexable->path);
- set_text(name);
- if( this->indexable->is_asset )
+ char *cp = name;
+ if( this->indexable->is_asset ) {
asset = (Asset *)indexable;
- else
+ if( asset->format == FILE_REF ) {
+ cp += sprintf(cp, "ref:");
+ set_color(get_color() ^ 0x5599CC);
+ }
+ }
+ else {
edl = (EDL *)indexable;
+ cp += sprintf(cp, "edl:");
+ set_color(get_color() ^ 0xCC9955);
+ }
+ fs.extract_name(cp, indexable->path);
+ set_text(name);
}
else if( this->edl ) {
edl = this->edl;
- set_text(strcpy(name, edl->local_session->clip_title));
+ strcpy(name, edl->local_session->clip_title);
set_text(name);
is_clip = 1;
}
if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
this, current);
- if( current->format == FILE_REF ) {
- int color = picon->get_color();
- picon->set_color(color ^ 0x5599CC);
- }
new_assets.append(picon);
}
}
#include "mainsession.h"
#include "mwindow.h"
#include "mwindowgui.h"
+#include "preferences.h"
#include "theme.h"
sprintf(default_path, "~");
mwindow->defaults->get("DEFAULT_LOADPATH", default_path);
load_mode = mwindow->defaults->get("LOAD_MODE", load_mode);
- edl_mode = mwindow->defaults->get("LOAD_EDL_MODE", edl_mode);
mwindow->gui->lock_window("LoadFileThread::new_gui");
window = new LoadFileWindow(mwindow, this, default_path);
{
mwindow->defaults->update("DEFAULT_LOADPATH", window->get_submitted_path());
mwindow->defaults->update("LOAD_MODE", load_mode);
- mwindow->defaults->update("LOAD_EDL_MODE", edl_mode);
-
+ if( edl_mode == LOADMODE_EDL_FILEREF )
+ mwindow->show_warning(
+ &mwindow->preferences->warn_fileref,
+ _("Other projects can change this project"));
ArrayList<char*> path_list;
path_list.set_array_delete();
int x = get_w() / 2 - LoadMode::calculate_w(this, mwindow->theme) / 2;
int y = get_y_margin();
+// always start as clip to match historical behavior
+ thread->edl_mode = LOADMODE_EDL_CLIP;
loadmode = new LoadMode(mwindow, this, x, y,
&thread->load_mode, &thread->edl_mode, 0, 1);
loadmode->create_objects();
path_list.set_array_delete();
char *out_path;
int load_mode = mwindow->defaults->get("LOAD_MODE", LOADMODE_REPLACE);
- int edl_mode = mwindow->defaults->get("LOAD_EDL_MODE", LOADMODE_EDL_CLIP);
path_list.append(out_path = new char[strlen(path) + 1]);
strcpy(out_path, path);
path_list.remove_all_objects();
mwindow->defaults->update("LOAD_MODE", load_mode);
- mwindow->defaults->update("LOAD_EDL_MODE", edl_mode);
mwindow->save_backup();
mwindow->session->changes_made = 0;
return 1;
session->group_number += groups;
switch( edl_mode ) {
case LOADMODE_EDL_CLIP: {
- sprintf(new_edl->local_session->clip_title, _("Clip %d"),
- session->clip_number++);
- char string[BCSTRLEN];
- time_t t; time(&t);
- ctime_r(&t, string);
- snprintf(new_edl->local_session->clip_notes,
- sizeof(new_edl->local_session->clip_notes),
- +("%sFrom: %s"), string, filename);
+ strcpy(new_edl->local_session->clip_title,
+ filenames->get(i));
+ struct stat st;
+ time_t t = !stat(filenames->get(i),&st) ?
+ st.st_mtime : time(&t);
+ ctime_r(&t, new_edl->local_session->clip_notes);
switch( load_mode ) {
case LOADMODE_REPLACE:
case LOADMODE_REPLACE_CONCATENATE:
get_resources()->text_background :
get_resources()->text_background_disarmed);
patch->title->set_text_row(0);
+ mwindow->gui->draw_overlays(1);
return 1;
}
return 0;
warn_indexes = 1;
warn_version = 1;
warn_stack = 1;
+ warn_fileref = 1;
bd_warn_root = 1;
popupmenu_btnup = 1;
grab_input_focus = 1;
warn_indexes = that->warn_indexes;
warn_version = that->warn_version;
warn_stack = that->warn_stack;
+ warn_fileref = that->warn_fileref;
bd_warn_root = that->bd_warn_root;
popupmenu_btnup = that->popupmenu_btnup;
grab_input_focus = that->grab_input_focus;
warn_indexes = defaults->get("WARN_INDEXES", warn_indexes);
warn_version = defaults->get("WARN_VERSION", warn_version);
warn_stack = defaults->get("WARN_STACK", warn_stack);
+ warn_fileref = defaults->get("WARN_FILEREF", warn_fileref);
bd_warn_root = defaults->get("BD_WARN_ROOT", bd_warn_root);
popupmenu_btnup = defaults->get("POPUPMENU_BTNUP", popupmenu_btnup);
grab_input_focus = defaults->get("GRAB_FOCUS", grab_input_focus);
defaults->update("WARN_INDEXES", warn_indexes);
defaults->update("WARN_VERSION", warn_version);
defaults->update("WARN_STACK", warn_stack);
+ defaults->update("WARN_FILEREF", warn_fileref);
defaults->update("BD_WARN_ROOT", bd_warn_root);
defaults->update("POPUPMENU_BTNUP", popupmenu_btnup);
defaults->update("GRAB_FOCUS", grab_input_focus);
int warn_indexes;
int warn_version;
int warn_stack;
+ int warn_fileref;
int bd_warn_root;
// grab input focus on enter notify
int grab_input_focus;
void TrackCanvas::draw_selected_edits(EDL *edl, int dx, int dy, int color0, int color1)
{
+ int dropping = 0;
for( Track *track=edl->tracks->first; track; track=track->next ) {
+ if( !track->record && color1 < 0 ) {
+ if( dropping )
+ dy -= track->vertical_span(mwindow->theme);
+ continue;
+ }
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( !edit->is_selected ) continue;
+ dropping = 1;
int64_t x, y, w, h;
edit_dimensions(edit, x, y, w, h);
x += dx; y += dy;
set_opaque();
int inner = color1 < 0 ? color0 : !edit->group_id ? color0 :
mwindow->get_group_color(edit->group_id);
- set_color(inner);
- draw_selected(x, y, w, h);
int outer = color1 < 0 ? color0 : !edit->group_id ? color1 : inner;
- set_color(outer);
+ set_color(track->record ? inner : outer);
+ draw_selected(x, y, w, h);
+ set_color(track->record ? outer : inner);
draw_selected(x-1, y-1, w+2, h+2);
draw_selected(x-2, y-2, w+1, h+1);
}
return result;
}
-
+// returns -1=doesnt fit, 1=fits, 0=fits but overwrites
int TrackCanvas::test_track_group(EDL *group, Track *first_track, double &pos)
{
+ int intersects = 0;
Track *src = group->tracks->first;
for( Track *track=first_track; track && src; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->record ) return -1;
if( src->data_type != track->data_type ) return -1;
for( Edit *src_edit=src->edits->first; src_edit; src_edit=src_edit->next ) {
if( src_edit->silence() ) continue;
- if( edit_intersects(track, src_edit, pos) ) return 0;
+ if( !intersects && edit_intersects(track, src_edit, pos) )
+ intersects = 1;
}
src = src->next;
}
- return !src ? 1 : 0;
+ return src ? -1 : !intersects ? 1 : 0;
}
int TrackCanvas::edit_intersects(Track *track, Edit *src_edit, double &pos)
{
if( pos < 0 ) { pos = 0; return 1; }
+ int pane_no = pane->number;
+ int cur_pix = track->edl->get_position_cursorx(pos, pane_no);
int64_t src_start = src_edit->startproject;
int64_t src_end = src_start + src_edit->length;
double new_start = src_edit->track->from_units(src_start) + pos;
if( edit_start >= trk_end ) continue;
int64_t edit_end = edit_start + edit->length;
if( trk_start >= edit_end ) continue;
+
int64_t lt_dist = labs(trk_end - edit_start);
int64_t rt_dist = labs(edit_end - trk_start);
int64_t position;
if( lt_dist > rt_dist )
position -= src_end;
}
- pos = edit->track->from_units(position);
+ double new_pos = edit->track->from_units(position);
+ int new_pix = track->edl->get_position_cursorx(new_pos, pane_no);
+ if( abs(new_pix-cur_pix) < HANDLE_W )
+ pos = new_pos;
return 1;
}
return 0;
x = get_w() - BC_CancelButton::calculate_w() - xS(10);
add_subwindow(new BC_CancelButton(x, y));
show_window();
+ raise_window();
unlock_window();
}
int BC_WindowBase::raise_window(int do_flush)
{
+ if( hidden ) return 1;
+ if( wait_viewable(500) ) return 1;
XRaiseWindow(top_level->display, win);
if(do_flush) XFlush(top_level->display);
return 0;
XSetInputFocus(top_level->display, top_level->win, RevertToParent, CurrentTime);
}
+int BC_WindowBase::wait_viewable(int ms)
+{
+ Timer timer;
+ XWindowAttributes xwa;
+ do {
+ XGetWindowAttributes(top_level->display, top_level->win, &xwa);
+ if( xwa.map_state == IsViewable ) return 1;
+ usleep(10000);
+ } while( timer.get_difference() < ms );
+ return 0;
+}
+
void slide_down(int distance);
void flicker(int n=3, int ms=66);
void focus();
+ int wait_viewable(int ms);
int cycle_textboxes(int amount);
msgstr "Nest-Sequenz"
#: cinelerra/loadmode.C:118 cinelerra/loadmode.C:167
-msgid "Insertion strategy:"
+msgid "Load strategy:"
msgstr "Einfügestrategie:"
#: cinelerra/localsession.C:63
msgstr "Secuencia de anidado"
#: cinelerra/loadmode.C:118 cinelerra/loadmode.C:167
-msgid "Insertion strategy:"
+msgid "Load strategy:"
msgstr "Estrategia de inserción:"
#: cinelerra/localsession.C:63
msgstr "Séquence Nest"
#: cinelerra/loadmode.C:82 cinelerra/loadmode.C:102
-msgid "Insertion strategy:"
+msgid "Load strategy:"
msgstr "Stratégie d'insertion :"
#: cinelerra/localsession.C:63
msgstr "Sequenza Nest"
#: cinelerra//loadmode.C:82 cinelerra//loadmode.C:102
-msgid "Insertion strategy:"
+msgid "Load strategy:"
msgstr "Modalità Inserimento:"
#: cinelerra//localsession.C:63
msgstr "Вложенная последовательность"
#: cinelerra/loadmode.C:118 cinelerra/loadmode.C:167
-msgid "Insertion strategy:"
+msgid "Load strategy:"
msgstr "Стратегия открытия:"
#: cinelerra/localsession.C:63