Commit Graph

375 Commits

Author SHA1 Message Date
Paul Licameli 329aa8393e Table includes draw function for Midi controls 2017-06-13 14:02:10 -04:00
Paul Licameli 86763341af Table includes draw function for Minimize and Sync-lock icon 2017-06-13 14:02:10 -04:00
Paul Licameli b4e38c2838 Table includes draw function for Close and Title 2017-06-13 14:02:09 -04:00
Paul Licameli ba014f042a Add a slot for drawing functions to the TCP lines table 2017-06-13 14:01:37 -04:00
Paul Licameli e554f0cdc6 TrackPanel::HasSoloButton is static and public 2017-06-13 14:01:37 -04:00
Paul Licameli 18b3bc0600 Separate functions defining the horizontal bounds of TCP items 2017-06-13 14:01:36 -04:00
Paul Licameli b15bf441ec Static TrackInfo slider accessors, const Track* arguments 2017-06-13 14:01:36 -04:00
Paul Licameli 1d1dded9ba TrackInfo::SetTrackInfoFont is static 2017-06-13 14:01:36 -04:00
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 63ae687baf 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 b91160795d.
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
Paul Licameli 5761972dfa BHug1488: Don't crash exiting from command-line benchmark test...
Problem was that cfd7648fce fixed a memory leak
but created a dangling pointer bug, which does not happen during usual run
of Audacity because AudacityProject::OnCloseWindow is reached then before
destroying AudacityProject.

Fixed it by using a std::shared_pointer for the TrackList that both
AudacityProject and TrackPanel must use.
2016-08-20 13:58:56 -04:00
Paul Licameli 13e056de43 More uses of safenew 2016-08-08 10:07:37 -04:00
Paul Licameli 60260520dc Remove some naked new amd delete in: TrackPanel 2016-08-08 07:38:30 -04:00
Paul Licameli 3b6dcfcc32 Remove some naked new amd delete in: TrackPanel::mAx 2016-08-08 07:38:30 -04:00
Paul Licameli cc5d1036fa Pinch and spread gestures on Mac touchpad, if EVT_MAGNIFY is defined 2016-07-03 12:14:08 -04:00
Paul Licameli 28c31903e9 Update mixer board selection state correctly for undo/redo 2016-06-26 13:31:00 -04:00
Paul Licameli 4823244050 Bug1426: Better selection for key-modified clicks in TCP, Mixer board 2016-06-26 12:03:45 -04:00
Paul Licameli ee7b3b2b89 Bug1426: Update mixer board for change of set of selected tracks 2016-06-26 11:24:11 -04:00
Paul Licameli 21431d1982 No longer need silly extra indirection to void a VS compiler warning 2016-06-26 10:45:57 -04:00
Paul Licameli dd786984db Bug320: Better change of selection when Shift+Click in a track...
... But Shift+Click in the track control panel is still different:  se bug 1425
2016-06-26 10:39:29 -04:00
Paul Licameli 1409c9507d Fix crashes when opening track control panel menu 2016-06-13 10:06:20 -04:00
Paul Licameli bb7dba2b67 Shortcut keys can appear as intended in Track Control Panel menus...
... Delayed construction of the menus was needed.

So far this only affects the four menu items that move tracks up and down.
2016-06-12 00:00:04 -04:00
Paul Licameli 4f2ee32a1a One second countdown now based on the correct timer interval 2016-05-27 11:40:17 -04:00
Steve Daulton 0377a24f90 Comment out unused TrackPanel::BuildVRulerMenuItems function
The function builds pop up menus that are never displayed and
creates runtime debug warnings. It is left over from PRL's experiment
in 2.1.2 with a context menu for the vertical ruler.
2016-05-27 10:45:01 +01:00
Paul Licameli ba883cbcf4 Improve responsiveness of drag seek during click-scrub...
.. by refreshing the TrackPanel window less often.
2016-05-23 18:37:42 -04:00
Paul Licameli 7e0de9a9bc Fix incidentals to Bug 1331, though not the bug itself...
... See comments #1 and #2 at
http://bugzilla.audacityteam.org/show_bug.cgi?id=1331

