Add ImportAsTrigger mode
This is like ImportAsTrack, except the imported region is not added to the timeline, but the first trigger slot.
This commit is contained in:
parent
3c2878974c
commit
e0c07e2306
@ -86,6 +86,7 @@ DISPLAYCONTROL(ShowWaveformsRecording)
|
||||
IMPORTMODE(ImportAsRegion)
|
||||
IMPORTMODE(ImportToTrack)
|
||||
IMPORTMODE(ImportAsTrack)
|
||||
IMPORTMODE(ImportAsTrigger)
|
||||
|
||||
// if this is changed, remember to update the string table in sfdb_ui.cc
|
||||
IMPORTPOSITION(ImportAtTimestamp)
|
||||
|
@ -1085,6 +1085,8 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region,
|
||||
break;
|
||||
}
|
||||
|
||||
case ImportAsTrigger:
|
||||
/* fallthrough */
|
||||
case ImportAsTrack:
|
||||
{
|
||||
if (!existing_track) {
|
||||
@ -1137,11 +1139,17 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region,
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == ImportAsTrigger) {
|
||||
boost::shared_ptr<Region> copy (RegionFactory::create (region, true));
|
||||
/* TODO handle ImportSerializeFiles, pos > 0, use next free trigger-slot */
|
||||
existing_track->triggerbox ()->set_from_selection (0, copy);
|
||||
} else {
|
||||
boost::shared_ptr<Playlist> playlist = existing_track->playlist();
|
||||
boost::shared_ptr<Region> copy (RegionFactory::create (region, true));
|
||||
playlist->clear_changes ();
|
||||
playlist->add_region (copy, pos);
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,7 @@ setup_gtk_ardour_enums ()
|
||||
REGISTER_ENUM (ImportAsTrack);
|
||||
REGISTER_ENUM (ImportToTrack);
|
||||
REGISTER_ENUM (ImportAsRegion);
|
||||
REGISTER_ENUM (ImportAsTrigger);
|
||||
REGISTER (import_mode);
|
||||
|
||||
REGISTER_ENUM (EditAtPlayhead);
|
||||
|
@ -142,6 +142,9 @@ importmode2string (ImportMode mode)
|
||||
return _("to selected tracks");
|
||||
case ImportAsRegion:
|
||||
return _("to source list");
|
||||
case ImportAsTrigger:
|
||||
/* TODO: n/a */
|
||||
break;
|
||||
}
|
||||
abort(); /*NOTREACHED*/
|
||||
return _("as new tracks");
|
||||
|
Loading…
Reference in New Issue
Block a user