1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 06:40:08 +02:00

217 Commits

Author SHA1 Message Date
Paul Licameli
bf3f041abe Make TrackInfo routines that calculate rectangles static 2017-06-12 13:34:50 -04:00
Paul Licameli
e2d77b399d Move one more selection function out of TrackPanel 2017-06-11 16:14:26 -04:00
Paul Licameli
d834bcdbd1 Move some command handlers for selection and focus out of TrackPanel 2017-06-11 11:03:28 -04:00
Paul Licameli
a9f7cb26e7 Move selection state into AudacityProject, out of TrackPanel 2017-06-11 10:40:55 -04:00
Paul Licameli
4da881d1db Define and use SelectionStateChanger 2017-06-11 10:40:50 -04:00
Paul Licameli
a594207265 Define class SelectionState; move some TrackPanel functions into it 2017-06-11 10:22:52 -04:00
Paul Licameli
991819bc28 Remove #includes 2017-06-10 14:27:17 -04:00
Paul Licameli
65c7beff99 Move mAdjustSelectionEdges from TrackPanel to ViewInfo 2017-06-08 15:30:52 -04:00
Paul Licameli
c300c33901 Remove a few unused members from class TrackPanel, and an unused #include 2017-06-08 15:30:31 -04:00
Paul Licameli
a33ec61ddf Move code for toggling spectral selection (Q key) out of TrackPanel 2017-06-08 12:48:28 -04:00
Paul Licameli
3255ab6c5b Remove some unused members 2017-06-07 21:57:42 -04:00
Paul Licameli
7bf7815c75 Move HideTopItem into class TrackInfo, for later use 2017-06-07 10:39:47 -04:00
Paul Licameli
84b5fd6075 Compute default WaveTrack height analogously to NoteTrack...
... though in fact this comes to the same 150 pixels as before, given the
present layout table.
2017-06-06 22:39:30 -04:00
Paul Licameli
f0c149b890 Default MIDI track height is enough to display velocity slider...
... It is computed from the layout table, and in fact comes to 158 pixels,
versus 150 for other tracks.
2017-06-06 22:39:30 -04:00
Paul Licameli
0204cd80c5 Make gain slider again visible in default sized WaveTrack 2017-06-06 22:39:30 -04:00
Paul Licameli
75bf6f90e4 Explanatory comments in TrackPanel drawing; fewer magic numbers 2017-06-06 13:17:51 -04:00
Paul Licameli
63c89e1fe3 Simplify logic of track control panel click to rearrange...
... Rearrange drag is now simply the default of all other hit tests.

The comment, as to the purpose of the removed call to TrackSelFunc, is
obsolete, because clicks on hidden buttons and sliders have recently been
disabled.

The mention of "the area left of the minimize button" is obsolete because there
is no such area any more after 2.2.0 layout changes.

Just before this commit, click in the minimize button but near the left edge
did not minimize, but started a track rearrange drag!  That should not be so.
2017-06-05 22:18:24 -04:00
Paul Licameli
52017948d1 Remove argument of DrawOutside that is no longer used...
... This only was a source of confusions.
2017-06-05 21:42:47 -04:00
Paul Licameli
4244d55b77 Fix NoteTrack stray lines; no magic numbers in DrawBordersWithin...
... even though we are now skipping that drawing step.
2017-06-05 21:42:36 -04:00
Paul Licameli
b8492d02d6 CalcItemY is table-driven; stack Mute & Solo for NoteTrack too in DA 2017-06-05 21:35:39 -04:00
Paul Licameli
c38efc1fcd FindTrackRect omits all margins; better screen reader focus rects...
... Formerly it was outside of the yellow focus at the right side.  Now it
follows the yellow consistently on four sides.

The constant dx in TrackPanelAx::GetLocation might be adjusted.

No change of behavior is intended at other uses of FindTrackRect
2017-06-04 11:31:46 -04:00
Paul Licameli
afd3b0ba19 Remove some uses of Track::GetHeight()...
Pass top-left point, not a rectangle, to places that did not use width or
height.
2017-06-04 08:29:32 -04:00
Paul Licameli
646c66f78f Sync lock adjustment for NoteTrack stretch...
... It applies only at button-up, not in a previewing fashion during the drag.

Realizing that preview is more work than I want to do right now.
2017-05-22 23:25:39 -04:00
Paul Licameli
82ce041c75 Preview cursor for Stretch can take left, right, or center form 2017-05-22 23:16:42 -04:00
Paul Licameli
90eb4ec142 Make MIDI track stretch path-independent 2017-05-22 23:15:26 -04:00
Paul Licameli
9fb7185ea4 Rewrite undo handling for Stretch to be more like other drags...
... that is, push a state only at button-up.

The undo during each drag increment didn't actually happen, because of a check
in OnUndo whether there is a drag in progress!

But this is not necessary to fix the excessive number of undo items, because
commit 63ae687bafd1123bf4bf7d00070e1dd9f38dc8a2 already did that by other means.