Don't make strange undo history if, e.g., R to record (or other keystroke
with undoable effects) interrupts a drag with undoable effects (like time
shift).  Ensure that by first simulating a mouse button up event to stop the
drag, before dispatching the keystroke.

Don't crash if certain other drags, that do not have undoable effects, such
as selection or vertical ruler drag -- are interrupted by a keystroke
command (Ctrl+C in particular could cause crash).  However, in these cases,
the drag is still allowed to continue.
2016-05-21 23:19:09 -04:00
Paul Licameli 7c2a531486 New base classes of TrackPanel just for the bitmap backing and overlay system...
... to make it reusable by other classes.

Also, don't create a second DC when repainting TrackPanel.
2016-05-09 11:37:32 -04:00
Paul Licameli e7477746df Computing best font size for TrackInfo is redone when preferences change 2016-05-01 17:55:48 -04:00
Paul Licameli 5a5775c1c1 Implement showing and hiding of a srub bar portion of the ruler...
... activated by clicking near the left end of the ruler, then using the
context menu.

This is not finished work, but a proof of concept for a possible new scrubbing
UI.
2016-04-27 18:39:47 -04:00
Paul Licameli 81fae8d71c Rework the ESC key to stop playback as an application event handler...
... So it does not depend on the focused window, and can work when selection
toolbar has focus.  But TrackPanel's escape handling may still take precedence
over it.
2016-04-20 15:34:49 -04:00
Paul Licameli ce95bce85a Bug991: Pause button and command should be disabled during scrubbing...
... and they will be as soon as ctrl-mouse down.
2016-04-18 21:49:27 -04:00
Paul Licameli 9f65b80647 Reimplement quick play indicator as an overlay like the cursor 2016-04-18 14:31:36 -04:00
Paul Licameli 8b7ae748a3 Scrub speed as overlay; scrub event handling details out of TrackPanel.cpp 2016-04-18 14:31:36 -04:00
Paul Licameli 1722ee9e32 Define TrackPanelOverlay, use it to reimplement play indicator and cursor...
... but scrub speed display is disabled
2016-04-18 14:31:36 -04:00
Paul Licameli def8b7fa9b MakeCursor returns smart pointer; TrackPanel stores smart pointers to cursors 2016-04-09 23:07:27 -04:00
Paul Licameli b28ec2957a Make EXPERIMENTAL_MIDI_OUT compilable, but it doesn't link 2016-04-09 15:10:05 -04:00
Paul Licameli 0c9deb398c Fix mac build. No standard headers in Audacity.h. 2016-03-01 12:22:37 -05:00
Paul Licameli 990080ae7d Replace virtual with override wherever possible; eliminate needless virtual...
... for functions in final classes.

override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.

There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
2016-02-26 12:35:38 -05:00
Paul Licameli 7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls.  Mostly useful as documentation of design intent.

Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
2016-02-24 20:58:30 -05:00
Paul Licameli e2f7e5f6f6 travis 2016-02-24 20:45:49 -05:00
Paul Licameli cd9bd79d83 Use an enumeration for UndoManager::PushState 2016-02-24 19:10:35 -05:00
Paul Licameli 73ced7b93f Remove UndoManager.h from other headers 2016-02-24 19:10:34 -05:00
Paul Licameli 9bf098c7d9 Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -05:00
Paul Licameli df6a7c5464 More uses of safenew for classes we derive from wxWindow classes...
... Also removed some unnecessary deletes of widgets that are managed by parent
windows
2016-02-14 20:39:28 -05:00
Paul Licameli 7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Paul Licameli daa7617e88 auto_ptr (deprecated) -> unique_ptr (preferred in C++11) 2016-02-13 12:00:28 -05:00
Paul Licameli d70ff3337d Bug501: Improve time-shift of clips between tracks...
... When you click in a stereo clip, move the correct partner clip with it.

When you click in the selection and it spans clips, move all clips containing
any part of the selection.  (As horizontal dragging does.)  Even if these are
not all within the same stereo track.

