mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
some incremental improvements in scroomer behavior
Notably dbl-click works consistently/reliably
This commit is contained in:
parent
87b50a4ecd
commit
baf41a65c3
2 changed files with 23 additions and 27 deletions
|
|
@ -955,8 +955,6 @@ EditingContext::draw_length_changed ()
|
|||
void
|
||||
EditingContext::set_draw_velocity_to (int v)
|
||||
{
|
||||
std::cerr << "sdv = " << v << std::endl;
|
||||
|
||||
if (v < 0 || v > 127) {
|
||||
v = DRAW_VEL_AUTO;
|
||||
}
|
||||
|
|
@ -1272,31 +1270,41 @@ EditingContext::build_draw_midi_menus ()
|
|||
|
||||
/* Note-Length when drawing */
|
||||
|
||||
std::vector<int> grids ({GridTypeBeat,
|
||||
std::vector<GridType> grids ({GridTypeBeat,
|
||||
GridTypeBeatDiv2,
|
||||
GridTypeBeatDiv4,
|
||||
GridTypeBeatDiv8,
|
||||
GridTypeBeatDiv16,
|
||||
GridTypeBeatDiv32,
|
||||
GridTypeNone});
|
||||
std::vector<std::string> draw_grid_type_strings;
|
||||
|
||||
draw_length_action (GridTypeNone)->set_active(); /* default */
|
||||
|
||||
for (auto & g : grids) {
|
||||
draw_length_selector.append (draw_length_action ((GridType) g));
|
||||
Glib::RefPtr<RadioAction> ract = draw_length_action (g);
|
||||
draw_length_selector.append (ract);
|
||||
draw_grid_type_strings.push_back (ract->get_short_label());
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<std::string> draw_grid_type_strings = {grid_type_strings.begin() + GridTypeBeat, grid_type_strings.begin() + GridTypeBeatDiv32 + 1};
|
||||
draw_grid_type_strings.push_back (_("Auto"));
|
||||
grid_type_selector.set_sizing_texts (draw_grid_type_strings);
|
||||
}
|
||||
grid_type_selector.set_sizing_texts (draw_grid_type_strings);
|
||||
|
||||
/* Note-Velocity when drawing */
|
||||
|
||||
std::vector<int> preselected_velocities ({8,32,64,82,100,127, DRAW_VEL_AUTO});
|
||||
std::vector<std::string> draw_velocity_strings;
|
||||
|
||||
draw_velocity_action (DRAW_VEL_AUTO)->set_active (); /* default */
|
||||
|
||||
for (auto & v : preselected_velocities) {
|
||||
draw_velocity_selector.append (draw_velocity_action (v));
|
||||
Glib::RefPtr<RadioAction> ract = draw_velocity_action (v);
|
||||
draw_velocity_selector.append (ract);
|
||||
draw_velocity_strings.push_back (ract->get_short_label());
|
||||
}
|
||||
|
||||
draw_velocity_selector.set_sizing_texts (draw_velocity_strings);
|
||||
|
||||
/* Note-Channel when drawing */
|
||||
for (int i = 0; i<= 15; i++) {
|
||||
char buf[64];
|
||||
|
|
@ -3513,4 +3521,3 @@ EditingContext::center_screen_internal (samplepos_t sample, float page)
|
|||
|
||||
reset_x_origin (sample);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -190,9 +190,7 @@ MidiViewBackground::setup_note_lines()
|
|||
void
|
||||
MidiViewBackground::set_note_visibility_range_style (VisibleNoteRange r)
|
||||
{
|
||||
_visibility_note_range = r;
|
||||
|
||||
if (_visibility_note_range == FullRange) {
|
||||
if (r == ContentsRange) {
|
||||
if (apply_note_range (_data_note_min, _data_note_max, true)) {
|
||||
_visibility_note_range = ContentsRange;
|
||||
}
|
||||
|
|
@ -278,15 +276,9 @@ MidiViewBackground::apply_note_range (uint8_t lowest, uint8_t highest, bool to_c
|
|||
float uiscale = UIConfiguration::instance().get_ui_scale();
|
||||
|
||||
int const range = _highest_note - _lowest_note;
|
||||
int nh = std::min ((int) (UIConfiguration::instance().get_max_note_height() * uiscale), (int) ceil ((double) contents_height() / range));
|
||||
int nh = std::max (5, std::min ((int) (UIConfiguration::instance().get_max_note_height() * uiscale), (int) ceil ((double) contents_height() / range)));
|
||||
int additional_notes = 0;
|
||||
|
||||
if (nh < 5) {
|
||||
_lowest_note = ol;
|
||||
_highest_note = oh;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (note_range_set) {
|
||||
/* how many notes do we need to add or remove to adequately
|
||||
* fill contents_height() with note lines?
|
||||
|
|
@ -313,14 +305,11 @@ MidiViewBackground::apply_note_range (uint8_t lowest, uint8_t highest, bool to_c
|
|||
|
||||
if ((can_move & CanMoveTop) && (i % 2 && _highest_note < 127)) {
|
||||
_highest_note--;
|
||||
}
|
||||
else if ((can_move & CanMoveBottom) && (i % 2)) {
|
||||
} else if ((can_move & CanMoveBottom) && (i % 2)) {
|
||||
_lowest_note++;
|
||||
}
|
||||
else if ((can_move & CanMoveBottom) && (_lowest_note > 0)) {
|
||||
} else if ((can_move & CanMoveBottom) && (_lowest_note > 0)) {
|
||||
_lowest_note++;
|
||||
}
|
||||
else if ((can_move & CanMoveTop)) {
|
||||
} else if ((can_move & CanMoveTop)) {
|
||||
_highest_note--;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue