#include "canvas/canvas.h"
#include "actions.h"
-#include "ardour_ui.h"
#include "audio_region_view.h"
#include "audio_streamview.h"
#include "audio_time_axis.h"
#include "time_axis_view.h"
#include "transpose_dialog.h"
#include "transform_dialog.h"
+#include "ui_config.h"
#include "i18n.h"
bool
Editor::choose_new_marker_name(string &name) {
- if (!ARDOUR_UI::config()->get_name_new_markers()) {
+ if (!UIConfiguration::instance().get_name_new_markers()) {
/* don't prompt user for a new name */
return true;
}
void
Editor::maybe_locate_with_edit_preroll ( framepos_t location )
{
- if ( _session->transport_rolling() || !ARDOUR_UI::config()->get_follow_edits() || _ignore_follow_edits )
+ if ( _session->transport_rolling() || !UIConfiguration::instance().get_follow_edits() || _ignore_follow_edits )
return;
location -= get_preroll();
framepos_t const start_frame = regions.start ();
framepos_t const end_frame = regions.end_frame ();
+ framecnt_t const gap = end_frame - start_frame;
begin_reversible_command (Operations::duplicate_region);
latest_regionviews.clear ();
sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view));
+ framepos_t const position = end_frame + (r->first_frame() - start_frame);
playlist = (*i)->region()->playlist();
playlist->clear_changes ();
- playlist->duplicate (r, end_frame + (r->first_frame() - start_frame), times);
+ playlist->duplicate (r, position, gap, times);
_session->add_command(new StatefulDiffCommand (playlist));
c.disconnect ();
}
}
+ assert (!audio_only.empty());
+
StripSilenceDialog d (_session, audio_only);
int const r = d.run ();
_session->add_commands (cmds);
_session->add_command(new StatefulDiffCommand (playlist));
-
- } else {
- continue;
}
if (progress) {
}
}
- if (ARDOUR_UI::config()->get_follow_edits()) {
+ if (UIConfiguration::instance().get_follow_edits()) {
cancel_time_selection();
}
}
set_punch_range (start, end, _("set punch range from selection"));
}
+void
+Editor::set_punch_from_loop ()
+{
+ if (_session == 0) {
+ return;
+ }
+
+ Location* tll;
+
+ if ((tll = transport_loop_location()) == 0) {
+ return;
+ }
+
+ set_punch_range (tll->start(), tll->end(), _("set punch range from loop"));
+}
+
+void
+Editor::setup_loop_record ()
+{
+ if (_session == 0) {
+ return;
+ }
+
+ Location * looploc = _session->locations()->auto_loop_location();
+
+ if (!looploc) {
+ return;
+ }
+
+ set_punch_range (looploc->start(), looploc->end(), _("setup loop recording"));
+
+ Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
+
+ if (action) {
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
+
+ if (!tact) {
+ return;
+ }
+
+ /* drive the other two actions from this one */
+
+ Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
+ Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
+
+ if (in_action && out_action) {
+ Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
+ Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
+ tiact->set_active (true);
+ toact->set_active (true);
+ }
+ }
+}
void
Editor::set_session_extents_from_selection ()
{
delete _main_menu_disabler;
- if (ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
+ if (UIConfiguration::instance().get_lock_gui_after_seconds()) {
start_lock_event_timing ();
}
}