I implemented this rule:  If any clip moves up (or down) by n audio tracks
(not counting the label tracks), all clips must move the same number, and
all must move from mono to mono or left to left or right to right.  If that
is not possible, no move happens.
2016-01-24 23:08:10 -05:00
David Bailes ba3b1b14ae possible fix for bug 1250
Go back to having both mono and stereo items in track menu.
2015-10-26 10:17:07 +00:00
Leland Lucius 2d88ad63e0 Fix for bug #1191 2015-09-08 11:24:59 -05:00
Paul Licameli f24742acc0 Be sure to refresh scrub speed display when wheel moves but pointer does not 2015-09-04 20:52:26 -04:00
Paul Licameli 05de64e251 Remove unused fns; fix missing & misspelled headers in make & project files 2015-08-30 13:19:08 -04:00
Paul Licameli 01fe404a02 Move track permuting details out of TrackPanel.cpp 2015-08-29 13:46:35 -04:00
Paul Licameli f49dbae9e2 Move minimize and close details out of TrackPanel.cpp 2015-08-29 13:46:26 -04:00
Paul Licameli 45e91f165a Move gain and pan details out of TrackPanel.cpp 2015-08-29 13:46:16 -04:00
Paul Licameli 6bfd3ee54a Move Mute and solo details out of TrackPanel.cpp 2015-08-29 13:45:51 -04:00
Paul Licameli e7482c74bd Move cursor moving functions out of TrackPanel 2015-08-27 21:22:41 -04:00
Paul Licameli 5697f77a06 pull out a function for vertical ruler wheel events 2015-08-27 12:55:24 -04:00
Paul Licameli 6c6fc360ca Put the scroll-beyond-zero flag in just one place, ViewInfo 2015-08-26 23:17:20 -04:00
Paul Licameli c45ea059e6 Reorder some things that happen in the track panel timer update. 2015-08-26 17:57:02 -04:00
Leland Lucius f6cbc5e6db Merged a couple of patches from Debian, one of which should fix bug #1147 2015-08-25 23:08:12 -05:00
Leland Lucius 6a9dae20f5 Appearance on OSX is now back to normal or better
Some additional wx3 cleanup as well.
2015-08-23 20:25:01 -05:00
Paul Licameli 1b8f44d053 ViewInfo does not redundantly (or inconsistently!) store the screen width 2015-08-21 22:39:18 -04:00
Paul Licameli a9ab31dedb Allow NULL arguments in TrackPanel::GetTracksUsableArea() 2015-08-21 12:02:48 -04:00
Paul Licameli e7c7bb84a9 Fix off-by-one width in TrackPanel::GetTracksUsableArea() 2015-08-21 11:49:49 -04:00
Paul Licameli 112d2a903b Rename View Settings... to Spectrogram Settings... and enable it only for...
... spectrogram views, and don't show the Waveforms page.
2015-08-19 10:21:04 -04:00
Paul Licameli 409cbb2996 Bugs 994, 1030: Scrubbing behavior with pointer outside of the track panel...
... first: suspend scrubbing only when the application is deactivated -- not
necessarily when track panel loses focus; resume when reactivated.

