KeyFrame* KeyFrames::get_keyframe()
{
+ int64_t pos = track->to_units(edl->local_session->get_selectionstart(1), 0);
// Search for keyframe on or before selection
- KeyFrame *result =
- get_prev_keyframe(
- track->to_units(edl->local_session->get_selectionstart(1), 0),
- PLAY_FORWARD);
-
-// Return nearest keyframe if not in automatic keyframe generation
- if(!edl->session->auto_keyframes)
- {
- return result;
- }
- else
-// Return new keyframe
- if(result == (KeyFrame*)default_auto ||
- result->position != track->to_units(edl->local_session->get_selectionstart(1), 0))
- {
- return (KeyFrame*)insert_auto(track->to_units(edl->local_session->get_selectionstart(1), 0));
+ KeyFrame *result = get_prev_keyframe(pos, PLAY_FORWARD);
+ if( edl->session->auto_keyframes ) {
+ if( !result || result->position != pos ||
+ result == (KeyFrame*)default_auto )
+// generate keyframes while tweeking, and no keyframe found at pos
+ result = (KeyFrame*)insert_auto(pos);
}
- else
-// Return existing keyframe
- {
- return result;
- }
-
- return 0;
+ return result;
}
mwindow->gui->lock_window("MainUndo::load_from_undo");
}
if( (load_flags & LOAD_ALL) == LOAD_ALL ) {
- EDL *edl = new EDL;
- edl->create_objects();
mwindow->edl->remove_user();
- mwindow->edl = edl;
+ mwindow->init_edl();
}
mwindow->edl->load_xml(file, load_flags);
for( Asset *asset=mwindow->edl->assets->first; asset; asset=asset->next ) {
int w = canvas->w, h = canvas->h, w2 = w/2, h2 = h/2;
int lx = 0, ly = h2/2, rx = w2, ry = h2/2;
BC_WindowBase *window = canvas->get_canvas();
+ window->set_color(BLACK);
+ window->clear_box(0,0, window->get_w(),window->get_h());
window->draw_vframe(&vlt, lx,ly, w2,h2, 0,0,vlt.get_w(),vlt.get_h());
window->draw_vframe(&vrt, rx,ry, w2,h2, 0,0,vrt.get_w(),vrt.get_h());
window->flash(1);
int result = 0;
for( Track *track=mwindow->edl->tracks->first; track && !result; track=track->next) {
- if( !track->show_assets() ) continue;
-
for( Edit *edit=track->edits->first; edit && !result; edit=edit->next ) {
int64_t edit_x, edit_y, edit_w, edit_h;
edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
if( cursor_x < edit_x + HANDLE_W ) {
edit_result = edit;
handle_result = 0;
- if( cursor_y >= edit_y+edit_h - HANDLE_W ) {
+ if( cursor_y >= edit_y+edit_h - HANDLE_W &&
+ track->show_assets() ) {
new_cursor = DOWNLEFT_RESIZE;
if( button_press == LEFT_BUTTON )
result = -1;
else if( cursor_x >= edit_x + edit_w - HANDLE_W ) {
edit_result = edit;
handle_result = 1;
- if( cursor_y >= edit_y+edit_h - HANDLE_W ) {
+ if( cursor_y >= edit_y+edit_h - HANDLE_W &&
+ track->show_assets() ) {
new_cursor = DOWNRIGHT_RESIZE;
if( button_press == LEFT_BUTTON )
result = -1;
update_overlay = 1;
}
}
- else if( result < 0) {
+ else if( result < 0 ) {
mwindow->undo->update_undo_before();
if( !shift_down() ) {
if( handle_result == 0 )
int result = 0;
for(Track *track = mwindow->edl->tracks->first; track && !result; track = track->next) {
- if( !track->show_assets() ) continue;
-
for(Edit *edit = track->edits->first; edit && !result; edit = edit->next) {
int64_t edit_x, edit_y, edit_w, edit_h;
edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
}
+BC_FileBoxSearchText::BC_FileBoxSearchText(int x, int y, BC_FileBox *filebox)
+ : BC_TextBox(x, y, filebox->get_w() - x - 40, 1, "")
+{
+ this->filebox = filebox;
+}
+
+int BC_FileBoxSearchText::handle_event()
+{
+ filebox->refresh();
+ return 1;
+}
+
+
BC_FileBoxFilterText::BC_FileBoxFilterText(int x, int y, BC_FileBox *filebox)
: BC_TextBox(x, y, filebox->get_w() - x - 50, 1, filebox->get_resources()->filebox_filter)
{
x = 10;
y += directory_title->get_h() + 5;
+ BC_Title *search_title;
+ add_subwindow(search_title = new BC_Title(x, y, _("Search:")));
+ x += search_title->get_w() + 10;
+ add_subwindow(search_text = new BC_FileBoxSearchText(x, y, this));
+
+ x = 10;
+ y += search_text->get_h() + 5;
+
int newest_id = 0, newest = -1;
for(int i = 0; i < FILEBOX_HISTORY_SIZE; i++) {
if( !resources->filebox_history[i].path[0] ) continue;
directory_title->get_y(),
directory_title->get_w() + recent_popup->get_w(),
recent_popup->get_h());
+ search_text->reposition_window(
+ search_text->get_x(),
+ search_text->get_y(),
+ get_w() - search_text->get_x() - 40,
+ 1);
textbox->reposition_window(textbox->get_x(),
h - (get_h() - textbox->get_y()),
w - (get_w() - textbox->get_w()),
for(int i = 0; i < fs->total_files(); i++)
{
FileItem *file_item = fs->get_entry(i);
+ const char *text = search_text->get_text();
+ if( text && text[0] && !bstrcasestr(file_item->name, text) )
+ continue;
int is_dir = file_item->is_dir;
BC_Pixmap* icon = get_icon(file_item->name, is_dir);
BC_FileBox *filebox;
};
+class BC_FileBoxSearchText : public BC_TextBox
+{
+public:
+ BC_FileBoxSearchText(int x, int y, BC_FileBox *filebox);
+ int handle_event();
+ BC_FileBox *filebox;
+};
+
class BC_FileBoxFilterText : public BC_TextBox
{
public:
friend class BC_FileBoxCancel;
friend class BC_FileBoxDirectoryText;
+ friend class BC_FileBoxSearchText;
friend class BC_FileBoxListBox;
friend class BC_FileBoxTextBox;
friend class BC_FileBoxText;
BC_Title *filter_title;
BC_FileBoxFilterText *filter_text;
BC_FileBoxFilterMenu *filter_popup;
- BC_TextBox *directory_title;
+ BC_FileBoxDirectoryText *directory_title;
+ BC_FileBoxSearchText *search_text;
BC_Button *icon_button;
BC_Button *text_button;
BC_Button *folder_button;