}
EditPopupClearSelect::EditPopupClearSelect(MWindow *mwindow, EditPopup *popup)
- : BC_MenuItem(_("Clear Select"),_("Ctrl-A"),'A')
+ : BC_MenuItem(_("Clear Select"),_("Ctrl-Shift-A"),'A')
{
this->mwindow = mwindow;
this->popup = popup;
}
EditPopupCopyPack::EditPopupCopyPack(MWindow *mwindow, EditPopup *popup)
- : BC_MenuItem(_("Copy pack"),_("Ctrl-C"),'C')
+ : BC_MenuItem(_("Copy pack"),_("Ctrl-Shift-C"),'C')
{
this->mwindow = mwindow;
this->popup = popup;
}
EditPopupMutePack::EditPopupMutePack(MWindow *mwindow, EditPopup *popup)
- : BC_MenuItem(_("Mute pack"),_("Ctrl-M"),'M')
+ : BC_MenuItem(_("Mute pack"),_("Ctrl-Shift-M"),'M')
{
this->mwindow = mwindow;
this->popup = popup;
int EditPopupPaste::handle_event()
{
mwindow->paste(popup->position, popup->track, 0, 0);
+ mwindow->edl->tracks->clear_selected_edits();
+ popup->gui->draw_overlays(1);
if( mwindow->session->current_operation == DROP_TARGETING ) {
mwindow->session->current_operation = NO_OPERATION;
popup->gui->update_cursor();
int EditPopupOverwrite::handle_event()
{
mwindow->paste(popup->position, popup->track, 0, -1);
+ mwindow->edl->tracks->clear_selected_edits();
+ popup->gui->draw_overlays(1);
if( mwindow->session->current_operation == DROP_TARGETING ) {
mwindow->session->current_operation = NO_OPERATION;
popup->gui->update_cursor();
tracks->first->edits->first->asset : 0;
}
+Track *EDL::add_new_track(int data_type)
+{
+ Track *new_track = 0;
+ switch( data_type ) {
+ case TRACK_VIDEO:
+ ++session->video_tracks;
+ new_track = tracks->add_video_track(0, 0);
+ break;
+ case TRACK_AUDIO:
+ ++session->audio_tracks;
+ new_track = tracks->add_audio_track(0, 0);
+ break;
+ case TRACK_SUBTITLE:
+ new_track = tracks->add_subttl_track(0, 0);
+ break;
+ }
+ return new_track;
+}
+
double EDL::get_cursor_position(int cursor_x, int pane_no)
{
return (double)cursor_x * local_session->zoom_sample / session->sample_rate +
void add_proxy(int use_scaler,
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
Asset *get_proxy_asset();
+ Track *add_new_track(int data_type);
// Titles of all subfolders
BinFolders folders;
void MWindow::selected_to_clipboard(int packed)
{
+ int64_t start = INT64_MAX, end = -INT64_MAX, pos = 0;
+ for( Track *track=edl->tracks->first; track; track=track->next ) {
+ if( !track->record ) continue;
+ for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+ if( !edit->is_selected || edit->silence() ) continue;
+ if( start > (pos=edit->startproject) ) start = pos;
+ if( end < (pos+=edit->length) ) end = pos;
+ }
+ }
EDL *new_edl = new EDL();
new_edl->create_objects();
new_edl->copy_session(edl);
for( Track *track=edl->tracks->first; track; track=track->next ) {
if( !track->record ) continue;
Track *new_track = 0;
- if( !packed ) {
- switch( track->data_type ) {
- case TRACK_VIDEO:
- ++new_edl->session->video_tracks;
- new_track = new_edl->tracks->add_video_track(0, 0);
- break;
- case TRACK_AUDIO:
- ++new_edl->session->audio_tracks;
- new_track = new_edl->tracks->add_audio_track(0, 0);
- break;
- case TRACK_SUBTITLE:
- new_track = new_edl->tracks->add_subttl_track(0, 0);
- break;
- }
- }
- int64_t startproject = 0, last_startproject = 0;
+ if( !packed )
+ new_track = new_edl->add_new_track(track->data_type);
+ int64_t startproject = 0, last_startproject = start;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+ if( edit->startproject < start ) continue;
+ if( edit->startproject >= end ) break;
if( !edit->is_selected || edit->silence() ) {
if( !packed ) startproject += edit->length;
continue;
}
- if( !new_track ) {
- switch( track->data_type ) {
- case TRACK_VIDEO:
- ++new_edl->session->video_tracks;
- new_track = new_edl->tracks->add_video_track(0, 0);
- break;
- case TRACK_AUDIO:
- ++new_edl->session->audio_tracks;
- new_track = new_edl->tracks->add_audio_track(0, 0);
- break;
- case TRACK_SUBTITLE:
- new_track = new_edl->tracks->add_subttl_track(0, 0);
- break;
- }
- }
+ if( !new_track )
+ new_track = new_edl->add_new_track(track->data_type);
if( new_track ) {
- if( !packed && last_startproject > 0 &&
- startproject > last_startproject ) {
+ if( !packed && startproject > last_startproject ) {
Edit *silence = new Edit(new_edl, new_track);
silence->startproject = last_startproject;
silence->length = startproject - last_startproject;
else
position = mwindow->edl->local_session->get_selectionstart();
mwindow->paste(position, first_track, 0, overwrite);
+ mwindow->edl->tracks->clear_selected_edits();
+ draw_overlays(1);
result = 1;
break;
case 'M':