#include "ui_config.h"
#include "verbose_cursor.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
begin_reversible_selection_op (X_("Clear Selection Click (track canvas)"));
selection->clear ();
commit_reversible_selection_op();
- }
+ }
return false;
}
Editor::track_canvas_button_release_event (GdkEventButton *event)
{
if (!Keyboard::is_context_menu_event (event)) {
- if (_drags->active ()) {
- _drags->end_grab ((GdkEvent*) event);
- }
- }
+ if (_drags->active ()) {
+ _drags->end_grab ((GdkEvent*) event);
+ }
+ }
return false;
}
bool
Editor::typed_event (ArdourCanvas::Item* item, GdkEvent *event, ItemType type)
{
+ if (!session () || session()->loading () || session()->deletion_in_progress ()) {
+ return false;
+ }
+
gint ret = FALSE;
switch (event->type) {
case GDK_BUTTON_RELEASE:
ret = button_release_handler (item, event, trim ? FadeInTrimHandleItem : FadeInHandleItem);
- maybe_locate_with_edit_preroll ( rv->region()->position() );
break;
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_RELEASE:
ret = button_release_handler (item, event, trim ? FadeOutTrimHandleItem : FadeOutHandleItem);
- maybe_locate_with_edit_preroll ( rv->region()->last_frame() - rv->get_fade_out_shape_width() );
break;
case GDK_MOTION_NOTIFY:
}
struct DescendingRegionLayerSorter {
- bool operator()(boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
- return a->layer() > b->layer();
- }
+ bool operator()(boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
+ return a->layer() > b->layer();
+ }
};
bool
}
bool
-Editor::canvas_frame_handle_event (GdkEvent* event, ArdourCanvas::Item* item, RegionView* rv)
+Editor::canvas_sample_handle_event (GdkEvent* event, ArdourCanvas::Item* item, RegionView* rv)
{
bool ret = false;
- /* frame handles are not active when in internal edit mode, because actual notes
+ /* sample handles are not active when in internal edit mode, because actual notes
might be in the area occupied by the handle - we want them to be editable as normal.
*/
return false;
}
- /* NOTE: frame handles pretend to be the colored trim bar from an event handling
+ /* NOTE: sample handles pretend to be the colored trim bar from an event handling
perspective. XXX change this ??
*/
}
bool
-Editor::canvas_tempo_marker_event (GdkEvent *event, ArdourCanvas::Item* item, TempoMarker* /*marker*/)
+Editor::canvas_tempo_marker_event (GdkEvent *event, ArdourCanvas::Item* item, TempoMarker* marker)
{
return typed_event (item, event, TempoMarkerItem);
}
if (tv.first == 0
&& (
- boost::dynamic_pointer_cast<AudioRegion> (region) != 0 ||
- boost::dynamic_pointer_cast<MidiRegion> (region) != 0
+ boost::dynamic_pointer_cast<AudioRegion> (region) != 0 ||
+ boost::dynamic_pointer_cast<MidiRegion> (region) != 0
)
)
{
void
Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/,
- int x, int y,
- const SelectionData& /*data*/,
- guint /*info*/, guint /*time*/)
+ int x, int y,
+ const SelectionData& /*data*/,
+ guint /*info*/, guint /*time*/)
{
GdkEvent event;
double px;
event.button.y = y;
/* assume we're dragging with button 1 */
event.motion.state = Gdk::BUTTON1_MASK;
- framepos_t const pos = window_event_sample (&event, &px, &py);
+ samplepos_t const pos = window_event_sample (&event, &px, &py);
boost::shared_ptr<Region> region = _regions->get_dragged_region ();
if (!region) { return; }
}
list<boost::shared_ptr<AudioTrack> > audio_tracks;
audio_tracks = session()->new_audio_track (region->n_channels(), output_chan, 0, 1, region->name(), PresentationInfo::max_order);
- rtav = dynamic_cast<RouteTimeAxisView*> (axis_view_from_stripable (audio_tracks.front()));
+ rtav = dynamic_cast<RouteTimeAxisView*> (time_axis_view_from_stripable (audio_tracks.front()));
} else if (boost::dynamic_pointer_cast<MidiRegion> (region)) {
ChanCount one_midi_port (DataType::MIDI, 1);
list<boost::shared_ptr<MidiTrack> > midi_tracks;
- midi_tracks = session()->new_midi_track (one_midi_port, one_midi_port, boost::shared_ptr<ARDOUR::PluginInfo>(),
+ midi_tracks = session()->new_midi_track (one_midi_port, one_midi_port,
+ Config->get_strict_io () || Profile->get_mixbus (),
+ boost::shared_ptr<ARDOUR::PluginInfo>(),
(ARDOUR::Plugin::PresetRecord*) 0,
(ARDOUR::RouteGroup*) 0, 1, region->name(), PresentationInfo::max_order);
- rtav = dynamic_cast<RouteTimeAxisView*> (axis_view_from_stripable (midi_tracks.front()));
+ rtav = dynamic_cast<RouteTimeAxisView*> (time_axis_view_from_stripable (midi_tracks.front()));
} else {
return;
}
if ((boost::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 && dynamic_cast<AudioTimeAxisView*> (rtav) != 0) ||
(boost::dynamic_pointer_cast<MidiRegion> (region_copy) != 0 && dynamic_cast<MidiTimeAxisView*> (rtav) != 0)) {
_drags->set (new RegionInsertDrag (this, region_copy, rtav, pos), &event);
- _drags->end_grab (0);
+ _drags->end_grab (&event);
}
}
}