Compare commits

...

3 Commits

Author SHA1 Message Date
Ben Loftis 24ed994d02 redirect box: add a Reset action to the Presets submenu 2022-12-16 15:36:27 -06:00
Ben Loftis 483047635c Rec page: implement Undo actions and shortcuts
* undo is not (currently) a Global action, it's an Editor action
* ... but we want the ability to undo a recording

One option would be to chagne Undo to a Global action, which would have a
 sizable impact on code and existing shortcuts.

Instead I'm choosing to implement a Rec-page-specific Undo action & shortcut

It's conceivable that someday we would want the Recorder page to ONLY undo
 record operations, and the Mixer page to ONLY undo mixer operations, or
 something like that.  This lays the foundation for that.
2022-12-16 13:18:37 -06:00
Ben Loftis 10ef8535c7 Import dialog: tweak layout
* labels on the left, following conventions we use in Prefs et-al
* separate colums for Global, MIDI, Audio  settings
2022-12-16 13:18:37 -06:00
6 changed files with 92 additions and 38 deletions

View File

@ -498,5 +498,8 @@ This mode provides many different operations on both regions and control points,
@notes|Notes/invert-selection| <@PRIMARY@>i|Invert note selection
@notes|Notes/duplicate-selection| <@PRIMARY@>d|Duplicate note selection
@rec|Recorder/arm-all| <@PRIMARY@>r|record arm all tracks
@rec|Recorder/arm-none| <@PRIMARY@><@TERTIARY@>r|disable record arm of all tracks
@rec|Recorder/arm-all| <@PRIMARY@>r|record arm all tracks
@rec|Recorder/arm-none| <@PRIMARY@><@TERTIARY@>r|disable record arm of all tracks
@rec|Recorder/rec-undo| <@PRIMARY@>z|undo
@rec|Recorder/rec-redo| <@PRIMARY@><@TERTIARY@>z|redo
@rec|Recorder/alternate-rec-redo| <@PRIMARY@>y|redo

View File

