some API changes to help support developing GUI

This commit is contained in:
Paul Davis
2018-11-07 01:22:35 -05:00
parent ca869eda42
commit 07a60ecb8b
2 changed files with 9 additions and 8 deletions

View File

@@ -87,7 +87,10 @@ class Step : public PBD::Stateful {
bool skipped() const { return _skipped; }
void set_skipped (bool);
void set_timeline_offset (Temporal::Beats const &, Temporal::Beats const &);
void reschedule (Temporal::Beats const &, Temporal::Beats const &);
int octave_shift() const { return _octave_shift; }
void set_octave_shift (int);
XMLNode& get_state();
int set_state (XMLNode const &, int);
@@ -97,11 +100,11 @@ class Step : public PBD::Stateful {
StepSequence& _sequence;
bool _enabled;
Temporal::Beats timeline_offset;
Temporal::Beats _nominal_beat;
Temporal::Beats _scheduled_beat;
bool _skipped;
Mode _mode;
int _octave_shift;
struct ParameterValue {
int parameter;

View File

@@ -129,8 +129,8 @@ Step::adjust_velocity (int amt)
note.velocity += (1.0/128.0) * amt;
if (note.velocity > 127.0) {
note.velocity = 127.0;
if (note.velocity > 1.0) {
note.velocity = 1.0;
}
if (note.velocity < 0.0) {
@@ -290,10 +290,8 @@ Step::check_note (size_t n, MidiBuffer& buf, bool running, samplepos_t start_sam
}
void
Step::set_timeline_offset (Temporal::Beats const & start, Temporal::Beats const & offset)
Step::reschedule (Temporal::Beats const & start, Temporal::Beats const & offset)
{
timeline_offset = offset;
if (_nominal_beat < offset) {
_scheduled_beat = start + _nominal_beat + sequencer().duration(); /* schedule into the next loop iteration */
} else {
@@ -352,7 +350,7 @@ void
StepSequence::startup (Temporal::Beats const & start, Temporal::Beats const & offset)
{
for (Steps::iterator i = _steps.begin(); i != _steps.end(); ++i) {
(*i)->set_timeline_offset (start, offset);
(*i)->reschedule (start, offset);
}
}