toggle_reg_sens (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), sigc::mem_fun (*this, &Editor::editor_mixer_button_toggled));
toggle_reg_sens (editor_actions, "show-editor-list", _("Show Editor List"), sigc::mem_fun (*this, &Editor::editor_list_button_toggled));
- reg_sens (editor_actions, "playhead-to-next-region-boundary", _("Playhead to Next Region Boundary"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_next_region_boundary), true ));
- reg_sens (editor_actions, "playhead-to-next-region-boundary-noselection", _("Playhead to Next Region Boundary (No Track Selection)"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_next_region_boundary), false ));
+ reg_sens (editor_actions, "playhead-to-next-region-boundary", _("Playhead to Next Region Boundary"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_next_region_boundary), true));
+ reg_sens (editor_actions, "playhead-to-next-region-boundary-noselection", _("Playhead to Next Region Boundary (No Track Selection)"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_next_region_boundary), false));
reg_sens (editor_actions, "playhead-to-previous-region-boundary", _("Playhead to Previous Region Boundary"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_previous_region_boundary), true));
reg_sens (editor_actions, "playhead-to-previous-region-boundary-noselection", _("Playhead to Previous Region Boundary (No Track Selection)"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_previous_region_boundary), false));
}
void
-Editor::trigger_script_by_name ( const std::string script_name )
+Editor::trigger_script_by_name (const std::string script_name)
{
string script_path;
ARDOUR::LuaScriptList scr = LuaScripting::instance ().scripts(LuaScriptInfo::EditorAction);
for (ARDOUR::LuaScriptList::const_iterator s = scr.begin(); s != scr.end(); ++s) {
- if ( (*s)->name == script_name ) {
+ if ((*s)->name == script_name) {
script_path = (*s)->path;
if (!Glib::file_test (script_path, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
if (rsas & Existing) {
// region selections that existed before the split.
- selection->add ( pre_selected_regions );
+ selection->add (pre_selected_regions);
}
for (RegionSelection::iterator ri = latest_regionviews.begin(); ri != latest_regionviews.end(); ri++) {
//zoom-behavior-tweaks
//limit our maximum zoom to the session gui extents value
std::pair<samplepos_t, samplepos_t> ext = session_gui_extents();
- samplecnt_t session_extents_pp = ( ext.second - ext.first ) / _visible_canvas_width;
+ samplecnt_t session_extents_pp = (ext.second - ext.first) / _visible_canvas_width;
if (nspp > session_extents_pp)
nspp = session_extents_pp;
//ToDo: if control points are selected, set extents to that selection
- if ( !selection->regions.empty() ) {
+ if (!selection->regions.empty()) {
RegionSelection rs = get_regions_from_selection_and_entered ();
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
samplecnt_t start = _session->current_start_sample();
samplecnt_t end = _session->current_end_sample();
- if (_session->actively_recording () ) {
+ if (_session->actively_recording ()) {
samplepos_t cur = playhead_cursor->current_sample ();
if (cur > end) {
/* recording beyond the end marker; zoom out
ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_extents)
if (_session) {
- std::pair<samplepos_t, samplepos_t> ext = session_gui_extents( false ); //in this case we want to zoom to the extents explicitly; ignore the users prefs for extra padding
+ std::pair<samplepos_t, samplepos_t> ext = session_gui_extents (false); //in this case we want to zoom to the extents explicitly; ignore the users prefs for extra padding
samplecnt_t start = ext.first;
samplecnt_t end = ext.second;
- if (_session->actively_recording () ) {
+ if (_session->actively_recording ()) {
samplepos_t cur = playhead_cursor->current_sample ();
if (cur > end) {
/* recording beyond the end marker; zoom out
Location* loc;
if ((loc = _session->locations()->session_range_location()) == 0) { //should never happen
- _session->set_session_extents ( _session->audible_sample(), _session->audible_sample() );
+ _session->set_session_extents (_session->audible_sample(), _session->audible_sample());
} else {
XMLNode &before = loc->get_state();
- _session->set_session_extents ( _session->audible_sample(), loc->end() );
+ _session->set_session_extents (_session->audible_sample(), loc->end());
XMLNode &after = loc->get_state();
Location* loc;
if ((loc = _session->locations()->session_range_location()) == 0) { //should never happen
- _session->set_session_extents ( _session->audible_sample(), _session->audible_sample() );
+ _session->set_session_extents (_session->audible_sample(), _session->audible_sample());
} else {
XMLNode &before = loc->get_state();
- _session->set_session_extents ( loc->start(), _session->audible_sample() );
+ _session->set_session_extents (loc->start(), _session->audible_sample());
XMLNode &after = loc->get_state();
samplepos_t pos = _session->locations()->first_mark_before (playhead_cursor->current_sample());
//handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark...
- if ( _session->transport_rolling() ) {
- if ( (playhead_cursor->current_sample() - pos) < _session->sample_rate()/2 ) {
- samplepos_t prior = _session->locations()->first_mark_before ( pos );
+ if (_session->transport_rolling()) {
+ if ((playhead_cursor->current_sample() - pos) < _session->sample_rate()/2) {
+ samplepos_t prior = _session->locations()->first_mark_before (pos);
pos = prior;
}
}
samplepos_t start_sample;
samplepos_t return_sample;
- start_sample = get_preferred_edit_position ( EDIT_IGNORE_PHEAD );
+ start_sample = get_preferred_edit_position (EDIT_IGNORE_PHEAD);
if (_session->transport_rolling()) {
_session->request_locate (start_sample, false);
Editor::play_selection ()
{
samplepos_t start, end;
- if (!get_selection_extents ( start, end))
+ if (!get_selection_extents (start, end))
return;
AudioRange ar (start, end, 0);
void
Editor::maybe_locate_with_edit_preroll (samplepos_t location)
{
- if ( _session->transport_rolling() || !UIConfiguration::instance().get_follow_edits() || _session->config.get_external_sync() )
+ if (_session->transport_rolling() || !UIConfiguration::instance().get_follow_edits() || _session->config.get_external_sync())
return;
location -= _session->preroll_samples (location);
}
//if follow_playhead is on, keep the playhead on the screen
- if ( _follow_playhead )
- if ( location < _leftmost_sample )
+ if (_follow_playhead)
+ if (location < _leftmost_sample)
location = _leftmost_sample;
- _session->request_locate( location );
+ _session->request_locate (location);
}
void
Editor::play_with_preroll ()
{
samplepos_t start, end;
- if ( UIConfiguration::instance().get_follow_edits() && get_selection_extents ( start, end) ) {
+ if (UIConfiguration::instance().get_follow_edits() && get_selection_extents (start, end)) {
const samplepos_t preroll = _session->preroll_samples (start);
samplepos_t ret = start;
playlist->partition ((*rl)->first_sample() - 1, (*rl)->last_sample() + 1, true);
//Re-add region that was just removed due to the partition operation
- playlist->add_region( (*rl), (*rl)->first_sample() );
+ playlist->add_region ((*rl), (*rl)->first_sample());
}
vector<PlaylistState>::iterator pl;
//special case: if the user is pointing in the editor/mixer strip, they may be trying to delete a plugin.
//we need this because the editor-mixer strip is in the editor window, so it doesn't get the bindings from the mix window
bool deleted = false;
- if ( current_mixer_strip && current_mixer_strip == MixerStrip::entered_mixer_strip() )
+ if (current_mixer_strip && current_mixer_strip == MixerStrip::entered_mixer_strip())
deleted = current_mixer_strip->delete_processors ();
if (!deleted)
}
}
- if ( op != Delete ) { //"Delete" doesn't change copy/paste buf
+ if (op != Delete) { //"Delete" doesn't change copy/paste buf
cut_buffer->clear ();
}
}
//if a range is selected, separate it
- if ( !selection->time.empty()) {
+ if (!selection->time.empty()) {
separate_regions_between (selection->time);
return;
}
}
samplepos_t start, end;
- if (!get_selection_extents ( start, end))
+ if (!get_selection_extents (start, end))
return;
set_loop_range (start, end, _("set loop range from selection"));
Editor::set_loop_from_region (bool play)
{
samplepos_t start, end;
- if (!get_selection_extents ( start, end))
+ if (!get_selection_extents (start, end))
return;
set_loop_range (start, end, _("set loop range from region"));
}
samplepos_t start, end;
- if (!get_selection_extents ( start, end))
+ if (!get_selection_extents (start, end))
return;
set_punch_range (start, end, _("set punch range from selection"));
}
samplepos_t start, end;
- if (!get_selection_extents ( start, end))
+ if (!get_selection_extents (start, end))
return;
Location* loc;
Editor::set_punch_from_region ()
{
samplepos_t start, end;
- if (!get_selection_extents ( start, end))
+ if (!get_selection_extents (start, end))
return;
set_punch_range (start, end, _("set punch range from region"));
}
(*r)->region()->clear_changes ();
- (*r)->region()->trim_front( (position - pull_back_samples));
+ (*r)->region()->trim_front((position - pull_back_samples));
last_region->clear_changes ();
- last_region->trim_end( (position - pull_back_samples + crossfade_len));
+ last_region->trim_end ((position - pull_back_samples + crossfade_len));
_session->add_command (new StatefulDiffCommand ((*r)->region()));
_session->add_command (new StatefulDiffCommand (last_region));
}
}
- } else if ((*i)->start() >= pos && (*i)->start() < pos+samples ) {
+ } else if ((*i)->start() >= pos && (*i)->start() < pos+samples) {
loc_kill_list.push_back(*i);
moved = true;
} else if ((*i)->start() >= pos) {
}
for (list<Location*>::iterator i = loc_kill_list.begin(); i != loc_kill_list.end(); ++i) {
- _session->locations()->remove( *i );
+ _session->locations()->remove (*i);
}
if (moved) {
if (tempo_too) {
XMLNode& before (_session->tempo_map().get_state());
- if (_session->tempo_map().remove_time (pos, samples) ) {
+ if (_session->tempo_map().remove_time (pos, samples)) {
if (!in_command) {
begin_reversible_command (_("remove time"));
in_command = true;