+ZWindow *MWindow::create_mixer(Indexable *indexable)
+{
+ ArrayList<Indexable*> new_assets;
+ new_assets.append(indexable);
+ Track *track = edl->tracks->last;
+ load_assets(&new_assets, 0, LOADMODE_NEW_TRACKS, 0, 0, 0, 0, 0, 0);
+ track = !track ? edl->tracks->first : track->next;
+ Mixer *mixer = 0;
+ ZWindow *zwindow = 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;
+ }
+ if( indexable->is_asset ) {
+ char *path = indexable->path;
+ char *tp = strrchr(path, '/');
+ if( !tp ) tp = path; else ++tp;
+ zwindow->set_title(tp);
+ }
+ else {
+ char *title = ((EDL*)indexable)->local_session->clip_title;
+ zwindow->set_title(title);
+ }
+ return zwindow;
+}
+
+void MWindow::create_mixers()
+{
+ if( !session->drag_assets->size() &&
+ !session->drag_clips->size() ) return;
+ undo->update_undo_before();
+
+ select_zwindow(0);
+ ArrayList<ZWindow *>new_mixers;
+
+ for( int i=0; i<session->drag_assets->size(); ++i ) {
+ Indexable *indexable = session->drag_assets->get(i);
+ ZWindow *zwindow = create_mixer(indexable);
+ new_mixers.append(zwindow);
+ }
+ for( int i=0; i<session->drag_clips->size(); ++i ) {
+ Indexable *indexable = (Indexable*)session->drag_clips->get(i);
+ ZWindow *zwindow = create_mixer(indexable);
+ new_mixers.append(zwindow);
+ }
+
+ tile_mixers();
+ for( int i=0; i<new_mixers.size(); ++i )
+ new_mixers[i]->start();
+
+ refresh_mixers();
+ save_backup();
+ undo->update_undo_after(_("create mixers"), LOAD_ALL);
+ restart_brender();
+ gui->update(1, 2, 1, 1, 1, 1, 0);
+ sync_parameters(CHANGE_ALL);
+}
+