second: click and drag to seek happens only when the pointer is in the track
panel, and either over a wave track, or over no track.
2015-08-18 11:06:53 -04:00
Paul Licameli cf45a58fdc dB range is now in Waveforms preferences and view settings, and ...
... the preference is independent of those in Interface and Recording
preferences, which affect meters, sound activated recordings, time track,
and Plot Spectrum
2015-08-15 18:07:29 -04:00
Paul Licameli 5d2e877529 Scroll wheel with pointer in vertical ruler zooms in or out for wave track...
... regardless of the modifier keys; and does nothing in other tracks.
2015-08-14 20:34:06 -04:00
Paul Licameli 4cc064df8e Draw scrub speed like cursor or indicator: without a full refresh. 2015-08-13 19:49:09 -04:00
Paul Licameli 9ba6e03bd4 Reorganize code for drawing cursor and indicator, so it can generalize to...
... other things (like scrub speed)
2015-08-13 19:43:20 -04:00
Paul Licameli 5580aececc Untangle the control flow of mouse event handling in label tracks 2015-08-10 20:02:24 -04:00
Leland Lucius 300f0f05a0 Move TrackPanel keyboard handling out of AudacityProject...
...and into TrackPanel where it should be.
2015-08-09 18:26:29 -05:00
Paul Licameli 9a53625ceb Bug1134: Click and drag to move a track should make only one undo item 2015-08-08 18:55:31 -04:00
Paul Licameli b0de2fa900 Show only the channel-related menu items appropriate to mono or stereo, and...
... Changed accelerators to avoid conflict:
for mono tracks, R&ight
for stereo tracks, Split Stereo to &Mono
2015-08-04 13:00:46 -04:00
Paul Licameli eeaaadb530 Merge branch 'master'
* master:
  fewer #includes in TrackPanel.cpp
  Fix spacing on comment
  Add output gain control to Phaser effect
  Add output gain control to Wahwah effect
  Bug1115:  click below vertical ruler deselects track now, just as...
  Rename some variables
  Save overwrite choice in Export Multiple
2015-08-04 12:26:22 -04:00
Paul Licameli db896e6511 Revert "Show only the appropriate channel-related track menu items for mono or stereo."
This reverts commit 7b737a99c7.
2015-08-04 12:23:50 -04:00
Paul Licameli 971fd38615 Rename some variables 2015-08-03 13:50:49 -04:00
Paul Licameli 7b737a99c7 Show only the appropriate channel-related track menu items for mono or stereo. 2015-08-02 14:29:56 -04:00
Paul Licameli d6b76e3589 Revert "Make a Channels sub-menu, and change accelerators to be more mnemonic..."
This reverts commit cc08bba27a.

Conflicts:
	src/TrackPanel.cpp
2015-08-02 13:27:22 -04:00
Paul Licameli cc08bba27a Make a Channels sub-menu, and change accelerators to be more mnemonic...
... Also removes the conflict at top menu level over M accelerator.

Make one Channel sub-menu for mono and one for stereo, and swap correct one
in, whenever the parent menu opens.
2015-08-01 13:38:12 -04:00
Leland Lucius 7877615454 Move label context menu handling to label track
Application key now brings up the context menu while editing labels
as it should.  This wasn't possible with the old keyboard handling.
2015-07-30 10:38:03 -05:00
Paul Licameli fdf0759301 Bug1075, and define and use new event type for TrackPanel timer ticks...
... Thus allowing TrackPanel.cpp to work without including Lyrics headers.
Also eliminates some of its direct notification of MixerBoard.
2015-07-28 11:56:00 -04:00
Paul Licameli 4f0a2ee804 Bugs 1059, 1077: don't edit cut lines during play; show correct cursor...
... Don't show the arrow when in fact the click at the bottom of the track
will resize.
2015-07-28 11:55:59 -04:00
Paul Licameli 912cdb6c53 (most of) Bug 1077: Resizing cursor correctly appears, except...
... we still see an incorrect arrow cursor where the cutline meets the bottom
of the track.
2015-07-28 11:55:57 -04:00
Paul Licameli 7bba4500c4 Move mdBr from TrackPanel to ViewInfo, no more lookup of prefs in Envelope.cpp 2015-07-28 11:53:01 -04:00
Paul Licameli edba89d704 Pass tooltips by wxString, not const wxChar* 2015-07-28 11:49:56 -04:00
Paul Licameli 4a4918a3f8 More uses if IsUnsafe() or IsAudioActive() 2015-07-28 11:49:53 -04:00
Paul Licameli d8ce9f0d7d Move an array definition to Snap.h, use std::vector 2015-07-28 11:49:51 -04:00
Paul Licameli 87965cf164 Bug1076: Don't obliterate the point selection display during playback 2015-07-28 11:49:48 -04:00
Paul Licameli f81231efae Remove Sequence.h from other headers 2015-07-28 10:02:08 -04:00
Paul Licameli eaaab766db Remove WaveClip.h from other headers 2015-07-28 10:02:06 -04:00
Paul Licameli d39eaa4e65 Remove WaveTrack.h from other headers 2015-07-28 10:02:05 -04:00
Paul Licameli 11f794d3fb Menu items for zooming in vertical ruler popup for wave tracks...
May be good for discoverability of the click actions.
2015-07-28 09:37:00 -04:00
Paul Licameli 197700967f pop-up menus for vertical ruler 2015-07-28 09:36:58 -04:00
Paul Licameli 43b7df701b Use class NumberScale in TrackArtist and spectral selection, abstracting...
... the details of mapping to and from pixel height
2015-07-27 23:01:11 -04:00
Paul Licameli 1f6f43bba7 Track control "View Settings..." makes alternative SpectrumPrefs accessible 2015-07-26 21:33:14 -04:00
Paul Licameli 1dffeace93 Access SpectrogramSettings via WaveTrack, which may be nondefault (no UI yet)...
... and add accessors to SpectrogramSettings, and remove TrackArtist functions
for getting and setting the globals.
2015-07-26 21:10:16 -04:00
Paul-Licameli 5418ce377b Move PositionToTime, TimeToPosition into class ZoomInfo ...
... and use them in many more places in TrackPanel.cpp, so there are fewer
direct uses of ZoomInfo::zoom.

