Commit graph

1187 commits

Author SHA1 Message Date
Paul Davis
28e0082868 use std::unique_ptr for a couple of EditingContext members 2025-08-08 12:12:09 -06:00
Paul Davis
1d4e3940d1 large-scale refactoring of Pianoroll, CueEditor and AudioClipEditor
Enables code-sharing between "clip editors"
2025-07-29 18:16:35 -06:00
Paul Davis
57eda4f7ee remove 2nd of 3 #warnings from the EditingContext refactor
I'm not 100% sure this is correct, but it doesn't really matter - velocity
lollipop drag are vertical only
2025-07-11 17:40:58 -06:00
Paul Davis
f356c914b9 fix location of drawn notes in some contexts 2025-07-10 18:18:31 -06:00
Paul Davis
6a4f4e4710 rework NoteDrag::total_dy() to correctly clamp y to within the required range 2025-07-01 17:31:42 -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
3600a6ffd0 fix computation of note position for HitCreateDrags 2025-04-30 18:07:55 -06:00
Paul Davis
5526880ac8 do not create an empty region for a cue slot when it is selected for editing
There's an assumption that slots with regions cannot be recorded into,
so adding a region to an empty slot makes it impossible to record to that
slot.

Create the region at the appropriate point during a NoteCreateDrag.

This may also be needed for some automation drawing drag operations.
2025-04-24 12:07:19 -06:00
Paul Davis
0c924c3933 pianoroll: dragging start handle before zero shifts MIDI later in time 2025-04-08 15:50:30 -06:00
Paul Davis
15c808c9f4 expand the dialog used for renaming location markers to allow scene editing
This has no visible effect for anything that is not livetrax (for now).
2025-04-07 17:46:01 -06:00
Paul Davis
7bdb86b357 call a spade a spade (or rather, a MidiView a view) 2025-03-16 15:01:51 -06:00
Paul Davis
367800830d in internal edit mode, a rubber-band select with no motion (i.e. click) selects region 2025-03-14 13:24:49 -06:00
Paul Davis
c14a8e91a7 fix start and end trim of timeline regions in a pianoroll 2025-03-10 09:42:27 -06:00
Paul Davis
a94bd4b7c6 rename MidiView::relative_position() to ::view_position_to_model_position() 2025-03-06 18:12:40 -07:00
Paul Davis
67fa5282cb Remove Region::absolute_time_to_region_beats()
This method did not do what its name suggested. Replace it with
::absolute_time_to_source_beats() which already existed and
computed the same result.