@ -837,6 +837,15 @@ ProcessorEntry::plugin_preset_selected (ARDOUR::Plugin::PresetRecord preset)
}
}
void
ProcessorEntry::reset_plugin ()
{
/* compare to PlugUIBase::add_plugin_setting */
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor);
pi->reset_parameters_to_default();
}
void
ProcessorEntry::plugin_preset_add ()
{
@ -898,6 +907,8 @@ ProcessorEntry::build_presets_menu ()
if (!pset.uri.empty ()) {
items.push_back (MenuElem (_("Delete the current preset"), sigc::mem_fun (*this, &ProcessorEntry::plugin_preset_delete)));
}
items.push_back (SeparatorElem ());
items.push_back (MenuElem (_("Reset Plugin"), sigc::mem_fun (*this, &ProcessorEntry::reset_plugin)));
if (!presets.empty ()) {
items.push_back (SeparatorElem ());
}

View File

@ -263,6 +263,7 @@ private:
void plugin_preset_selected (ARDOUR::Plugin::PresetRecord);
void plugin_preset_add ();
void plugin_preset_delete ();
void reset_plugin();
class PluginInlineDisplay : public PluginDisplay {
public:

View File

@ -393,6 +393,9 @@ RecorderUI::register_actions ()
ActionManager::register_action (group, "reset-input-peak-hold", _("Reset Input Peak Hold"), sigc::mem_fun (*this, &RecorderUI::peak_reset));
ActionManager::register_action (group, "arm-all", _("Record Arm All Tracks"), sigc::mem_fun (*this, &RecorderUI::arm_all));
ActionManager::register_action (group, "arm-none", _("Disable Record Arm of All Tracks"), sigc::mem_fun (*this, &RecorderUI::arm_none));
ActionManager::register_action (group, "rec-undo", _("Undo"), sigc::mem_fun (*this, &RecorderUI::rec_undo));
ActionManager::register_action (group, "rec-redo", _("Redo"), sigc::mem_fun (*this, &RecorderUI::rec_redo));
ActionManager::register_action (group, "alternate-rec-redo", _("Redo"), sigc::mem_fun (*this, &RecorderUI::rec_redo));
}
void
@ -1347,6 +1350,22 @@ RecorderUI::arm_none ()
}
}
void
RecorderUI::rec_undo ()
{
if (_session) {
_session->undo (1);
}
}
void
RecorderUI::rec_redo ()
{
if (_session) {
_session->redo (1);
}
}
void
RecorderUI::peak_reset ()
{

View File

@ -114,6 +114,10 @@ private:
void arm_all ();
void arm_none ();
void rec_undo ();
void rec_redo ();
void peak_reset ();
void update_sensitivity ();

View File

@ -1855,7 +1855,7 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s,
Editing::ImportMode mode_hint)
: SoundFileBrowser (title, s, persistent)
, instrument_combo (InstrumentSelector::ForTrackSelector)
, copy_files_btn ( _("Copy files to session"))
, copy_files_btn ( _("Copy audio files to session"))
, smf_tempo_btn (_("Use MIDI Tempo Map"))
, smf_marker_btn (_("Import MIDI markers"))
, selected_audio_track_cnt (selected_audio_tracks)
@ -1867,6 +1867,10 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s,
set_size_request (-1, 550);
options.set_row_spacings(8);
options.set_col_spacings(0);
options.set_border_width(6);
str.clear ();
str.push_back (_("file timestamp"));
str.push_back (_("edit point"));
@ -1880,50 +1884,62 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s,
instrument_combo.signal_changed().connect(sigc::mem_fun(*this, &SoundFileOmega::instrument_combo_changed) );
Label* l = manage (new Label);
l->set_markup (_("<b>Add files ...</b>"));
options.attach (*l, 0, 1, 0, 1, FILL, SHRINK, 8, 0);
options.attach (action_combo, 0, 1, 1, 2, FILL, SHRINK, 8, 0);
l->set_markup (_("<b>Add files:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 0, 1, 0, 1, FILL, SHRINK, 4, 0);
options.attach (action_combo, 1, 2, 0, 1, FILL, SHRINK, 2, 0);
l = manage (new Label);
l->set_markup (_("<b>Insert at</b>"));
options.attach (*l, 0, 1, 2, 3, FILL, SHRINK, 8, 0);
options.attach (where_combo, 0, 1, 3, 4, FILL, SHRINK, 8, 0);
l->set_markup (_("<b>Insert at:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 0, 1, 1, 2, FILL, SHRINK, 4, 0);
options.attach (where_combo, 1, 2, 1, 2, FILL, SHRINK, 2, 0);
l = manage (new Label);
l->set_markup (_("<b>Mapping</b>"));
options.attach (*l, 0, 1, 4, 5, FILL, SHRINK, 8, 0);
options.attach (channel_combo, 0, 1, 5, 6, FILL, SHRINK, 8, 0);
/* 2nd col */
l = manage (new Label);
l->set_markup (_("<b>Sort order</b>"));
options.attach (*l, 1, 2, 0, 1, FILL, SHRINK, 8, 0);
options.attach (sort_combo, 1, 2, 1, 2, FILL, SHRINK, 8, 0);
l->set_markup (_("<b>Mapping:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 0, 1, 2, 3, FILL, SHRINK, 4, 0);
options.attach (channel_combo, 1, 2, 2, 3, FILL, SHRINK, 2, 0);
l = manage (new Label);
l->set_markup (_("<b>Conversion quality</b>"));
options.attach (*l, 1, 2, 2, 3, FILL, SHRINK, 8, 0);
options.attach (src_combo, 1, 2, 3, 4, FILL, SHRINK, 8, 0);
l->set_markup (_("<b>Sort order:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 0, 1, 3, 4, FILL, SHRINK, 4, 0);
options.attach (sort_combo, 1, 2, 3, 4, FILL, SHRINK, 2, 0);
options.attach (copy_files_btn, 1, 2, 5, 6, FILL, SHRINK, 8, 0);
/* 3rd, 4th col: MIDI */
l = manage (new Label);
l->set_markup (_("<b>Instrument</b>"));
options.attach (*l, 2, 4, 0, 1, FILL, SHRINK, 8, 0);
options.attach (instrument_combo, 2, 4, 1, 2, FILL, SHRINK, 8, 0);
l = manage (new Label);
l->set_markup (_("<b>MIDI Track Names</b>"));
options.attach (*l, 2, 4, 2, 3, FILL, SHRINK, 8, 0);
options.attach (midi_track_name_combo, 2, 4, 3, 4, FILL, SHRINK, 8, 0);
options.attach (smf_tempo_btn, 2, 3, 5, 6, FILL, SHRINK, 8, 0);
options.attach (smf_marker_btn, 3, 4, 5, 6, FILL, SHRINK, 8, 0);
/* 2nd col: MIDI */
Alignment *vspace = manage (new Alignment ());
vspace->set_size_request (2, 2);
options.attach (*vspace, 0, 4, 6, 7, EXPAND, SHRINK, 0, 0);
vspace->set_size_request (16, 2);
options.attach (*vspace, 2, 3, 6, 7, SHRINK, SHRINK, 0, 0);
l = manage (new Label);
l->set_markup (_("<b>MIDI Instrument:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 3, 4, 0, 1, FILL, SHRINK, 4, 0);
options.attach (instrument_combo, 4, 5, 0, 1, FILL, SHRINK, 2, 0);
l = manage (new Label);
l->set_markup (_("<b>MIDI Track Names:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 3, 4, 1, 2, FILL, SHRINK, 4, 0);
options.attach (midi_track_name_combo, 4, 5, 1, 2, FILL, SHRINK, 2, 0);
options.attach (smf_tempo_btn, 4, 5, 2, 3, FILL, SHRINK, 2, 0);
options.attach (smf_marker_btn, 4, 5, 3, 4, FILL, SHRINK, 2, 0);
/* 3nd col (Audio-only) */
vspace = manage (new Alignment ());
vspace->set_size_request (16, 2);
options.attach (*vspace, 5, 6, 6, 7, SHRINK, SHRINK, 0, 0);
l = manage (new Label);
l->set_markup (_("<b>Audio conversion quality:</b>"));
l->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER);
options.attach (*l, 6, 7, 0, 1, FILL, SHRINK, 4, 0);
options.attach (src_combo, 7, 8, 0, 1, FILL, SHRINK, 2, 0);
options.attach (copy_files_btn, 7, 8, 1, 2, FILL, SHRINK, 2, 0);
str.clear ();
str.push_back (_("by track number"));