Also use then in horizontal scrolling code
2015-07-19 11:44:04 -04:00
Paul-Licameli ab21f75c77 ViewInfo is becoming a smart class, not a dumb struct
Now it has:
A constructor
XML attribute serializer functions (but no XML tag of its own)

Also removed unused lastZoom
2015-07-19 11:43:59 -04:00
Paul Licameli 0bed89419f More for bug 1014: stop scrubbing when switching out of select tool...
... Verified that this works for presses on tool buttons, and keys A, D, F1,
..., F6.

Also fix conditional compilation with EXPERIMENTAL_SCRUBBING_BASIC not defined.
2015-06-08 09:56:17 -04:00
Paul Licameli f332df1f36 Pulled repeated code into a function; share some calcs with Envelope editor 2015-06-03 02:37:42 -04:00
Paul Licameli 85a533be79 Remove unused variables; fewer casts 2015-06-03 02:37:41 -04:00
Paul Licameli 4f5483b4af Scroll-seek improvements 2015-05-30 14:28:33 -04:00
Paul Licameli 6ae8a656ab Rewrote escape key handling, more like other Track Panel key handlers
... and removed some abandoned spectral editing code
2015-05-29 21:13:59 -04:00
Leland Lucius 0ef7ccb1d1 Fix permissions...not sure why this was happening though 2015-05-29 19:49:28 -05:00
Paul Licameli 8d2a29d376 Bug989, and scrub UI uses left button to seek, not Shift key
Updated mouse preferences and status bar message accordingly

Also, use the term "Scroll-scrub" in status bar and mouse preferences
2015-05-29 20:29:44 -04:00
Paul Licameli 9f2dfbc70b Revert "Bug990 (seek key reponsiveness), and, change Scrub UI again, so Ctrl key seeks."
This reverts commit 841bca36ea.
2015-05-29 19:45:43 -04:00
Paul Licameli 841bca36ea Bug990 (seek key reponsiveness), and, change Scrub UI again, so Ctrl key seeks.
Includes changes to Mouse Preferences and status bar messages.
2015-05-29 17:30:19 -04:00
Paul Licameli 6810095509 Removed some functions never called, code never reached, fields never used 2015-05-29 00:13:50 -04:00
Paul Licameli e60057fd85 Bug924, addendum: pause scrubbing when Audacity loses focus...
... And it resumes if Audacity regains focus.

