use rational number for step durations
This commit is contained in:
parent
25f67e3f16
commit
e1d82bce04
|
@ -512,7 +512,8 @@ StepView::render (ArdourCanvas::Rect const & area, Cairo::RefPtr<Cairo::Context>
|
|||
context->rectangle (origin.x + 2, origin.y + (_step_dimen - height - 2), _step_dimen - 4, height);
|
||||
context->fill ();
|
||||
} else if (_seq.mode() == SequencerGrid::Duration) {
|
||||
const double height = (_step_dimen - 4) * (_step.duration());
|
||||
const Step::DurationRatio d (_step.duration());
|
||||
const double height = ((_step_dimen - 4.0) * d.numerator()) / d.denominator();
|
||||
const Duple origin = item_to_window (Duple (0, 0));
|
||||
context->rectangle (origin.x + 2, origin.y + (_step_dimen - height - 2), _step_dimen - 4, height);
|
||||
context->fill ();
|
||||
|
@ -594,8 +595,8 @@ StepView::scroll_event (GdkEventScroll* ev)
|
|||
cerr << "adjust velocity by " << amt << endl;
|
||||
adjust_step_velocity (amt);
|
||||
} else if (_seq.mode() == SequencerGrid::Duration) {
|
||||
cerr << "adjust velocity by " << amt << endl;
|
||||
adjust_step_duration (amt/32.0); /* adjust by 1/32 of the sequencer step size */
|
||||
cerr << "adjust duration by " << Step::DurationRatio (amt, 32) << endl;
|
||||
adjust_step_duration (Step::DurationRatio (amt, 32)); /* adjust by 1/32 of the sequencer step size */
|
||||
} else if (_seq.mode() == SequencerGrid::Octave) {
|
||||
adjust_step_octave (amt);
|
||||
} else if (_seq.mode() == SequencerGrid::Group) {
|
||||
|
@ -623,7 +624,7 @@ StepView::adjust_step_octave (int amt)
|
|||
}
|
||||
|
||||
void
|
||||
StepView::adjust_step_duration (double amt)
|
||||
StepView::adjust_step_duration (Step::DurationRatio const & amt)
|
||||
{
|
||||
_step.adjust_duration (amt);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include "canvas/canvas.h"
|
||||
#include "canvas/rectangle.h"
|
||||
|
||||
#include "ardour/step_sequencer.h"
|
||||
|
||||
#include "widgets/ardour_button.h"
|
||||
#include "widgets/ardour_dropdown.h"
|
||||
#include "ardour_dialog.h"
|
||||
|
@ -59,8 +61,6 @@ class Widget;
|
|||
|
||||
namespace ARDOUR {
|
||||
class BeatBox;
|
||||
class Step;
|
||||
class StepSequencer;
|
||||
}
|
||||
|
||||
class SequencerGrid;
|
||||
|
@ -88,7 +88,7 @@ class StepView : public ArdourCanvas::Rectangle, public sigc::trackable {
|
|||
|
||||
void adjust_step_pitch (int amt);
|
||||
void adjust_step_velocity (int amt);
|
||||
void adjust_step_duration (double);
|
||||
void adjust_step_duration (ARDOUR::Step::DurationRatio const &);
|
||||
void adjust_step_octave (int amt);
|
||||
|
||||
void step_changed (PBD::PropertyChange const &);
|
||||
|
|
Loading…
Reference in New Issue