}
bool
-AutomationRegionView::set_position (nframes_t pos, void* src, double* ignored)
+AutomationRegionView::set_position (nframes64_t pos, void* src, double* ignored)
{
return RegionView::set_position(pos, src, ignored);
}
protected:
void create_line(boost::shared_ptr<ARDOUR::AutomationList> list);
- bool set_position(nframes_t pos, void* src, double* ignored);
+ bool set_position(nframes64_t pos, void* src, double* ignored);
void region_resized(ARDOUR::Change what_changed);
bool canvas_event(GdkEvent* ev);
void add_automation_event (GdkEvent* event, nframes_t when, double y);
#include "audio_time_axis.h"
#include "midi_time_axis.h"
#include "canvas-note.h"
+#include "selection.h"
+#include "midi_selection.h"
using namespace std;
using namespace ARDOUR;
} else {
relative = true;
}
+
+ MidiRegionSelection& ms (_editor->get_selection().midi_regions);
+
+ if (ms.size() > 1) {
+ /* has to be relative, may make no sense otherwise */
+ relative = true;
+ }
region->note_selected (cnote, true);
- region->begin_resizing (at_front);
+
+ for (MidiRegionSelection::iterator r = ms.begin(); r != ms.end(); ) {
+ MidiRegionSelection::iterator next;
+ next = r;
+ ++next;
+ (*r)->begin_resizing (at_front);
+ r = next;
+ }
}
void
NoteResizeDrag::motion (GdkEvent* /*event*/, bool first_move)
{
- region->update_resizing (at_front, _current_pointer_x - _grab_x, relative);
+ MidiRegionSelection& ms (_editor->get_selection().midi_regions);
+ for (MidiRegionSelection::iterator r = ms.begin(); r != ms.end();) {
+ MidiRegionSelection::iterator next;
+ next = r;
+ ++next;
+ (*r)->update_resizing (at_front, _current_pointer_x - _grab_x, relative);
+ r = next;
+ }
}
void
NoteResizeDrag::finished (GdkEvent* event, bool movement_occurred)
{
- region->commit_resizing (at_front, _current_pointer_x - _grab_x, relative);
+ MidiRegionSelection& ms (_editor->get_selection().midi_regions);
+ for (MidiRegionSelection::iterator r = ms.begin(); r != ms.end();) {
+ MidiRegionSelection::iterator next;
+ next = r;
+ ++next;
+ (*r)->commit_resizing (at_front, _current_pointer_x - _grab_x, relative);
+ r = next;
+ }
}
void
* @return true if the position change was a success, false otherwise
*/
bool
-ImageFrameView::set_position(nframes_t pos, void* src, double* delta)
+ImageFrameView::set_position(nframes64_t pos, void* src, double* delta)
{
- nframes_t old_pos = frame_position ;
+ nframes64_t old_pos = frame_position ;
// do the standard stuff
bool ret = TimeAxisViewItem::set_position(pos, src, delta) ;
{
// calculate the offset of the marker
MarkerView* mv = (MarkerView*)*i ;
- nframes_t marker_old_pos = mv->get_position() ;
+ nframes64_t marker_old_pos = mv->get_position() ;
mv->set_position(pos + (marker_old_pos - old_pos), src) ;
}
* @return true if the duration change was succesful, false otherwise
*/
bool
-ImageFrameView::set_duration(nframes_t dur, void* src)
+ImageFrameView::set_duration(nframes64_t dur, void* src)
{
/* do the standard stuff */
bool ret = TimeAxisViewItem::set_duration(dur, src) ;
* @param src the identity of the object that initiated the change
* @return true if the position change was a success, false otherwise
*/
- virtual bool set_position(nframes_t pos, void* src, double* delta = 0) ;
+ virtual bool set_position(nframes64_t pos, void* src, double* delta = 0) ;
/**
* Sets the duration of this item
* @param src the identity of the object that initiated the change
* @return true if the duration change was succesful, false otherwise
*/
- virtual bool set_duration(nframes_t dur, void* src) ;
+ virtual bool set_duration(nframes64_t dur, void* src) ;
//---------------------------------------------------------------------------------------//
// Parent Component Methods
}
void
-Marker::set_position (nframes_t frame)
+Marker::set_position (nframes64_t frame)
{
double new_unit_position = editor.frame_to_unit (frame);
new_unit_position -= shift;
void hide_line ();
void set_line_vpos (double y_origin, double height);
- void set_position (nframes_t);
+ void set_position (nframes64_t);
void set_name (const std::string&);
void set_color_rgba (uint32_t rgba);
return trackview.editor().frame_to_pixel(region_frame);
}
+double
+MidiRegionView::get_end_position_pixels()
+{
+ nframes64_t frame = get_position() + get_duration ();
+ return trackview.editor().frame_to_pixel(frame);
+}
+
nframes64_t
MidiRegionView::beats_to_frames(double beats) const
{
for (std::vector<NoteResizeData *>::iterator i = _resize_data.begin(); i != _resize_data.end(); ++i) {
SimpleRect* resize_rect = (*i)->resize_rect;
CanvasNote* canvas_note = (*i)->canvas_note;
- const double region_start = get_position_pixels();
double current_x;
if (at_front) {
current_x = canvas_note->x1() + delta_x;
} else {
// x is in track relative, transform it to region relative
- current_x = delta_x - region_start;
+ current_x = delta_x - get_position_pixels();
}
} else {
if (relative) {
current_x = canvas_note->x2() + delta_x;
} else {
// x is in track relative, transform it to region relative
- current_x = delta_x - region_start;
+ current_x = delta_x - get_end_position_pixels ();
}
}
current_x = canvas_note->x1() + delta_x;
} else {
// x is in track relative, transform it to region relative
- current_x = delta_x - region_start;
+ current_x = region_start + delta_x;
}
} else {
if (relative) {
current_x = canvas_note->x2() + delta_x;
} else {
// x is in track relative, transform it to region relative
- current_x = delta_x - region_start;
+ current_x = region_start + delta_x;
}
}
current_x = frames_to_beats (current_x);
if (at_front && current_x < canvas_note->note()->end_time()) {
-
diff_add_change (canvas_note, MidiModel::DiffCommand::StartTime, current_x);
}
/** Get the region position in pixels relative to session. */
double get_position_pixels();
+ /** Get the region end position in pixels relative to session. */
+ double get_end_position_pixels();
+
/** Begin resizing of some notes.
* Called by CanvasMidiNote when resizing starts.
* @param at_front which end of the note (true == note on, false == note off)
for (order = 0, ri = rows.begin(); ri != rows.end(); ++ri, ++order) {
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
int old_key = order;
- int new_key = route->order_key (N_("signal"));
+ unsigned int new_key = route->order_key (N_("signal"));
assert (new_key < neworder.size());
neworder[new_key] = old_key;
}
bool
-RegionView::set_position (nframes_t pos, void* /*src*/, double* ignored)
+RegionView::set_position (nframes64_t pos, void* /*src*/, double* ignored)
{
double delta;
bool ret;
}
bool
-RegionView::set_duration (nframes_t frames, void *src)
+RegionView::set_duration (nframes64_t frames, void *src)
{
if (!TimeAxisViewItem::set_duration (frames, src)) {
return false;
virtual void set_height (double);
virtual void set_samples_per_unit (double);
- virtual bool set_duration (nframes_t, void*);
+ virtual bool set_duration (nframes64_t, void*);
void move (double xdelta, double ydelta);
void raise_to_top ();
void lower_to_bottom ();
- bool set_position(nframes_t pos, void* src, double* delta = 0);
+ bool set_position(nframes64_t pos, void* src, double* delta = 0);
void fake_set_opaque (bool yn);
virtual void show_region_editor () {}
* @param duration the duration of this item
*/
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
- nframes_t start, nframes_t duration, bool recording,
+ nframes64_t start, nframes64_t duration, bool recording,
Visibility vis)
: trackview (tv), _recregion(recording)
{
}
void
-TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & base_color, nframes_t start, nframes_t duration, Visibility vis)
+TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis)
{
item_name = it_name ;
samples_per_unit = spu ;
* @return true if the position change was a success, false otherwise
*/
bool
-TimeAxisViewItem::set_position(nframes_t pos, void* src, double* delta)
+TimeAxisViewItem::set_position(nframes64_t pos, void* src, double* delta)
{
if (position_locked) {
return false;
*
* @return the position of this item
*/
-nframes_t
+nframes64_t
TimeAxisViewItem::get_position() const
{
return frame_position;
* @return true if the duration change was succesful, false otherwise
*/
bool
-TimeAxisViewItem::set_duration (nframes_t dur, void* src)
+TimeAxisViewItem::set_duration (nframes64_t dur, void* src)
{
if ((dur > max_item_duration) || (dur < min_item_duration)) {
warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
* Returns the duration of this item
*
*/
-nframes_t
+nframes64_t
TimeAxisViewItem::get_duration() const
{
return (item_duration);
* @param src the identity of the object that initiated the change
*/
void
-TimeAxisViewItem::set_max_duration(nframes_t dur, void* src)
+TimeAxisViewItem::set_max_duration(nframes64_t dur, void* src)
{
max_item_duration = dur ;
MaxDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
*
* @return the maximum duration that this item may be set to
*/
-nframes_t
+nframes64_t
TimeAxisViewItem::get_max_duration() const
{
return (max_item_duration) ;
* @param src the identity of the object that initiated the change
*/
void
-TimeAxisViewItem::set_min_duration(nframes_t dur, void* src)
+TimeAxisViewItem::set_min_duration(nframes64_t dur, void* src)
{
min_item_duration = dur ;
MinDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
*
* @return the nimum duration that this item mey be set to
*/
-nframes_t
+nframes64_t
TimeAxisViewItem::get_min_duration() const
{
return(min_item_duration) ;
* @param src the identity of the object that initiated the change
* @return true if the position change was a success, false otherwise
*/
- virtual bool set_position(nframes_t pos, void* src, double* delta = 0) ;
+ virtual bool set_position(nframes64_t pos, void* src, double* delta = 0) ;
/**
* Return the position of this item upon the timeline
*
* @return the position of this item
*/
- nframes_t get_position() const ;
+ nframes64_t get_position() const ;
/**
* Sets the duration of this item
* @param src the identity of the object that initiated the change
* @return true if the duration change was succesful, false otherwise
*/
- virtual bool set_duration(nframes_t dur, void* src) ;
+ virtual bool set_duration(nframes64_t dur, void* src) ;
/**
* Returns the duration of this item
*
*/
- nframes_t get_duration() const ;
+ nframes64_t get_duration() const ;
/**
* Sets the maximum duration that this item make have.
* @param dur the new maximum duration
* @param src the identity of the object that initiated the change
*/
- virtual void set_max_duration(nframes_t dur, void* src) ;
+ virtual void set_max_duration(nframes64_t dur, void* src) ;
/**
* Returns the maxmimum duration that this item may be set to
*
* @return the maximum duration that this item may be set to
*/
- nframes_t get_max_duration() const ;
+ nframes64_t get_max_duration() const ;
/**
* Sets the minimu duration that this item may be set to
* @param the minimum duration that this item may be set to
* @param src the identity of the object that initiated the change
*/
- virtual void set_min_duration(nframes_t dur, void* src) ;
+ virtual void set_min_duration(nframes64_t dur, void* src) ;
/**
* Returns the minimum duration that this item mey be set to
*
* @return the nimum duration that this item mey be set to
*/
- nframes_t get_min_duration() const ;
+ nframes64_t get_min_duration() const ;
/**
* Sets whether the position of this Item is locked to its current position
sigc::signal<void,std::string,std::string,void*> NameChanged ;
/** Emiited when the position of this item changes */
- sigc::signal<void,nframes_t,void*> PositionChanged ;
+ sigc::signal<void,nframes64_t,void*> PositionChanged ;
/** Emitted when the position lock of this item is changed */
sigc::signal<void,bool,void*> PositionLockChanged ;
/** Emitted when the duration of this item changes */
- sigc::signal<void,nframes_t,void*> DurationChanged ;
+ sigc::signal<void,nframes64_t,void*> DurationChanged ;
/** Emitted when the maximum item duration is changed */
- sigc::signal<void,nframes_t,void*> MaxDurationChanged ;
+ sigc::signal<void,nframes64_t,void*> MaxDurationChanged ;
/** Emitted when the mionimum item duration is changed */
- sigc::signal<void,nframes_t,void*> MinDurationChanged ;
+ sigc::signal<void,nframes64_t,void*> MinDurationChanged ;
enum Visibility {
ShowFrame = 0x1,
* @param duration the duration of this item
*/
TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
- nframes_t start, nframes_t duration, bool recording = false, Visibility v = Visibility (0));
+ nframes64_t start, nframes64_t duration, bool recording = false, Visibility v = Visibility (0));
TimeAxisViewItem (const TimeAxisViewItem& other);
- void init (const std::string& it_name, double spu, Gdk::Color const & base_color, nframes_t start, nframes_t duration, Visibility vis);
+ void init (const std::string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis);
/**
* Calculates some contrasting color for displaying various parts of this item, based upon the base color
bool position_locked ;
/** The posotion of this item on the timeline */
- nframes_t frame_position ;
+ nframes64_t frame_position ;
/** the duration of this item upon the timeline */
- nframes_t item_duration ;
+ nframes64_t item_duration ;
/** the maximum duration that we allow this item to take */
- nframes_t max_item_duration ;
+ nframes64_t max_item_duration ;
/** the minimu duration that we allow this item to take */
- nframes_t min_item_duration ;
+ nframes64_t min_item_duration ;
/** indicates whether this Max Duration constraint is active */
bool max_duration_active ;