Actually this fix causes pausing and resuming depending on whether Track Panel
has focus, so clicks in other parts of the Audacity window may also pause the
scrubbing.  I hope that is acceptable.
2015-05-27 20:14:32 -04:00
Paul Licameli f07a487e47 Bug977: Enable new scrolling limits as a Tracks preference, default off. 2015-05-27 18:47:03 -04:00
Leland Lucius 8f77334286 Fix for bug #949
This removes the TrackInfo's slider "cache".

Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session.  So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.

But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.

In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess).  Unfortunately, it
didn't really handle large number of tracks and this bug was born.

While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything.  Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.

So, I've removed the cache and have allocated a single gain and a
single pan slider.  As before, their position and value are changed
as needed when drawn and manipulated.
2015-05-24 22:54:10 -05:00
Paul Licameli 35ac843baf Scrub with ctrl-left clicks, not middle drags; also fix bug 937
Bug 937 was a consequence of mouse capture for drag, which no longer happens.

Scrubbing starts with ctrl- (or cmd-) left- (double-) click, after which mouse
movement and shift key and scroll wheel (undepressed) govern scrubbing.  No
buttons need be held.  Another ctrl/cmd-left click can stop scrubbing, and so
can SPACE or Stop button or other commands that stop normal playback.
2015-05-19 12:03:04 -05:00
David Bailes 593197c2db add commands for moving focused track up, down, to top, and to bottom 2015-04-24 16:19:28 +01:00
Leland Lucius ed79e13fbf Merge pull request #36 from DanWin/performance
Performance improvements
2015-04-24 07:52:38 -05:00
David Bailes 0b2d5729c5 added two commands to move to first or last track 2015-04-24 11:38:55 +01:00
James Crook 593cc6ee5e Bug 855 - Data loss sample editing (Do/Undo)
I've added code that now treats sample editing as another kind of mouse capturing activity (IsAdjustingSample).  We will now not undo or redo whilst mouse is captured.  Does not depend on what key binding is used for redo/undo.
2015-04-24 09:55:03 +01:00
Daniel Winzen 92d522132e Variable cleanup 2015-04-23 18:30:38 +02:00
Daniel Winzen 759ff8cd0d Performance improvements 2015-04-23 16:07:25 +02:00
Steve Daulton e45afbaa76 A few minor fixes to Quick-Play (now hyphenated for consistency). 2015-04-21 20:46:52 +01:00
Paul-Licameli 10e35bb6bb Add user interface for scrubbing and Experimental.h switches
EXPERIMENTAL_SCRUBBING_BASIC enables middle-click-drag to scrub, or to seek
when shift is down.

EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL adds middle-double-click-drag to
scrub or (with SHIFT down) to seek while keeping the playhead at the midline
of the track display.

EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL allows control wheel to vary the speed
limit, while scrubbing (not seeking).

All three are enabled in this commit.

Also notice the changes to status bar messages and the Mouse Preferences dialog.

Scrubbing works only in Select and Multi tools.
2015-04-17 14:09:35 -04:00
Steve Daulton 702d9d75e5 Timeline Quick Play bug fixes and enhancements 2015-04-17 17:52:13 +01:00
Paul-Licameli 21fd4ab374 Remove the unsuccessful scrubbing experiment of 2.0.6. 2015-04-17 02:25:26 -04:00
Paul-Licameli 69729c2960 ESC key aborts selection drag, restores time, frequency selection, selected tracks 2015-04-12 12:39:11 -04:00
Paul-Licameli db1cb406e0 ESC key aborts resizing of mono track, stereo track, or channels of stereo track
Resizing may un-minimize a track; I was careful to be sure ESC restores
minimized state too and then that un-minimizing restores correct height
2015-04-11 23:53:34 -04:00
Paul-Licameli 903fcb1fc2 ESC key can abort certain dragging actions
For now, let it abort vertical scale zoom
(any mouse button in any tool, in the vertical ruler)
and horizontal zoom
(any mouse button in the zoom tool or right mouse button in the multi tool,
in the wave display)

Should any other drags be escapable too?
Time shifting?  That would need some more work to restore initial state.
2015-04-09 15:50:04 -04:00
Leland Lucius 2457579091 Bug 765 - Delays using Edit commands and Draw Tool in long projects
A 4hr track used to take about 20s to cut a few samples. This is now significantly improved, to around 3s. Leland did this by

