X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fassetpopup.C;h=47cc7f2ada894d6fc01dc66307d3c29b7d631fdf;hb=667ff598ae2a94f48c7056aee1d77d7cde39066b;hp=24304c724b8cd7e6d6477a6539f137abb3529ed0;hpb=55ccff122957ddfaa871cf8f251cfe866732c870;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 24304c72..47cc7f2a 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -44,6 +44,7 @@ #include "tracks.h" #include "vwindow.h" #include "vwindowgui.h" +#include "zwindow.h" AssetPopup::AssetPopup(MWindow *mwindow, AWindowGUI *gui) @@ -67,6 +68,7 @@ void AssetPopup::create_objects() add_item(index = new AssetPopupBuildIndex(mwindow, this)); add_item(view = new AssetPopupView(mwindow, this)); add_item(view_window = new AssetPopupViewWindow(mwindow, this)); + add_item(mixer = new AssetPopupMixer(mwindow, this)); add_item(new AssetPopupPaste(mwindow, this)); add_item(menu_item = new BC_MenuItem(_("Match..."))); menu_item->add_submenu(submenu = new BC_SubMenu()); @@ -256,6 +258,54 @@ int AssetPopupViewWindow::handle_event() return 1; } +AssetPopupMixer::AssetPopupMixer(MWindow *mwindow, AssetPopup *popup) + : BC_MenuItem(_("Open Mixers")) +{ + this->mwindow = mwindow; + this->popup = popup; +} + +AssetPopupMixer::~AssetPopupMixer() +{ +} + +int AssetPopupMixer::handle_event() +{ + ArrayListnew_mixers; + + mwindow->select_zwindow(0); + for( int i=0; isession->drag_assets->total; ++i ) { + Indexable *indexable = mwindow->session->drag_assets->values[i]; + ArrayList new_assets; + new_assets.append(indexable); + Track *track = mwindow->edl->tracks->last; + mwindow->load_assets(&new_assets, -1, LOADMODE_NEW_TRACKS, 0, 0, 0, 0, 0, 0); + track = !track ? mwindow->edl->tracks->first : track->next; + Mixer *mixer = 0; + ZWindow *zwindow = mwindow->get_mixer(mixer); + while( track ) { + track->play = track->record = 0; + if( track->data_type == TRACK_VIDEO ) { + sprintf(track->title, _("Mixer %d"), zwindow->idx); + } + mixer->mixer_ids.append(track->get_mixer_id()); + track = track->next; + } + char *path = indexable->path; + char *tp = strrchr(path, '/'); + if( !tp ) tp = path; else ++tp; + zwindow->set_title(tp); + new_mixers.append(zwindow); + } + + mwindow->tile_mixers(); + for( int i=0; istart(); + + mwindow->refresh_mixers(); + mwindow->resync_guis(); + return 1; +} AssetPopupPaste::AssetPopupPaste(MWindow *mwindow, AssetPopup *popup) : BC_MenuItem(_("Paste"))