Commit graph

21 commits

Author SHA1 Message Date
Paul Davis
5767c8f62e better handling of MidiView::apply_note_range()
In particular, keep the MidiViewBackground's sense of the data range intact,
use MidiModel::{highest,lowest}_note(), center ranges that don't fit
on the data range
2025-07-01 17:31:42 -06:00
Paul Davis
e2a6b81320 remove incorrect comment 2025-06-30 18:19:04 -06:00
Paul Davis
73f4378a51 more adjustments to scroomer drag logic
1. use an idle callback
2. MidiViewBackground::apply_note_range() now returns true/false
depending on whether or not it was able to make the requested change.
It might fail due to out of bounds note line size, for example.
2025-06-16 23:01:10 -06:00
Paul Davis
5208fdce2c the continuing saga of MIDI note line geometry and the scroomer 2025-06-10 12:28:33 -06:00
Paul Davis
eefe584070 another round of fixing for note-to-y and y-to-note and note line setup 2025-06-09 09:29:52 -06:00
Paul Davis
134907b9b1 fixups for pianoroll header/midi view background key/note positions 2025-06-04 14:11:40 -06:00
Paul Davis
bbc9089264 extend MidiViewBackground API
1. provide access to an EditingContext for use in piano roll headers
2. provide pre-computed note positions and heights for use in
   piano roll headers
2025-06-02 19:47:44 -06:00
Paul Davis
1f18a4defc change MidiViewBackground implementation
1. use a RectSet instead of a LineSet to draw note lines. Cairo provides
different coordinate -> pixel coloration rules for rectangles than for lines,
and it makes more sense in this case to use rectangles rather than fat lines.

2. change ::draw_note_lines() to ::setup_note_lines() since the method
doesn't actually draw anything.
2025-06-02 19:46:25 -06:00
Paul Davis
1ed9876446 Change various positions and dimensions to integer from double
This includes note heights, note positions, contents height
for streamviews, positions of tracks. It makes zero sense to think of these as
having potentially fractional positions.

In addition, fractional note heights and positions lead to numerous
errors drawing MIDI stuff at the pixel level.
2025-06-02 19:28:10 -06:00
Paul Davis
1a8445d6a1 MidiViewBackground now has a virtual method to access instrument info 2025-04-28 16:58:29 -06:00
Paul Davis
609f5c0112 fix initial position/size of scroomer in pianorolls
This still needs some API to reset note_range_set when we change the model
being displayed
2025-02-25 13:12:57 -07:00
Paul Davis
3928a3a0aa prevent note-range change signals for every added note in a MidiView 2025-02-25 13:12:57 -07:00
Robin Gareus
000c25edcc
Update gtkmm -> ytkmm header location (omnibus commit) 2025-02-01 15:25:14 +01:00
Paul Davis
5cade315fb redraw (pianoroll) MidiView when note mode changes
This also fixes the position of the percussive mode canvas items
2025-01-15 10:34:46 -07:00
Paul Davis
678ebca032 don't always adjust note range in a MidiView after a model change 2025-01-14 16:49:58 -07:00
Robin Gareus
2339b4dfdc
Replace PBD::Signals (2/2) 2024-10-18 20:41:08 +02:00
Paul Davis
59ed3d7138 cleanup canvas piano roll header so that it can exist with no current MidiView 2024-10-17 07:44:30 -06:00
Paul Davis
549defc068 more work on fixing pianorule recomposition of objects 2024-10-17 07:44:29 -06:00
Paul Davis
e24d1d069d all streamviews are now ViewBackgrounds
This new inheritance heirarchy lets us share (a very small piece of) code
between streamviews in the Editor and the nascent piano roll object on the cue
page.
2024-10-17 07:44:29 -06:00
Paul Davis
a550b6482f start using the now-compilable MidiView
Nothing yet derives from this, but MIDI display items and drags
do use it.
2024-10-17 07:44:29 -06:00
Paul Davis
204d4237f8 further steps towards MidiRegionView outside the Editor 2024-10-17 07:44:29 -06:00