(a) moving the size calculation to when we examine the undo history, so it isn't slowing down the edits.
(b) in size calculation, using sizes that are cached rather than going to disk to find the sizes.
(c) writing the autosave file which is to an FFIle to a string first, i.e. using XMLStringWriter as a buffer for XMLFileWriter.

Step (c) may also make autosave marginally safer, as the risk of a partially updated autosave file is reduced.
2015-04-07 12:20:50 +01:00
lllucius 2c6401b564 Committing Paul's spectral nagivation commands patch
From:

http://audacity.238276.n2.nabble.com/Patch-spectral-peak-snapping-navigation-commands-td7565648.html
2014-12-22 08:03:41 +00:00
james.k.crook@gmail.com c71397beae Changes to seeking and scrubbing from Paul Licameli.
These are mostly under an EXPERIMENTAL_ #ifdef.  Also has a change for the prompt string for preferences so the displayed keybinding is adjusted when in multitool mode.
2014-11-29 22:09:57 +00:00
james.k.crook@gmail.com 30500b2e85 Fix for http://bugzilla.audacityteam.org/show_bug.cgi?id=792 "Right end of selection cannot be adjusted with a mouse when left end is behind zero" by Paul Licameli. 2014-11-29 17:10:56 +00:00
james.k.crook@gmail.com 2131568876 Spectral Selection Toggle (using q key) by Paul Licameli. 2014-11-29 16:53:28 +00:00
martynshaw99 bc6583b62d Paul L's patch to remove the 'PlaybackCursor' that he introduced, along with a ststus bar message about it. Also fixes L/R cursors with a point selection. 2014-11-25 23:37:40 +00:00
james.k.crook@gmail.com 1933070f0d Tweak to spectral selection behavior when one edge is tied.
Idea by Martin.  Implemtation by Paul Licameli.
2014-11-11 15:24:22 +00:00
james.k.crook@gmail.com 67d2b274e2 Frequency Selection toolbar from Paul Licameli.
Linux/Mac will need new files adding to project, SpectralSelectionBar.cpp, NumericTextCtrl.cpp.
2014-11-08 15:18:43 +00:00
james.k.crook@gmail.com 6112a2a8c1 Spectral selection cursor and mode selection changes from Paul Licameli.
This also now shows a new green 'play cursor' when ctrl is held down on wave track, and shift being held down is signalled by a cursor change to finger-pointer too.

I also accidentally enabled EXPERIMENTAL_MIDI_OUT.  We may disable that in December for release.  Leaving it in for now.
2014-11-08 14:30:19 +00:00
james.k.crook@gmail.com 31fa2be749 Clean up of some spectral selection code making it shorter, clearer and easier to check.
Also added non-shift behaviour for shift and drag center line, that previously asserted.
2014-10-26 10:11:35 +00:00
james.k.crook@gmail.com 290a0107c9 Patch from Paul Licameli Improving Spectral Selection
ESC Key toggles snapping of center frequency to peaks (no visual indication of snap to yet)
Description added to mouse prefs - fix later.

Shift now required to keep top/bottom frequency pinned whilst (re)dragging the other one.

