+AssetPopupOpenEDL::AssetPopupOpenEDL(MWindow *mwindow, AssetPopup *popup)
+ : BC_MenuItem(_("Open EDL"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+AssetPopupOpenEDL::~AssetPopupOpenEDL()
+{
+}
+
+int AssetPopupOpenEDL::handle_event()
+{
+ int assets_total = mwindow->session->drag_assets->size();
+ if( !assets_total ) return 1;
+ popup->unlock_window();
+ EDL *edl = 0;
+ Indexable *idxbl = mwindow->session->drag_assets->get(0);
+ if( idxbl->is_asset ) {
+ Asset *asset = (Asset *)idxbl;
+ if( asset->format == FILE_REF ) {
+ FileXML xml_file;
+ const char *filename = asset->path;
+ if( xml_file.read_from_file(filename, 1) ) {
+ eprintf(_("Error: unable to open:\n %s"), filename);
+ return 1;
+ }
+ edl = new EDL;
+ edl->create_objects();
+ if( edl->load_xml(&xml_file, LOAD_ALL) ) {
+ eprintf(_("Error: unable to load:\n %s"), filename);
+ edl->remove_user();
+ return 1;
+ }
+ }
+ }
+ else {
+ edl = (EDL *)idxbl;
+ }
+ if( edl )
+ mwindow->stack_push(edl, idxbl);
+ else
+ eprintf(_("media is not EDL:\n%s"), idxbl->path);
+ popup->lock_window("AssetPopupOpenEDL::handle_event");
+ return 1;
+}
+
+AssetPopupCloseEDL::AssetPopupCloseEDL(MWindow *mwindow, AWindowGUI *gui)
+ : BC_MenuItem(_("Close EDL"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+AssetPopupCloseEDL::~AssetPopupCloseEDL()
+{
+}
+
+int AssetPopupCloseEDL::handle_event()
+{
+ gui->unlock_window();
+ mwindow->gui->lock_window("AssetPopupCloseEDL::handle_event");
+ mwindow->stack_pop();
+ mwindow->gui->unlock_window();
+ gui->lock_window("AssetPopupCloseEDL::handle_event");
+ return 1;
+}
+
+
+AssetPopupToClip::AssetPopupToClip(MWindow *mwindow, AssetPopup *popup)
+ : BC_MenuItem(_("EDL to clip"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+AssetPopupToClip::~AssetPopupToClip()
+{
+}
+
+int AssetPopupToClip::handle_event()
+{
+ mwindow->media_to_clip();
+ return 1;
+}
+
+