Also in a NoteCreateDrag, correctly adjust note start
depending on whether we are viewing the whole source or
just the region. This part may be amended later.
2025-03-06 18:12:39 -07:00
Robin Gareus
000c25edcc
Update gtkmm -> ytkmm header location (omnibus commit) 2025-02-01 15:25:14 +01:00
Paul Davis
a7382b9424 provide MidiView methods for use in NoteDrags (fixes note drags to earlier times in pianoroll) 2025-01-19 10:53:52 -07:00
Paul Davis
5f049affac change name of _region member of NoteDrag to _view (since it's a MidiView) 2025-01-19 10:53:52 -07:00
luzpaz
1a18417464
fix typos in gtk2_ardour directory
Found via `codespell -q 3 -S "*.pdf,*.po,./.git,*.tosc,./waf,./share/patchfiles,./libs,./msvc_extra_headers,./share/web_surfaces,*.patch" -L acount,addin,ane,ba,buss,busses,caf,capela,devine,disconnectin,discreet,doubleclick,envolution,filetest,fo,ghandi,homs,hsi,layed,maschine,mis,nd,ontop,pass-thru,removeable,retrn,ro,scrollin,sectionin,seh,siz,sord,sur,te,trough,ue,wth`
2025-01-18 00:55:34 +01:00
Paul Davis
d0b643b116 do not use DragManager::current_pointer_x() directly during drags
That ignores a _bounding_item and can give incorrect coordindates for the drag when
that is used (e.g. clip editor)
2025-01-10 11:17:59 -07:00
Paul Davis
e273ec06bb fix note drawing in clip editor by adding MidiView::relative_position() 2025-01-10 10:31:48 -07:00
Paul Davis
cb26e309af alter NoteResizeDrag to operate on a single region only
This lets us use a MidiView as the target, rather than a MidiRegionView
2025-01-09 16:33:43 -07:00
Paul Davis
5635144e42 initial rename of MidiCueEditor -> Pianoroll 2025-01-07 11:30:26 -07:00
Paul Davis
96595669dc fix clip start/end drags with snap enabled 2025-01-07 10:37:56 -07:00
Paul Davis
dbcf4c14f4 fix mechanism used for moving/dragging clip end handles 2024-12-27 14:10:00 -07:00
Paul Davis
84c78db3ad remove unused variables 2024-12-27 14:09:27 -07:00
Paul Davis
76fa75cf9a add a check on the event type passed to start Drags
Drags should always be started by a button press event.
2024-12-27 14:09:11 -07:00
Paul Davis
084a23a80d some work on being able to swap channels and have different MIDI automation displayed in pianoroll 2024-12-20 11:48:40 -07:00
Paul Davis
98c9c03e9f remove all trace of cursor stacks; canvas cursor is always "just set" 2024-12-08 12:13:41 -07:00
Paul Davis
2096ff7876 cue editor end dragging operational 2024-11-26 13:11:17 -07:00
Paul Davis
2eece78718 stop leftward drags from corrupting clip start 2024-11-25 21:37:55 -07:00
Paul Davis
ecd3cf8766 improved ("working") clip start drag 2024-11-25 21:16:15 -07:00
Paul Davis
efc153d880 actually set trigger start to where mouse was released when dragging 2024-11-25 18:16:56 -07:00
Paul Davis
5ef4f8973f somewhat sort of working clip start drag (GUI edition) 2024-11-25 17:54:15 -07:00
Paul Davis
465f39e5bf create nonfunctional clip boundary drags when appropriate 2024-11-23 09:06:38 -07:00
Paul Davis
48ed5be776 skeleton for clip start/end editing 2024-11-12 18:54:41 -07:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Robin Gareus
ff95d81612
Reduce reliance on boost - the easy part
* boost::unordered_map -> std::unordered_map
* BOOST_STATIC_ASSERT/static_assert
* BOOST_FOREACH -> for
* boost::tuple -> std::tuple/g
* boost::math::isnormal -> std::isnormal
* boost::container::set -> std::set
* boost::none -> std::nullopt
* boost::optional -> std::optional
2024-10-19 03:41:16 +02:00
Robin Gareus
168b917730
Prepare for std::optional 2024-10-19 03:40:04 +02:00
Paul Davis
bf2016071d a variety of improvements related to clip recording & editing 2024-10-17 21:47:52 -06:00
Paul Davis
01068fe306 further adventures in drag-refactoring do that LineDrag can be used in MidiCueEditor also 2024-10-17 07:44:32 -06:00
Paul Davis
2afdeb519f refactor rubberband drags to take a functor for the no-drag condition
Also move code for adding automation line control points into automation line, rather
than in AutomationTimeAxisView (some work still required to finalize this)
2024-10-17 07:44:32 -06:00
Paul Davis
e6c0fcf98f refactor end-of-rb-selection for EditingContext
Whhat the main editor and the cue editor do with a click varies significantly
2024-10-17 07:44:32 -06:00
Paul Davis
4b8c51574d refactor the "selectables" API to allow use within separate (e.g. cue) editors 2024-10-17 07:44:32 -06:00
Paul Davis
56ce9c33c0 renaming: AutomationLineBase => AutomationLine, AutomationLine => EditorAutomationLine 2024-10-17 07:44:31 -06:00
Paul Davis
90c8726c6d wideranging changes to get automation editing working in cue editor 2024-10-17 07:44:31 -06:00
Paul Davis
afa15a0061 get velocity editing working in both the cue editor and MIDI region views
Quite a bit of hairy coordinate system stuff in here that ought to be commented more
clearly
2024-10-17 07:44:31 -06:00
Paul Davis
54fdf90cc2 lots of detailed fixes to get lollipops in tracks working again, post re-factor 2024-10-17 07:44:31 -06:00
Paul Davis
fa79645c19 move most of AutomationLine into AutomatonLineBase, a class not strongly tied to the editor 2024-10-17 07:44:31 -06:00
Paul Davis
2fceb66193 manual fixups for errors during rebasing against master 2024-10-17 07:44:31 -06:00