It only removes an unusual usage.
2017-05-22 23:12:36 -04:00
Paul Licameli
2eb6285ddc Group some TrackPanel fields into a structure 2017-05-22 23:12:35 -04:00
Paul Licameli
01f853f174 Fix Windows build 2017-05-18 19:01:46 -04:00
Paul Licameli
f7578193b4 TrackPanel::OnClipMove is a static function 2017-05-18 07:46:54 -04:00
Paul Licameli
227850f9cd Group some member variables into ClipMoveState 2017-05-18 07:45:04 -04:00
Paul Licameli
282abfce7f Abstract TrackPanel::GetSnapLeft() and ::GetSnapRight() 2017-05-18 07:07:50 -04:00
Paul Licameli
d36ac2cedb Revert "Fix for keyboard commands for time shifting clips"
This reverts commit b91160795dedce54745102027f8bb0908828772a.
2017-05-18 07:06:22 -04:00
David Bailes
b91160795d Fix for keyboard commands for time shifting clips
Commands didn't update history etc.

Fix: Commands now call TrackPanel::MakeParentPushState.
2017-05-15 13:12:11 +01:00
Pokechu22
a76ad22c91 Fix midi channel toggling
This reintroduces the buttons to toggle display of individual midi
channels, and cleans up the code behind that feature.

This functionality has actually been present in production versions of
audacity for a while, at least for clicking.  However, the buttons
themselves were not drawn, making it exteremly painful (but possible) to
use.

As requested by PRL, this is always enabled if USE_MIDI is defined.
2017-05-02 00:37:31 -04:00
Paul Licameli
5dd6a3558b Use #ifdef not #if in two places 2017-04-29 15:53:55 -04:00
James Crook
8ad2e599ab Tweak Theming. Reticules, Down buttons; Selected buttons. 2017-04-06 20:44:24 +01:00
James Crook
fefc856901 Update slider in tracks on theme change. 2017-04-05 20:16:12 +01:00
David Bailes
a7a4a70e5f Two commands added, neither on a menu:
Clip Left
Clip Right

If the cursor lies within a clip, the clip and the cursor is moved 1 pixel left/right.
If the cursor position is at both a clip end and a clip start, the second of these clips is moved.

The movement currently ignores the snap to setting on the selection bar, and there is no snapping to the clip boundaries of other clips.
Following the behaviour or shifting with the mouse, the distance moved is rounded to an integral number of samples, and the minimum distance moved is one sample.
2017-04-03 13:53:48 +01:00
James Crook
028ed19d90 Sync with DarkAudacity 2017-04-02 23:07:13 +01:00
Pokechu22
59d740ad77 Use a dedicated velocity slider for note tracks
This gets rid of the offset rectangle hack that was needed to re-use gain
sliders for note track velocities.  It also removes the need for changing
the style of a single slider.  Perhaps most importantly, it fixes link
errors regarding GainSlider(int).

See https://sourceforge.net/p/audacity/mailman/message/35752524/ for
details on why this change is needed and what caused it.
2017-04-01 12:48:43 -04:00
Paul Licameli
0af9b46eac Move many fields out of Envelope that are needed only during editing 2017-03-17 17:52:31 -04:00
Paul Licameli
54aea4bccf Rewrite TrackPanel::FindTrack as FindCell ...
... which reports disjoint rectangles for the track control panel, the vertical
ruler, and the proper track area.
2017-03-17 17:52:28 -04:00
Paul Licameli
81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
Darrell Walisser
43291687a5 Bug 1401 - Wait for window visibility before starting timer 2017-02-25 16:16:42 -05:00
David Bailes
ff9763f984 Add two commands to move the cursor/selection to next/prev label
The two commands are "selection to next label" and "selection to previous label".
They have default shortcuts alt+right and alt+left.

A label track does not have to be the focus. If there is a single label track in the project, that it used. If there is more than one label track, then the first label track, if any, starting at the focused track is used.

If the commands are used during playback of the project, playback continues from the new cursor/selection.

The commands provide feedback to screen readers: the name of the label, and position in the form of "i of n".
2016-10-24 14:24:20 +01:00
James Crook
fe2dfca3e0 Bug 1522 - No pointer or Status Bar indication of CTRL-click in waveform to move selection boundary
I also took the opportunity to modifier the Status Bar indications when in the TrackInfo.
1) We now mention ctrl click can select or deselect track.
2) If there is only one track, we don't now prompt about rearranging tracks, since you can't.
3) If you hover in a label track's VRuler (which is just a spacer so that things line up), you now don't get a message.
2016-10-07 21:38:18 +01:00
James Crook
37a0cd3af6 Bug 1484 - Cannot one-step extend/contract selections vertically or horizontally to specific TrackSelFunc
Progresses us a little towards closing.  Ctrl-Click on waveform now removes track selection status, not just adds it, and we don't flicker on again subsequently when we drag.  Ctrl-Click won't remove the last remaining selection (by design).  Shift-Click can now reduce us down to one track, rather than the previous behaviour when reducing track selection.
2016-10-03 13:28:25 +01:00
Paul Licameli
88611a4530 Fewer C-style pointer casts of tracks; comments justify static_cast 2016-09-15 12:12:43 -04:00
James Crook
0f417a65c7 RaphaelMarinier - Initialise mFreqSelTrack (found by Valgrind) 2016-09-11 22:00:01 +01:00
James Crook
c57f829200 Bug 1484 - (Residual) Shift-Click calculates start/end for itself.
Smarter logic, which extends down from the first or up from the last.
2016-08-30 23:46:12 +01:00