#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();
}
}
void
Editor::split_region ()
{
+ if (_drags->active ()) {
+ return;
+ }
+
//if a range is selected, separate it
if ( !selection->time.empty()) {
separate_regions_between (selection->time);
{
if (_session) {
- framepos_t start;
- framepos_t end;
+ framepos_t start = 0;
+ framepos_t end = max_framepos;
- //use the existing loop end, if any
+ //use the existing punch end, if any
Location* tpl = transport_punch_location();
- if (tpl)
+ if (tpl) {
end = tpl->end();
-
+ }
+
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
start = _session->audible_frame();
} else {
void
Editor::set_punch_end_from_edit_point ()
{
-printf("set punch end\n");
if (_session) {
- framepos_t start;
- framepos_t end;
+ framepos_t start = 0;
+ framepos_t end = max_framepos;
- //use the existing loop end, if any
+ //use the existing punch start, if any
Location* tpl = transport_punch_location();
- if (tpl)
+ if (tpl) {
start = tpl->start();
+ }
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
end = _session->audible_frame();
//snap the selection start/end
snap_to(end);
-printf("set punch %d, %d\n", start, end);
set_punch_range (start, end, _("set punch end from EP"));
}
void
Editor::set_loop_start_from_edit_point ()
{
-printf("set loop start\n");
if (_session) {
- framepos_t start;
- framepos_t end;
+ framepos_t start = 0;
+ framepos_t end = max_framepos;
//use the existing loop end, if any
Location* tpl = transport_loop_location();
- if (tpl)
+ if (tpl) {
end = tpl->end();
-
+ }
+
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
start = _session->audible_frame();
} else {
if ( start > end ) {
end = max_framepos;
}
-
-printf("set loop %d, %d\n", start, end);
+
set_loop_range (start, end, _("set loop start from EP"));
}
{
if (_session) {
- framepos_t start;
- framepos_t end;
+ framepos_t start = 0;
+ framepos_t end = max_framepos;
- //use the existing loop end, if any
+ //use the existing loop start, if any
Location* tpl = transport_loop_location();
- if (tpl)
+ if (tpl) {
start = tpl->start();
+ }
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
end = _session->audible_frame();
snap_to(end);
set_loop_range (start, end, _("set loop end from EP"));
-
}
}
if (all_playlists) {
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*x);
- if (rtav) {
+ if (rtav && rtav->track ()) {
vector<boost::shared_ptr<Playlist> > all = _session->playlists->playlists_for_track (rtav->track ());
for (vector<boost::shared_ptr<Playlist> >::iterator p = all.begin(); p != all.end(); ++p) {
pl.insert (*p);
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 ();
}
}