Code for status bar messages simplified and made more consistent, and no longer hard codes assumption that preferences is Ctrl-P when prompting user about it.
2014-10-25 22:05:45 +00:00
james.k.crook@gmail.com bffa710ce4 Removed TrackPanel:: prefix so can compile under Linux. 2014-10-18 18:36:34 +00:00
james.k.crook@gmail.com a6f9f6bc58 Spectral Editing: Using subroutines to shorten code, and more comments in the code. 2014-10-18 16:01:50 +00:00
james.k.crook@gmail.com 37608c2290 Paul Licameli's Spectral Editing Patch.
This relies on three new nyquist scripts to actually do the editing.  The peak-snapping code in FrequencyWindow has been extracted into a new class, SpectrumAnalyst, to provide peak-snapping in spectrogram too.
2014-10-18 14:19:38 +00:00
james.k.crook@gmail.com f5e593cc4c Paul L's new SelectedRegion class replacing use of t0 and t1. Also LabelTrack.h no longer in TrackPanel.h includes.
This change is believed to be a direct refactoring that does not change functionality.  It paves the way for more complex kinds of selection, such as selections involving frequency as well as time.  It also reduces risk of left and right edges being swapped in future code using SelectedRegion, as the default is to swap on assignment if needed.
2014-10-05 17:10:09 +00:00
lllucius 96324b5520 Add "Delete Label" to right click when editing labels. 2014-07-12 14:26:07 +00:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
martynshaw99 65e4f56126 Norm's patch to improve selection speed on large projects by reducing the number of unnecessary auto-saves. Maybe vertical zooming should also not trigger an auto-save? 2013-12-30 00:41:18 +00:00
v.audacity a68955a0dd Steve's patch for http://bugzilla.audacityteam.org/show_bug.cgi?id=675, "Additional Track Drop-down Menu commands" 2013-11-03 01:17:58 +00:00
RichardAsh1981@gmail.com be4f39c9c7 refactor the construction of the track pop-down menu into a function to avoid repeating the code multiple times to do the same thing. This makes extending the track pop-down menu, and eventually breaking this class up, much easier 2013-10-30 22:07:06 +00:00
lllucius 71fde85bfe Bug 115 - Snap-to causes spurious 'toolbar' to appear momentarily at start of dragging.
Completes James' TimeConverter work

This completes the work that James started.  It moves most of the non-GUI
related processing from TimeTextCtrl to James' TimeConverter class.

Other changes include:

1)  TimeTextCtrl now expects the format name instead of the format string to be
passed when creating a new instance.  I found that almost all cases created the
instance with a blank format string and then set the string after creation.

2)  To simplify maintenance and prevent a possible discrepancy between the two,
Increase() and Decrease() were merged into a single routine.

As a result:

1)  All cases where a TimeTextCtrl was being used to extract information and
not actually display a control have been changed to use TimeConverter instead.

2)  All cases where TimeTextCtrl was being created with an empty format and
then immediately followed by something like this:

    tt.SetFormatString(tt.GetBuiltinFormat(c->GetFormat()))

    have been changed to pass the format name instead of the format string when
creating the TimeTextCtrl instance.
2013-10-23 21:01:52 +00:00
lllucius 03f5088b6a Bug 406 - Label creation/other non-dialogue editing and keyboard selection hang on long projects
This is part 1...

Provides some relief to the selection "hang"

This patch adds the ability for the keyboard based commands (like cursor left,
extend selection right, etc.) to know when the key has been released.

When the patch is applied the current state is saved only when the key is
released and not every time it repeats.

Here's an example of the difference it makes.

This video show the selection "hang", but also watch the CPU usage.  All I'm
doing is pressing SHIFT+RIGHT ARROW.

http://youtu.be/tdMntDwGSkM

This one is the same thing bug with the patch applied.  Notice that the
selection "hang" no longer occurs and look at the CPU usage!

http://youtu.be/EpXNsQ4Cky0
2013-10-23 18:01:14 +00:00
v.audacity 7a4a3e3951 Handle Alt key down events, specifically for draw tool. 2013-08-09 01:03:34 +00:00
martynshaw99 f209391d59 John (Thales) code to make the waveform display look like the output of the gain and pan sliders, rather than the input. Added as EXPERIMENTAL_OUTPUT_DISPLAY since there is work to do, but I think this deserves wider input/views. 2013-05-30 23:14:25 +00:00
v.audacity 9d0daf8662 Campbell Barton's patch to turn many, many tabs to our 3-space convenbtion 2013-02-20 23:42:58 +00:00
richardash1981 55be06c9e4 commit a large patch by Maarten Baert maarten-baert<at>hotmail<dot>com to fix and improve time track support. Several fix-me issues remain but none are new with this patch. 2012-12-19 21:49:25 +00:00