#include "bchash.h"
#include "edl.h"
#include "edlsession.h"
+#include "filesystem.h"
#include "filexml.h"
#include "floatauto.h"
#include "floatautos.h"
restart_brender();
- gui->update(1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0);
+ gui->update(1, 1, 0, 0, 1, 0, 0);
gui->activate_timeline();
// gui->get_scrollbars(0);
// gui->canvas->draw();
// gui->cursor->draw(1);
// gui->canvas->flash();
// gui->canvas->activate();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
save_backup();
}
undo->update_undo_after(_("add track"), LOAD_ALL);
restart_brender();
+
+ gui->update(1, 1, 0, 0, 1, 0, 0);
+ gui->activate_timeline();
// gui->get_scrollbars(0);
// gui->canvas->draw();
// gui->patchbay->update();
// gui->cursor->draw(1);
// gui->canvas->flash();
// gui->canvas->activate();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
save_backup();
}
return 0;
}
+
void MWindow::delete_inpoint()
{
edl->local_session->unset_inpoint();
save_backup();
}
+
void MWindow::delete_track()
{
if (edl->tracks->last)
restart_brender();
update_plugin_states();
+
gui->update(1, 1, 1, 0, 1, 0, 0);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
void MWindow::delete_track(Track *track)
restart_brender();
update_plugin_states();
+
gui->update(1, 1, 1, 0, 1, 0, 0);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
save_backup();
}
-
-
-
// Insert data from clipboard
void MWindow::insert(double position,
FileXML *file,
void MWindow::move_effect(Plugin *plugin, Track *track, int64_t position)
{
undo->update_undo_before();
- edl->tracks->move_effect(plugin, track, position);
+ edl->tracks->move_effect(plugin, track, position);
save_backup();
undo->update_undo_after(_("paste effect"), LOAD_ALL);
sync_parameters(CHANGE_EDL);
}
-void MWindow::to_clip()
+void MWindow::to_clip(EDL *edl, const char *txt)
{
FileXML file;
double start, end;
start = edl->local_session->get_selectionstart();
end = edl->local_session->get_selectionend();
- if(EQUIV(end, start))
- {
+ if(EQUIV(end, start)) {
start = 0;
end = edl->tracks->total_length();
}
// Don't copy all since we don't want the clips twice.
- edl->copy(start,
- end,
- 0,
- 0,
- 0,
- &file,
- "",
- 1);
-
+ edl->copy(start, end, 0, 0, 0, &file, "", 1);
EDL *new_edl = new EDL(edl);
new_edl->create_objects();
new_edl->load_xml(&file, LOAD_ALL);
sprintf(new_edl->local_session->clip_title, _("Clip %d"), session->clip_number++);
- char string[BCTEXTLEN];
- Units::totext(string,
- end - start,
+ char duration[BCTEXTLEN];
+ Units::totext(duration, end - start,
edl->session->time_format,
edl->session->sample_rate,
edl->session->frame_rate,
edl->session->frames_per_foot);
- sprintf(new_edl->local_session->clip_notes, _("%s\nCreated from main window"), string);
+ const char *path = edl->path;
+ Track *track=edl->tracks->first;
+ for(; (!path || !*path) && track; track=track->next ) {
+ if( !track->record ) continue;
+ Edit *edit = track->edits->editof(start, PLAY_FORWARD, 0);
+ if( !edit ) continue;
+ Indexable *indexable = edit->get_source();
+ if( !indexable ) continue;
+ path = indexable->path;
+ }
+
+ time_t now; time(&now);
+ struct tm *tm = localtime(&now);
+ char *cp = new_edl->local_session->clip_notes;
+ int n, sz = sizeof(new_edl->local_session->clip_notes)-1;
+ if( txt && *txt ) {
+ n = snprintf(cp, sz, "%s", txt);
+ cp += n; sz -= n;
+ }
+ n = snprintf(cp, sz,
+ "%02d/%02d/%02d %02d:%02d:%02d, +%s\n",
+ tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec, duration);
+ cp += n; sz -= n;
+ if( path && *path ) {
+ FileSystem fs;
+ char title[BCTEXTLEN];
+ fs.extract_name(title, path);
+ n = snprintf(cp, sz, "%s", title);
+ cp += n; sz -= n;
+ }
+ cp[n] = 0;
new_edl->local_session->set_selectionstart(0);
new_edl->local_session->set_selectionend(0);
save_backup();
gui->unlock_window();
}
+void MWindow::to_clip(const char *txt)
+{
+ to_clip(edl, txt);
+}
int MWindow::toggle_label(int is_mwindow)
{
cwindow->gui->unlock_window();
}
+ awindow->gui->async_update_assets();
+
undo->update_undo_after(_("label"), LOAD_TIMEBAR);
return 0;
}