#include "editor_snapshots.h"
#include "editor_summary.h"
#include "region_layering_order_editor.h"
+#include "mouse_cursors.h"
+#include "editor_cursors.h"
#include "i18n.h"
const double Editor::timebar_height = 15.0;
-#include "editor_xpms"
-
static const gchar *_snap_type_strings[] = {
N_("CD Frames"),
N_("Timecode Frames"),
};
#endif
-/* Soundfile drag-n-drop */
-
-Gdk::Cursor* Editor::cross_hair_cursor = 0;
-Gdk::Cursor* Editor::selector_cursor = 0;
-Gdk::Cursor* Editor::trimmer_cursor = 0;
-Gdk::Cursor* Editor::left_side_trim_cursor = 0;
-Gdk::Cursor* Editor::right_side_trim_cursor = 0;
-Gdk::Cursor* Editor::fade_in_cursor = 0;
-Gdk::Cursor* Editor::fade_out_cursor = 0;
-Gdk::Cursor* Editor::grabber_cursor = 0;
-Gdk::Cursor* Editor::grabber_note_cursor = 0;
-Gdk::Cursor* Editor::grabber_edit_point_cursor = 0;
-Gdk::Cursor* Editor::zoom_in_cursor = 0;
-Gdk::Cursor* Editor::zoom_out_cursor = 0;
-Gdk::Cursor* Editor::time_fx_cursor = 0;
-Gdk::Cursor* Editor::fader_cursor = 0;
-Gdk::Cursor* Editor::speaker_cursor = 0;
-Gdk::Cursor* Editor::midi_pencil_cursor = 0;
-Gdk::Cursor* Editor::midi_select_cursor = 0;
-Gdk::Cursor* Editor::midi_resize_cursor = 0;
-Gdk::Cursor* Editor::midi_erase_cursor = 0;
-Gdk::Cursor* Editor::wait_cursor = 0;
-Gdk::Cursor* Editor::timebar_cursor = 0;
-Gdk::Cursor* Editor::transparent_cursor = 0;
-Gdk::Cursor* Editor::up_down_cursor = 0;
-
void
show_me_the_size (Requisition* r, const char* what)
{
static void
pane_size_watcher (Paned* pane)
{
- /* if the handle of a pane vanishes into (at least) the tabs of a notebook,
- it is no longer accessible. so stop that. this doesn't happen on X11,
- just the quartz backend.
+ /* if the handle of a pane vanishes into (at least) the tabs of a notebook,
+ it is no longer accessible. so stop that. this doesn't happen on X11,
+ just the quartz backend.
- ugh.
- */
+ ugh.
+ */
- int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 25;
+ int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 25;
- gint pos = pane->get_position ();
+ gint pos = pane->get_position ();
- if (pos > max_width_of_lhs) {
- pane->set_position (max_width_of_lhs);
- }
+ if (pos > max_width_of_lhs) {
+ pane->set_position (max_width_of_lhs);
+ }
}
#endif
_dragging_edit_point = false;
select_new_marker = false;
rhythm_ferret = 0;
- layering_order_editor = 0;
+ layering_order_editor = 0;
_bundle_manager = 0;
no_save_visual = false;
resize_idle_id = -1;
controls_layout.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::edit_controls_button_release));
controls_layout_size_request_connection = controls_layout.signal_size_request().connect (sigc::mem_fun (*this, &Editor::controls_layout_size_request));
- build_cursors ();
+ _cursors = new MouseCursors;
ArdourCanvas::Canvas* time_pad = manage(new ArdourCanvas::Canvas());
ArdourCanvas::SimpleLine* pad_line_1 = manage(new ArdourCanvas::SimpleLine(*time_pad->root(),
edit_pane.signal_size_allocate().connect (sigc::bind (sigc::mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&edit_pane)));
#ifdef GTKOSX
- Glib::PropertyProxy<int> proxy = edit_pane.property_position();
- proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
+ Glib::PropertyProxy<int> proxy = edit_pane.property_position();
+ proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
#endif
top_hbox.pack_start (toolbar_frame, false, true);
_popup_region_menu_item = 0;
_show_marker_lines = false;
+ _over_region_trim_target = false;
constructed = true;
instant_save ();
but use Gtkmm2ext::UI::instance()->call_slot();
*/
- _session->StepEditStatusChange.connect (_session_connections, invalidator (*this), ui_bind(&Editor::step_edit_status_change, this, _1), gui_context());
+ _session->StepEditStatusChange.connect (_session_connections, invalidator (*this), ui_bind(&Editor::step_edit_status_change, this, _1), gui_context());
_session->TransportStateChange.connect (_session_connections, invalidator (*this), boost::bind (&Editor::map_transport_state, this), gui_context());
_session->PositionChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::map_position_change, this, _1), gui_context());
_session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&Editor::handle_new_route, this, _1), gui_context());
_session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_title, this), gui_context());
- _session->TimecodeOffsetChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_just_timecode, this), gui_context());
_session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::tempo_map_changed, this, _1), gui_context());
_session->Located.connect (_session_connections, invalidator (*this), boost::bind (&Editor::located, this), gui_context());
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::parameter_changed, this, _1), gui_context());
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
if (Profile->get_sae()) {
- BBT_Time bbt;
+ Timecode::BBT_Time bbt;
bbt.bars = 0;
bbt.beats = 0;
bbt.ticks = 120;
- nframes_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1);
+ framepos_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1);
nudge_clock.set_mode(AudioClock::BBT);
nudge_clock.set (pos, true, 0, AudioClock::BBT);
}
}
-void
-Editor::build_cursors ()
-{
- using namespace Gdk;
-
- {
- Glib::RefPtr<Gdk::Pixbuf> zoom_in_cursor_pixbuf (::get_icon ("zoom_in_cursor"));
- zoom_in_cursor = new Gdk::Cursor (Gdk::Display::get_default(), zoom_in_cursor_pixbuf, 5, 5);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> zoom_out_cursor_pixbuf (::get_icon ("zoom_out_cursor"));
- zoom_out_cursor = new Gdk::Cursor (Gdk::Display::get_default(), zoom_out_cursor_pixbuf, 5, 5);
- }
-
- Gdk::Color fbg ("#ffffff" );
- Gdk::Color ffg ("#000000" );
-
- {
- RefPtr<Bitmap> source, mask;
-
- source = Bitmap::create (fader_cursor_bits, fader_cursor_width, fader_cursor_height);
- mask = Bitmap::create (fader_cursor_mask_bits, fader_cursor_width, fader_cursor_height);
- fader_cursor = new Gdk::Cursor (source, mask, ffg, fbg, fader_cursor_x_hot, fader_cursor_y_hot);
- }
-
- {
- RefPtr<Bitmap> source, mask;
- source = Bitmap::create (speaker_cursor_bits, speaker_cursor_width, speaker_cursor_height);
- mask = Bitmap::create (speaker_cursor_mask_bits, speaker_cursor_width, speaker_cursor_height);
- speaker_cursor = new Gdk::Cursor (source, mask, ffg, fbg, speaker_cursor_x_hot, speaker_cursor_y_hot);
- }
-
- {
- RefPtr<Bitmap> bits;
- char pix[4] = { 0, 0, 0, 0 };
- bits = Bitmap::create (pix, 2, 2);
- Gdk::Color c;
- transparent_cursor = new Gdk::Cursor (bits, bits, c, c, 0, 0);
- }
-
- {
- RefPtr<Bitmap> bits;
- char pix[4] = { 0, 0, 0, 0 };
- bits = Bitmap::create (pix, 2, 2);
- Gdk::Color c;
- transparent_cursor = new Gdk::Cursor (bits, bits, c, c, 0, 0);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> grabber_pixbuf (::get_icon ("grabber"));
- grabber_cursor = new Gdk::Cursor (Gdk::Display::get_default(), grabber_pixbuf, 5, 0);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> grabber_note_pixbuf (::get_icon ("grabber_note"));
- grabber_note_cursor = new Gdk::Cursor (Gdk::Display::get_default(), grabber_note_pixbuf, 5, 10);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> grabber_edit_point_pixbuf (::get_icon ("grabber_edit_point"));
- grabber_edit_point_cursor = new Gdk::Cursor (Gdk::Display::get_default(), grabber_edit_point_pixbuf, 5, 17);
- }
-
- cross_hair_cursor = new Gdk::Cursor (CROSSHAIR);
- trimmer_cursor = new Gdk::Cursor (SB_H_DOUBLE_ARROW);
-
- {
- Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("trim_left_cursor"));
- left_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 5, 11);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("trim_right_cursor"));
- right_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 23, 11);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("fade_in_cursor"));
- fade_in_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 0, 40);
- }
-
- {
- Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("fade_out_cursor"));
- fade_out_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 27, 40);
- }
-
- selector_cursor = new Gdk::Cursor (XTERM);
- time_fx_cursor = new Gdk::Cursor (SIZING);
- wait_cursor = new Gdk::Cursor (WATCH);
- timebar_cursor = new Gdk::Cursor(LEFT_PTR);
- midi_pencil_cursor = new Gdk::Cursor (PENCIL);
- midi_select_cursor = new Gdk::Cursor (CENTER_PTR);
- midi_resize_cursor = new Gdk::Cursor (SIZING);
- midi_erase_cursor = new Gdk::Cursor (DRAPED_BOX);
- up_down_cursor = new Gdk::Cursor (Gdk::SB_V_DOUBLE_ARROW);
-}
-
/** Pop up a context menu for when the user clicks on a fade in or fade out */
void
Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
}
void
-Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, bool with_selection, framepos_t frame)
+Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, bool with_selection)
{
using namespace Menu_Helpers;
- Menu* (Editor::*build_menu_function)(framepos_t);
+ Menu* (Editor::*build_menu_function)();
Menu *menu;
switch (item_type) {
return;
}
- menu = (this->*build_menu_function)(frame);
+ menu = (this->*build_menu_function)();
menu->set_name ("ArdourContextMenu");
/* now handle specific situations */
case RegionItem:
case RegionViewName:
case RegionViewNameHighlight:
- case LeftFrameHandle:
- case RightFrameHandle:
+ case LeftFrameHandle:
+ case RightFrameHandle:
if (!with_selection) {
if (region_edit_menu_split_item) {
if (clicked_regionview && clicked_regionview->region()->covers (get_preferred_edit_position())) {
}
Menu*
-Editor::build_track_context_menu (framepos_t)
+Editor::build_track_context_menu ()
{
using namespace Menu_Helpers;
}
Menu*
-Editor::build_track_bus_context_menu (framepos_t)
+Editor::build_track_bus_context_menu ()
{
using namespace Menu_Helpers;
}
Menu*
-Editor::build_track_region_context_menu (framepos_t frame)
+Editor::build_track_region_context_menu ()
{
using namespace Menu_Helpers;
MenuList& edit_items = track_region_context_menu.items();
mode and so offering region context is somewhat confusing.
*/
if ((tr = rtv->track()) && ((pl = tr->playlist())) && !internal_editing()) {
- framepos_t framepos = (framepos_t) floor ((double)frame * tr->speed());
- uint32_t regions_at = pl->count_regions_at (framepos);
- add_region_context_items (edit_items, regions_at > 1);
+ framepos_t const framepos = (framepos_t) floor ((double) get_preferred_edit_position() * tr->speed());
+ uint32_t regions_at = pl->count_regions_at (framepos);
+ add_region_context_items (edit_items, regions_at > 1);
}
}
}
Menu*
-Editor::build_track_crossfade_context_menu (framepos_t frame)
+Editor::build_track_crossfade_context_menu ()
{
using namespace Menu_Helpers;
MenuList& edit_items = track_crossfade_context_menu.items();
AudioPlaylist::Crossfades xfades;
- apl->crossfades_at (frame, xfades);
+ apl->crossfades_at (get_preferred_edit_position (), xfades);
bool many = xfades.size() > 1;
add_crossfade_context_items (atv->audio_view(), (*i), edit_items, many);
}
- framepos_t framepos = (framepos_t) floor ((double)frame * tr->speed());
+ framepos_t framepos = (framepos_t) floor ((double) get_preferred_edit_position() * tr->speed());
uint32_t regions_at = pl->count_regions_at (framepos);
- add_region_context_items (edit_items, regions_at > 1);
+ add_region_context_items (edit_items, regions_at > 1);
}
}
}
Menu*
-Editor::build_track_selection_context_menu (framepos_t)
+Editor::build_track_selection_context_menu ()
{
using namespace Menu_Helpers;
MenuList& edit_items = track_selection_context_menu.items();
}
edit_items.push_back (SeparatorElem());
- edit_items.push_back (MenuElem (_("Convert to region in-place"), mem_fun(*this, &Editor::separate_region_from_selection)));
+ edit_items.push_back (MenuElem (_("Convert to Region In-Place"), mem_fun(*this, &Editor::separate_region_from_selection)));
edit_items.push_back (MenuElem (_("Convert to Region in Region List"), sigc::mem_fun(*this, &Editor::new_region_from_selection)));
edit_items.push_back (SeparatorElem());
if (_session && (prop = node.property ("playhead"))) {
framepos_t pos;
- sscanf (prop->value().c_str(), "%" PRIi64, &pos);
+ sscanf (prop->value().c_str(), "%" PRIi64, &pos);
playhead_cursor->set_position (pos);
} else {
playhead_cursor->set_position (0);
}
}
- if ((prop = node.property ("stationary-playhead"))) {
- bool yn = (prop->value() == "yes");
- set_stationary_playhead (yn);
- RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
- if (act) {
- RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
- if (tact->get_active() != yn) {
- tact->set_active (yn);
- }
- }
- }
+ if ((prop = node.property ("stationary-playhead"))) {
+ bool yn = (prop->value() == "yes");
+ set_stationary_playhead (yn);
+ RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
+ if (act) {
+ RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
+ if (tact->get_active() != yn) {
+ tact->set_active (yn);
+ }
+ }
+ }
if ((prop = node.property ("region-list-sort-type"))) {
RegionListSortType st;
node->add_property ("show-measures", _show_measures ? "yes" : "no");
node->add_property ("follow-playhead", _follow_playhead ? "yes" : "no");
- node->add_property ("stationary-playhead", _stationary_playhead ? "yes" : "no");
+ node->add_property ("stationary-playhead", _stationary_playhead ? "yes" : "no");
node->add_property ("xfades-visible", _xfade_visibility ? "yes" : "no");
node->add_property ("region-list-sort-type", enum_2_string (_regions->sort_type ()));
node->add_property ("mouse-mode", enum2str(mouse_mode));
break;
case SnapToTimecodeSeconds:
- if (_session->timecode_offset_negative())
- {
- start += _session->timecode_offset ();
+ if (_session->config.get_timecode_offset_negative()) {
+ start += _session->config.get_timecode_offset ();
} else {
- start -= _session->timecode_offset ();
+ start -= _session->config.get_timecode_offset ();
}
if (((direction == 0) && (start % one_timecode_second > one_timecode_second / 2)) || direction > 0) {
start = (framepos_t) ceil ((double) start / one_timecode_second) * one_timecode_second;
start = (framepos_t) floor ((double) start / one_timecode_second) * one_timecode_second;
}
- if (_session->timecode_offset_negative())
- {
- start -= _session->timecode_offset ();
+ if (_session->config.get_timecode_offset_negative()) {
+ start -= _session->config.get_timecode_offset ();
} else {
- start += _session->timecode_offset ();
+ start += _session->config.get_timecode_offset ();
}
break;
case SnapToTimecodeMinutes:
- if (_session->timecode_offset_negative())
- {
- start += _session->timecode_offset ();
+ if (_session->config.get_timecode_offset_negative()) {
+ start += _session->config.get_timecode_offset ();
} else {
- start -= _session->timecode_offset ();
+ start -= _session->config.get_timecode_offset ();
}
if (((direction == 0) && (start % one_timecode_minute > one_timecode_minute / 2)) || direction > 0) {
start = (framepos_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute;
} else {
start = (framepos_t) floor ((double) start / one_timecode_minute) * one_timecode_minute;
}
- if (_session->timecode_offset_negative())
- {
- start -= _session->timecode_offset ();
+ if (_session->config.get_timecode_offset_negative()) {
+ start -= _session->config.get_timecode_offset ();
} else {
- start += _session->timecode_offset ();
+ start += _session->config.get_timecode_offset ();
}
break;
default:
}
_mouse_mode_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window()));
+ &_mouse_mode_tearoff->tearoff_window()));
_mouse_mode_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window(), 1));
+ &_mouse_mode_tearoff->tearoff_window(), 1));
_mouse_mode_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window()));
+ &_mouse_mode_tearoff->tearoff_window()));
_mouse_mode_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window(), 1));
+ &_mouse_mode_tearoff->tearoff_window(), 1));
mouse_move_button.set_mode (false);
mouse_select_button.set_mode (false);
}
_tools_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_tools_tearoff->tearoff_window()));
+ &_tools_tearoff->tearoff_window()));
_tools_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_tools_tearoff->tearoff_window(), 0));
+ &_tools_tearoff->tearoff_window(), 0));
_tools_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_tools_tearoff->tearoff_window()));
+ &_tools_tearoff->tearoff_window()));
_tools_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_tools_tearoff->tearoff_window(), 0));
+ &_tools_tearoff->tearoff_window(), 0));
toolbar_hbox.set_spacing (10);
toolbar_hbox.set_border_width (1);
track_canvas->get_pointer (x, y);
track_canvas->window_to_world (x, y, wx, wy);
- wx += xoffset;
- wy += yoffset;
+ wx += xoffset;
+ wy += yoffset;
/* don't get too close to the edge */
verbose_canvas_cursor->property_x() = clamp_verbose_cursor_x (wx);
void
Editor::toggle_stationary_playhead ()
{
- RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
- if (act) {
- RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
- set_stationary_playhead (tact->get_active());
- }
+ RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
+ if (act) {
+ RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
+ set_stationary_playhead (tact->get_active());
+ }
}
void
Editor::set_stationary_playhead (bool yn)
{
- if (_stationary_playhead != yn) {
- if ((_stationary_playhead = yn) == true) {
- /* catch up */
- // FIXME need a 3.0 equivalent of this 2.X call
- // update_current_screen ();
- }
- instant_save ();
- }
+ if (_stationary_playhead != yn) {
+ if ((_stationary_playhead = yn) == true) {
+ /* catch up */
+ // FIXME need a 3.0 equivalent of this 2.X call
+ // update_current_screen ();
+ }
+ instant_save ();
+ }
}
void
if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
Playlist::RegionList* regions = pl->regions_touched (
- (framepos_t) floor ( (double)where * tr->speed()), max_framepos);
+ (framepos_t) floor ( (double)where * tr->speed()), max_framepos);
for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
}
}
- _pending_resize_amount = 0;
+ _pending_resize_amount = 0;
flush_canvas ();
_group_tabs->set_dirty ();
resize_idle_id = -1;
void
Editor::step_edit_status_change (bool yn)
{
- if (yn) {
- start_step_editing ();
- } else {
- stop_step_editing ();
- }
+ if (yn) {
+ start_step_editing ();
+ } else {
+ stop_step_editing ();
+ }
}
void
playhead_cursor->set_position (frame);
}
- if (!_stationary_playhead) {
+ if (!_stationary_playhead) {
- if (!_dragging_playhead && _follow_playhead && _session->requested_return_frame() < 0) {
- reset_x_origin_to_follow_playhead ();
- }
+ if (!_dragging_playhead && _follow_playhead && _session->requested_return_frame() < 0) {
+ reset_x_origin_to_follow_playhead ();
+ }
- } else {
+ } else {
- /* don't do continuous scroll till the new position is in the rightmost quarter of the
- editor canvas
- */
+ /* don't do continuous scroll till the new position is in the rightmost quarter of the
+ editor canvas
+ */
#if 0
- // FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code
- double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
- if (target <= 0.0) {
- target = 0.0;
- }
- if (fabs(target - current) < current_page_frames() / frames_per_unit) {
- target = (target * 0.15) + (current * 0.85);
- } else {
- /* relax */
- }
+ // FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code
+ double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
+ if (target <= 0.0) {
+ target = 0.0;
+ }
+ if (fabs(target - current) < current_page_frames() / frames_per_unit) {
+ target = (target * 0.15) + (current * 0.85);
+ } else {
+ /* relax */
+ }
- current = target;
- set_horizontal_position (current);
+ current = target;
+ set_horizontal_position (current);
#endif
- }
+ }
}
}
{
framepos_t const position = get_preferred_edit_position ();
- if (!clicked_routeview) {
- if (layering_order_editor) {
- layering_order_editor->hide ();
- }
+ if (!clicked_routeview) {
+ if (layering_order_editor) {
+ layering_order_editor->hide ();
+ }
return;
}
- boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (clicked_routeview->route());
+ boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (clicked_routeview->route());
- if (!track) {
- return;
- }
+ if (!track) {
+ return;
+ }
boost::shared_ptr<Playlist> pl = track->playlist();
if (!pl) {
- return;
- }
+ return;
+ }
- if (layering_order_editor == 0) {
- layering_order_editor = new RegionLayeringOrderEditor(*this);
- }
+ if (layering_order_editor == 0) {
+ layering_order_editor = new RegionLayeringOrderEditor(*this);
+ }
- layering_order_editor->set_context (clicked_routeview->name(), _session, pl, position);
- layering_order_editor->maybe_present ();
+ layering_order_editor->set_context (clicked_routeview->name(), _session, pl, position);
+ layering_order_editor->maybe_present ();
}
void