Commit Graph

874 Commits

Author SHA1 Message Date
Paul Licameli 96f29e0cd0 Don't forget to modify undo state when toggling a sub-view 2020-01-18 14:40:24 -05:00
Paul Licameli 6eb0f3aca1 Move SpectrumAnalyst into its own files...
... It's the pure calculation common to the Plot Spectrum window and
to spectral editing

This removes some dependencies on FreqWindow
2020-01-18 13:38:19 -05:00
Paul Licameli 72f20d9129 Change cursors for rearranging of tracks...
... To be consistent with the rearranging of sub-views, and with general UI
guidelines.

The hover cursor is an open hand, and the dragging cursor is the closed hand.
2020-01-18 13:03:11 -05:00
Paul Licameli 000d63c95e Widen the hot zone for sub-view rearrangement...
... so it's wider than the close button
2020-01-17 16:14:23 -05:00
Paul Licameli f10b303279 A close box button for sub-views 2020-01-17 16:10:46 -05:00
Paul Licameli 0f3f13502c Fix hot zones of sub-view cursors...
which got broken at 876cd92ed3

And remove duplicate function
2020-01-17 16:04:45 -05:00
Paul Licameli 851b49d912 Avoid churn of handles for sub-view adjustment and rearrangement 2020-01-17 15:53:33 -05:00
Paul Licameli b45e3e8aac Separate default waveform scale choice in Tracks preferences...
... Some complications in handling correct migration of preferences from
config files in older versions
2020-01-17 12:28:52 -05:00
Paul Licameli 6c3731061f Switch priority of adjust and rearrange hit tests for sub-views 2020-01-17 11:03:25 -05:00
David Bailes 64079c3f55 Keyboard scrubbing: faster change of direction
If one of the keyboard scrubbing keys is being held down, and the other keyboard scrubbing key is pressed:
1. With current behaviour, scrubbing in the other direction only starts when the original key is released - scrubbing stops and then starts in the other direction.
2. With the new behaviour, scrubbing immediately changes direction, and does not stop when the original key is released - scrubbing does not stop and then start again.

New behaviour:
If one of the keyboard scrubbing keys is being held down,
2020-01-17 09:32:17 +00:00
Paul Licameli 6fd29ad863 Restrict y coords of the hot zone for the new sub-view rearrangement 2020-01-16 15:01:52 -05:00
Paul Licameli a95838a3e8 Better cursors for sub-view rearrangement 2020-01-16 12:06:59 -05:00
Paul Licameli a1ef73398b Implement click and drag to rearrange sub-view permutation...
... The hot zone is 15 pixels wide at the left of the track contents, and the
cursor is a hand.  Those particular choices can be easily amended.
2020-01-15 13:50:28 -05:00
Paul Licameli 1fa41808c2 Some refactoring of SubViewAdjustHandle 2020-01-15 13:44:10 -05:00
Paul Licameli 94af81b9f7 Fix Ubuntu build 2020-01-15 11:08:17 -05:00
David Bailes 6b9c8e79cc Bug 1954: Clicks may occur starting/pausing play-at-speed or Scrub
Problem:
On Windows, after 50ms, there is a short period of roughly zero introduced into the output. On Linux, there is also a spike which sounds like a crackle.

In AudioIO::FillBuffers(), Mixer::SetTimesAndSpeed() is called, which sets mT0 and mT1 to a small interval.
In Mixer::MixVariableRates(), all the samples in the interval are used, which means the Resample::Process() is called with last equal to true.
So when Mixer::MixVariableRates() is called again, the resampler is being reused after a call to Process() in which last is true.
It is not stated in the soxr documentation if the resampler will produce valid results in this case, and it's only the scrubbing code which does this.
I think this is the problem, and so the partial fix below avoids this happening.

Partial fix for play-at-speed and keyboard scrubbing:
For these, there is no need to reset the values of mT0 and mT1. (There is no need to allow for the sample position being used to potentially jump around.)
So for these cases, Mixer::SetSpeed() is called, rather than Mixer::SetTimesAndSpeed().
2020-01-15 11:12:40 +00:00
Paul Licameli cbe4a46af2 Bug2265: Should save and restore track heights...
... Regression happened at 3f1fd8ced0

The heights were written to file, but not read back again.

This fix was done carefully to avoid making dependency cycles.  We don't want
Track to depend on TrackView or TrackControls.

It's not great that LabelTrack, NoteTrack, TimeTrack, and WaveTrack now have
those dependencies, but at least they don't make cycles.

It would be better to figure out how to attach the view and controls to the
track with ClientData, then just invoke BuildAll to repopulate the view and
controls, so that they are non-null when you reach
Track::HandleCommonXMLAttribute.
2020-01-14 20:04:32 -05:00
Paul Licameli 9e0372cbea Bold, clickable, butting clip boundaries also in spectrum view 2020-01-14 15:16:30 -05:00
Paul Licameli 97b7572504 Stroke clip edges in spectrum views too, improving split appearance 2020-01-14 14:37:54 -05:00
Paul Licameli 98bd937389 Add the multi-view menu item only if there are multiple sub-views...
... anticipating possible subtraction of all spectrogram code into an optional
plug-in in a later release
2020-01-14 14:06:22 -05:00
Paul Licameli caf36b42ca 886c80b: Add a comment referencing the correct bug number, 2275 2020-01-13 17:51:27 -05:00
Paul Licameli 886c80bbca Bug2267 residual: do something about un-checking the last sub-view...
... when in Multi View mode.

And what we do here is disable the menu item.  The visible check indicates
which view is enabled, but you are not allowed to un-check it.  While the
Multi View item appears enabled and with a check mark.  That should be
suggestive enough to let the user discover how to exit multi view.
2020-01-13 17:48:18 -05:00
James Crook 1176b61953 Wording changes, per wiki:
https://wiki.audacityteam.org/wiki/Wording
2020-01-10 17:02:31 +00:00
Paul Licameli d28967b7ad Bug2275 residual: don't get into state where you can't select audio...
... if you enter multi-view, then (try to) toggle both sub-views off.

Now instead, the second toggling will have no effect.
2020-01-09 15:15:11 -05:00
Paul Licameli 4018546a96 A comment 2020-01-09 15:15:11 -05:00
Paul Licameli dd0e41048f Bug2282 residual: Partition sub-view heights 1:1 not 2:1...
... when doing steps to reproduce in that bug report
2020-01-09 15:15:10 -05:00
Paul Licameli 8fa01eceb4 Bugs 2282, 2275: crashes in multi-view...
... when you shrink a sub-view then toggle it, or toggle all views off then
exit multi-view

Fix it by making GetSubViews more robust to contents of mPlacements
2020-01-09 15:15:04 -05:00
Paul Licameli d01c24d4d6 Revert "Bug 2282 - Multi-view: Array out of bounds exception (crash)"
This reverts commit e047c07a90.
2020-01-09 15:12:00 -05:00
Paul Licameli da2f5491ae Revert "Bug 2275 - Crash when unchecking Multi-view with neither of the views checked"
This reverts commit 57ff92b20c.
2020-01-09 15:12:00 -05:00
Paul Licameli d50dae4dd2 Bug2279 fix reimplemented...
... Don't hard-code the number of sub-views as two.

This modifies the fix at commit 596fd7c02f
2020-01-09 14:01:12 -05:00
James Crook 57ff92b20c Bug 2275 - Crash when unchecking Multi-view with neither of the views checked 2020-01-09 15:56:00 +00:00
James Crook e047c07a90 Bug 2282 - Multi-view: Array out of bounds exception (crash) 2020-01-09 15:13:36 +00:00
James Crook 596fd7c02f Bug 2279 - Multi-view: turning it on does not cause a split Multi-view to be displayed 2020-01-09 14:04:31 +00:00
David Bailes d22edcbc10 Keyboard scrubbing: change some of the parameters
Changes to some of the parameters, based on user feedback.
2020-01-08 09:05:53 +00:00
Paul Licameli e2adccb461 Don't use GetActiveProject drawing pan, gain, velocity sliders 2020-01-06 14:14:21 -05:00
Paul Licameli d244b55709 Don't use GetActiveProject when drawing label track 2020-01-06 14:14:21 -05:00
Paul Licameli f0b75832b4 Remove uses of GetActiveProject in some dialogs 2020-01-04 13:55:34 -05:00
Paul Licameli c3b32d1106 Remove GetActiveProject where finding track panel button tooltips 2020-01-04 12:59:37 -05:00
Paul Licameli 9029eee5bd Remove GetActiveProject from SelectHandle 2020-01-04 12:59:37 -05:00
Paul Licameli c9a9c06bd0 Pass AudacityProject * into preference panel factories 2020-01-04 12:37:57 -05:00
Paul Licameli 92b857d551 Remove unnecessary const_cast 2020-01-04 11:59:44 -05:00
Paul Licameli dffe3155b0 Pass AudacityProject & into ButtonHandle::Tip 2020-01-04 11:27:28 -05:00
Paul Licameli f64bc5a829 Pass non-const AudacityProject to HitTest::Preview...
... because that will be needed for elimination of some GetActiveProject()
calls.  Because some overrides need to find the focused track, but that may
mutate the project by setting the focused track when it wasn't yet defined.
2020-01-04 09:40:33 -05:00
Paul Licameli db6265d4e7 Fix build 2020-01-03 10:14:12 -05:00
Paul Licameli 4a5abc9e41 Pass AudacityProject* to more methods of UIHandle 2020-01-03 10:09:46 -05:00
Paul Licameli 83f7bc6b5c Eliminate some uses of GetActiveProject...
... where there was already a project at hand
2020-01-02 13:15:14 -05:00
Paul Licameli fce85d0e56 Don't use GetActiveProject in track panel pop-up menu handlers 2020-01-01 22:06:16 -05:00
Paul Licameli 7dbca958a6 CellularPanel passes AudacityProject* to DoContextMenu() of cell 2020-01-01 21:57:39 -05:00
Paul Licameli 12bbafe013 Separate storing of user data from initialization of popup items 2020-01-01 21:54:45 -05:00
Paul Licameli 0256156dec Implement Multi View checkbox menu item in wave track TCP...
... When it's off (default), Spectrum and Waveform buttons behave as before,
and dragging of the sub-view separator is disabled.

When it transitions to off, and the view is split, then the top sub-view takes
up the whole view.

When it transitions on, nothing visible happens.

When it is on, and you choose Spectrum or Waveform, then the corrsponding
sub-view toggles visibility.

When a sub-view is turned on by the menu item, it appears lowest.
2020-01-01 15:37:49 -05:00
Paul Licameli 00661d273a Scale choices at the top of the Waveform pop-up menu...
... as they have been in the menu for spectrum
2020-01-01 12:05:14 -05:00
Paul Licameli 389d04459a Move choice of waveform scale from TCP menu to ruler context menu 2019-12-31 19:26:51 -05:00
Paul Licameli 917e84f382 Implement double-click at the view separator to split view evenly...
... And this can even change an unsplit view to evenly split when you get the
 cursor near the top or bottom
2019-12-31 11:21:28 -05:00
Paul Licameli b747e88304 Bug2256: complete the fix, see 17ed489 2019-12-30 23:11:55 -05:00
Paul Licameli 17ed4899ec Bug2256: Resizing channels should not change subview proportions 2019-12-30 17:38:07 -05:00
Paul Licameli 0c44d0f7d3 Bug2244: need a distinct cursor for adjustment of split views...
... Adapted from the bandwidth adjustment cursor for spectral selection, with
reversal of white and black, so the new ones are white around black
2019-12-30 15:18:31 -05:00
Paul Licameli c882564994 Move drawing of TrackName from the subview to VRulersAndChannels...
... And thus do it only once per channel (i.e. once per set of sub-views)
2019-12-29 15:31:03 -05:00
Paul Licameli 6e14d2e56c RulerPanel uses TranslatableString for units string...
... also fixing missed translation of "k" in spectrum vertical ruler
2019-12-28 23:49:18 -05:00
Paul Licameli 259359a283 Update some calls expecting TranslatableString in disabled code 2019-12-28 23:49:14 -05:00
Paul Licameli 8905e52ee0 Override TrackPanelDrawable::DrawingArea() properly for track names 2019-12-28 13:36:47 -05:00
Paul Licameli 71b3fc0647 Factor rectangle computation out of DrawTrackName 2019-12-28 13:36:47 -05:00
Paul Licameli a65ab2146b Rewrite DrawTrackName with fewer magic numbers, rename variables 2019-12-28 13:36:47 -05:00
Paul Licameli 7c70d78430 Pass TrackPanelDrawingContext into TrackPanelDrawable::DrawingArea() 2019-12-28 13:36:46 -05:00
Paul Licameli 996d60de81 Remove undefined member function 2019-12-28 13:36:46 -05:00
David Bailes 3a453126e8 Keyboard interface for scrubbing
- There are two new commands: Scrub Backwards and Scrub Forwards.
- These commands appear on the Transport sub menu of the Extra menu.
- The commands have default shortcuts U and I, and are in the standard default set.
- After pressing one of the two keys, playback continues until the key is released. (Note that this means that the command on the  Extra > Transport menu can't actually be used for scrubbing as it executes a KeyDown immediately followed by a KeyUp, but the menu items are needed so that the current keystrokes can be seen and changed.)
- Playback starts from the cursor position, or the start of a time selection if there is one.
- The speed of playback is determined by the zoom level. If the zoom level is normal, then the playback speed is one quarter of the normal playback speed. Zooming in (Ctrl + 1), halves the playback speed, and zooming out (Ctrl + 3) doubles the playback speed. There are minimum and maximum playback speeds of one sixteenth, and four respectively.
- You can scrub to the end of the audio, even if there is an initial selection. In other words, scrubbing forwards does not automatically stop at the end of the selection.
- Normally, when one of the keys is released, the position of the cursor is set to the time when the key was released.
- If during the time one of the keys is pressed the left bracket and or right bracket keys are pressed to set the start and/or end of the selection, then when the scrubbing key is released, the change to the selection made by pressing the bracket keys is preserved - the position of the cursor is not set to the time when the key was released.

This implementation is affected by two existing bugs:
1. Bug 1954 - Clicks may occur starting/pausing play-at-speed or Scrub. (See comment 19 and attached image).
2. Bug 1956 - Windows: MME and WDS playback cursor is buffer length ahead of actual audio playing. This means that on Windows, WASAPI is preferable if scrubbing is being used for the accurate positioning of the cursor.
2019-12-26 10:04:34 +00:00
Paul Licameli d1637c22c0 TranslatableString for explicit prompts and units in ShuttleGui 2019-12-23 19:22:03 -05:00
Paul Licameli acd1158e1b TranslatableString for titles, and spin control and combo prompts 2019-12-23 18:53:00 -05:00
Paul Licameli 5168d62e3d TranslatableString for captions of text entry boxes 2019-12-23 18:53:00 -05:00
Paul Licameli 89a3771730 TranslatableString for AudacityTextEntryDialog message and caption 2019-12-21 11:23:32 -05:00
Paul Licameli f56d76cdb5 Correct one commented-out override of GetDescription 2019-12-21 00:44:11 -05:00
Paul Licameli 49cab86fc1 TranslatableString for tooltips and status bar messages 2019-12-20 21:54:49 -05:00
Paul Licameli dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -05:00
Paul Licameli e3ea93a624 Define and use function Verbatim...
... in cases of "TranslatableString" that are not really translated.

This makes it easier to scan the code for such unusual constructions of
TranslatableString, distinct from mere mentions of the TranslatableString type.
2019-12-19 22:49:23 -05:00
Paul Licameli a70524446e TranslatableString for title prefix in PrefsDialog...
... and the title strings do not include a trailing space
2019-12-19 22:37:21 -05:00
Paul Licameli 91ebadef81 Rewrite one more PushState that is ifdef'd out 2019-12-19 22:27:35 -05:00
Paul Licameli 6b812791a6 TranslatableString in popup menu tables 2019-12-16 15:10:35 -05:00
Paul Licameli 4eb220e7b9 TranslatableString for undo history short and long descriptions 2019-12-16 14:19:23 -05:00
Paul Licameli 54e2bbd8ff Remove TranslatedInternalString, use ComponentInterfaceSymbol 2019-12-16 10:58:05 -05:00
Paul Licameli 681950fc61 TranslatableString for names, labels, tooltips of wxPanelWrapper...
... and Grabber too
2019-12-16 10:58:05 -05:00
Paul Licameli 53ee9c9800 TranslatableString for titles, names, labels of wxDialogWrappers...
... Found one missed translation in CommandTargets.cpp
2019-12-16 10:58:05 -05:00
Paul Licameli a8de4d9e50 Construct MenuItem with untranslated label, so it can be static...
... and other storage of TranslatableString instead of naked wxString, for
management of menu items, in CommandManager
2019-12-12 15:49:00 -05:00
Paul Licameli 70ec69fa3d Pass untranslated command labels to CommandManager...
... and deduce whether to exclude from macros inside NewIdentifier, simplifying
argument lists further

Also fix the localization of "..." added to names by PluginMenus.cpp
2019-12-12 15:15:59 -05:00
Paul Licameli 0cf90d65e6 S.GetParent() for all windows passed to ShuttleGui::AddWindow()...
... Verified that this makes no real change.
2019-12-10 09:58:38 -05:00
James Crook 23f05c618c Fix signed/unsigned comparison warnings. 2019-12-06 11:33:22 +00:00
James Crook 7f3c40eb43 Fix class/struct warnings. 2019-12-06 11:32:17 +00:00
Paul Licameli ca70cc940f Don't concatenate ":" onto user-visible strings...
... include it in the msgid intead, to get appropriate translations.  For
instance some locales use the same character but prefer to insert a space
before it.
2019-12-04 16:19:07 -05:00
Paul Licameli 96291c5476 Remove second argument of AddWindow(), use Position() instead 2019-12-02 22:01:22 -05:00
Paul Licameli 9eeef4713d Define and use ShuttleGui::Name and NameSuffix...
... For radio buttons, the name will default to the same as the prompt if not
otherwise specified
2019-12-02 16:55:46 -05:00
Paul Licameli 72df562c4a Conversion of TranslatableString to wxString is private 2019-12-01 18:17:57 -05:00
Paul Licameli e4a7c9ba5b Uses of TranslatableString as value of XO macro...
... It is not implicitly convertible from wxString, compelling many uses of
the new type to fix compilation.
2019-12-01 18:05:20 -05:00
Paul Licameli c707edad7a Don't lose split view after undo & redo, or an effect 2019-11-26 04:49:15 -05:00
Lars Wendler b280253e60 build: Fix bad include path
tracks/labeltrack/ui/LabelTextHandle.cpp:25:10: fatal error: ../../../images/Cursors.h: No such file or directory
     25 | #include "../../../images/Cursors.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2019-11-24 21:04:10 +00:00
Paul Licameli 54e0df5660 Implement a dragging handle to adjust wave track sub-view heights 2019-11-23 16:44:42 -05:00
Paul Licameli d26b55ee3c WaveTrackSubView has a back-pointer to the WaveTrackView 2019-11-23 15:27:04 -05:00
Paul Licameli af9959dc98 Rewrite WaveTrackView::GetSubViews to cache last computed heights 2019-11-23 15:02:09 -05:00
Paul Licameli 125b8ad0da Wave track context menu has non-exclusive check items for display type 2019-11-23 14:57:29 -05:00
Alexander Tsoy 7a91b6c5e9 Fix compilation without USE_MIDI 2019-08-28 00:17:39 +03:00
James Crook 06af0c6296 Bug 803 - Incorrect pointer (cursor) when rearranging tracks
There is no wxCURSOR_REARRANGE so made a custom cursor instead.
2019-08-18 14:47:17 +01:00
David Bailes 664452b1a8 Bug 2183 - Characters in labels cannot be deleted
Fix: update the actual label (labelStruct is a copy).
2019-08-03 09:13:53 +01:00
Paul Licameli 05997dc267 Bug2180: complete the fix...
... Don't forget the unbinding of the event handler

See previous commit, e589ed8ecf
2019-08-01 06:33:52 -04:00
Paul Licameli e589ed8ecf Bug2180: Type-to-create labels twice should work...
Bug began at 0750f62e88

Track::SetSelected is virtual, after all, but then LabelTrack informs
LabelTrackView of selection changes by events, so that LabelTrack remains
independent of LabelTrackView.

This might make much of the rest of the guily commit unnecessary (the resetting
of selected index to -1 only lazily), but it is harmless.
2019-07-31 16:40:16 -04:00
Paul Licameli a87748b123 spelling 2019-07-29 15:41:07 -04:00
David Bailes ee46155d82 Bug 2176 - Crash when attempting to time shift multiple tracks
Steps to reproduce:
1. create a new project in Audacity
2. add several tracks.
3. turn on Sync-Lock (Tracks, Sync-Lock Tracks checked)
4. Click on the Time Shift Tool.
5. Attempt to move tracks to the right (for example), clicking in the bottom track
6. It crashes.

In the function: void TimeShiftHandle::CreateListOfCapturedClips(), the problem was the first occurrence of the line:
auto &trackClip = state.capturedClipArray[i];
The subsequent call to AddClipsToCaptured(), can reallocate the array and so invalidate the reference.

Fix: Don't use a reference. (TrackClip is not a large object.)
2019-07-27 13:16:15 +01:00
Paul Licameli 960fe47412 Bugs2151,2156: playhead ruler overlay was leaving black marks behind 2019-07-26 11:57:30 -04:00
Paul Licameli 93bb862aa2 Remove unnecessary #include 2019-07-18 15:05:37 -04:00
James Crook 13348841c0 Bug 1780 - Sample Rate dialog does not appear when track has custom sample rate
With radio items there is no change event, if radio button was already chosen.
2019-07-17 20:14:01 +01:00
Paul Licameli 33f3d4b82d Heavyweight version of SelectedRegion stored in ViewInfo emits events 2019-07-17 12:43:39 -04:00
James Crook 2852d07a1e Fix build on Ubuntu 2019-07-16 08:09:33 +01:00
Paul Licameli e4d6e8569f Bug2144: track name should overpaint channel separator of minimized track 2019-07-14 07:15:26 -04:00
Paul Licameli beb378f61a Revert the change of radio items to check items at fa6b5de 2019-07-11 12:54:36 -04:00
Paul Licameli 633153c91f Delegate DoDetailedHitTest through base class WaveTrackSubView 2019-07-11 10:37:30 -04:00
Paul Licameli dd369da6a0 Define WaveTrackView::GetAllSubViews 2019-07-10 11:35:57 -04:00
Paul Licameli fa6b5dea88 Generalize WaveTrackView::GetDisplay to return multiple values...
... something better might be done in Nyquist Lisp, where we still pass a
single value
2019-07-10 10:19:04 -04:00
Paul Licameli 2f544bda7a Reimplement WaveTrackView::SetDisplay, eliminating mDisplay...
... and much generality for the future in reporting the sub-view division to
TrackPanel.

SetDisplay will have the effect of making one of possibly multiple views take
up all the height.  Where we need to save and restore or otherwise copy the
sub-views, there is more information now than just one enum value.
2019-07-10 10:10:41 -04:00
Paul Licameli 6ccca16a75 Move display type from WaveTrack to WaveTrackView 2019-07-09 20:09:59 -04:00
Paul Licameli c28e47bd38 Define static Get functions for WaveTrackView 2019-07-09 20:09:59 -04:00
Paul Licameli 99a1e5a11d Remove some unnecessary tests of WaveTrack::GetDisplay()...
... trust the hit-tests of the views to guarantee these conditions
2019-07-09 20:09:59 -04:00
Paul Licameli 3715c079b4 Test view class, not track display type, for spectral selection 2019-07-09 20:09:59 -04:00
Paul Licameli bac841f497 TrackView wasn't using TrackControls 2019-07-09 14:55:33 -04:00
Paul Licameli db16150366 Break cycle: TrackPanelResizerCell, TrackPanelResizeHandle, TrackView 2019-07-09 14:55:31 -04:00
Paul Licameli 7d75f1bfc4 Remove unnecessary #include 2019-07-09 10:55:18 -04:00
Paul Licameli d7a0fa72db WaveTrackView does not depend on SpectrumView, WaveformView 2019-07-09 10:23:49 -04:00
Paul Licameli 22dbe69f5c Remove friends 2019-07-09 09:51:37 -04:00
Paul Licameli 2bec03ac08 TrackView subclasses do not depend on corresponding TrackControls...
... use an AttachedVirtualFunction to compute the default view height from
the controls.

This frees LabelTrackControls from cycles.

Also made Track::DoSetHeight non-virtual
2019-07-09 00:05:01 -04:00
Paul Licameli 9ca295c9f7 Remove some unnecessary #include-s 2019-07-08 23:53:41 -04:00
Paul Licameli 51e0c2221f Remove duplicate call to DrawItems introduced at 488cb46 2019-07-08 22:13:51 -04:00
Paul Licameli fd7e06e458 Undo the temporary rewrites of WaveTrackView draw and hit-test...
... switching on display type and replicating what the sub-view classes did;
now these methods of WaveTrackView should not be reached
2019-07-08 11:44:44 -04:00
Paul Licameli 8d29746af9 Classes no more instantiated after previous commit become namespaces 2019-07-08 10:56:17 -04:00
Paul Licameli c7b888b903 WaveTrackView now delegates to the proper sub-view...
... by a redefined area subdivision policy in TrackPanel

So the SpectrumView, WaveformView, and associated ruler and handle classes
find real use, while WaveTrackView is really used only for its height and to
supply the delegate, and WaveTrackVRulerControls and WaveTrackVZoomHandle
are not used

There is also some anticipation of multiple track views
2019-07-08 10:27:43 -04:00
Paul Licameli ecbbf7afe8 Cut and paste spectrum and waveform views to new files 2019-07-08 10:27:41 -04:00
Paul Licameli 96e5525646 Fill in the methods for Spectrum & Waveform views...
... Keeping WaveTrackView functioning
2019-07-08 10:18:15 -04:00
Paul Licameli d36ce45381 Declare pointers to WaveTrack sub-views, with stub methods for now 2019-07-08 09:46:00 -04:00
Paul Licameli 28dcf45bbe Cut and paste spectrum and waveform vruler controls into new files 2019-07-08 09:46:00 -04:00
Paul Licameli 32ae2e718f Fill in the methods for Spectrum & Waveform VRuler controls...
... Keeping WaveTrackVRulerControls functioning
2019-07-08 09:46:00 -04:00
Paul Licameli cffbf6f401 Separate classes for waveform, spectrum VRulers, stub methods for now 2019-07-08 09:46:00 -04:00
Paul Licameli bc823294f2 Cut and paste waveform and spectrum vzoom handle functions 2019-07-08 09:46:00 -04:00
Paul Licameli d991295efb Implement classes SpectrumVZoomHandle, WaveformVZoomHandle 2019-07-08 09:46:00 -04:00
Paul Licameli f7dc21436d Separate functions for vertical zooming of spectrum and waveform 2019-07-08 09:46:00 -04:00
Paul Licameli fa7de8ce3a Remove always true third argument of WaveTrackVZoomHandle::DoZoom 2019-07-08 09:46:00 -04:00
Paul Licameli cbdf5f24fe New files to separate spectrum/waveform views and VRulers 2019-07-08 09:45:59 -04:00
Steve Daulton 7857769f96 Workaround for kDevelop crash
Thanks to PRL for the fix.
2019-07-08 00:38:19 +01:00
Paul Licameli 30be658b00 Remove some unnecessary #include directives 2019-07-07 15:16:19 -04:00
Paul Licameli e03c9cdee3 Two dependency cycles of two easily broken...
... WaveTrackVRulerControls and WaveTrackVZoomHandle;
NoteTrackVRulerControls and NoteTrackVZoomHandle
2019-07-06 13:47:11 -04:00
Paul Licameli 4a19a3625b Remove WaveTrackVRulerControls::DoZoomPreset...
... it became unused at 3797a5227a
2019-07-04 13:48:33 -04:00
Paul Licameli a3b434be1c Move the scrub mouse event handler into ScrubUI...
... Making Scrubbing independent of AdornedRulerPanel.cpp
2019-07-04 09:52:34 -04:00
Paul Licameli 8414ebffa5 ScrubbingOverlay declared and defined entirely within ScrubUI.cpp 2019-07-04 09:22:20 -04:00
Paul Licameli 24bd7cf571 New files for ScrubUI 2019-07-04 09:13:59 -04:00
Paul Licameli 8c59b6f1cf This call isn't needed to hide the quick play line at end of scrub...
see also commit e815949535
2019-07-04 09:00:09 -04:00
Paul Licameli 9faa746d4d Scrubber holds preference, AdornedRulerPanel updates in idle time...
... removing two uses of AdornedRulerPanel in Scrubbing
2019-07-04 08:59:57 -04:00
Paul Licameli 3c858dd343 Remove unnecessary button update of ruler from Scrubbing...
... this is a remnant of the abandoned experiment that put other buttons in
the ruler besides the pinned play head

See commit 6a3613e8e9
2019-07-04 08:58:36 -04:00
Paul Licameli eb4eba6325 AdornedRulerPanel updates its play region in idle time...
... Eliminating TP_DisplaySelection and making ProjectWindow independent of
AdornedRulerPanel
2019-07-03 23:38:33 -04:00
Paul Licameli 500ccb60b3 Free ControlToolBar from cycles. That's all the toolbars now! 2019-07-03 21:38:06 -04:00
Paul Licameli acfd2b7010 TrackFocus is a new attached object...
... removing the need to use TrackPanel to get and set the focused track

ProjectAudioManager loses its direct dependency on TrackPanel
2019-07-03 19:10:21 -04:00
Paul Licameli b6cd9a2b36 DoPlayStopSelect into ProjectAudioManager; remove button push-down...
... which was redundant with what happens in the yield to idle events in
ProjectAudioManager::Stop.

This removes direct dependency of ProjectAudioManager on ControlToolBar.

And remove another #include we don't need
2019-07-03 17:21:55 -04:00
Paul Licameli ca8740b510 StopIfPaused is now a member function of ProjectAudioManager 2019-07-03 17:00:08 -04:00
Paul Licameli 13c2e4de0f Move members from ControlToolBar into class ProjectAudioManager...
... and ControlToolBar is included in fewer places
2019-07-03 16:52:16 -04:00
Paul Licameli 1e4812f470 GetProjectPanel analogous to GetProjectFrame breaks dependencies...
... in places that need the TrackPanel but only to invoke common wxWindow
methods on it.

This eliminates direct use of TrackPanel by Scrubbing and ProjectWindow
2019-07-03 13:53:07 -04:00
Paul Licameli 52ff705b0d ScrollIntoView out of TrackPanel, into ProjectWindow 2019-07-03 13:32:32 -04:00
Paul Licameli 68999934e0 ProjectAudioManager doesn't use ProjectWindow, which doesn't use...
ControlToolBar, after we make a system to register functions that calculate
necessary minimum widths for status bar fields.

Also let Scrubbing.cpp register its own strings.

Also be sure to size the status field sufficiently for "Playing at Speed".
2019-07-02 21:01:54 -04:00
Paul Licameli 2a06b10884 Make objects attached to AudacityProject non-copyable...
... except for Tags; also some uses of final and explicit

This caught a mistake in Scrubbing.cpp
2019-07-02 19:51:24 -04:00
Paul Licameli a5364119eb Eliminate many calls to RedrawProject & TrackPanel::Refresh()...
... Let the window respond to an undo manager event instead, whenever there
is a push or modify

Maybe this makes a few unnecessary redraws that did not happen before.  If
that is important, then we should figure out how to put the logic for eliding
the redraw into ProjectWindow, and the extra information needed for the
decision into the events, but not make intrusions in other code all over the
place.
2019-07-02 08:17:01 -04:00
Paul Licameli 830f772625 Update Play button appearance in idle time...
... so most calls to ControlToolBar::SetPlay are removed.  One remains in
TransportMenus, which will not be problematic for untangling dependencies,
and one remains where the toolbar remakes its own buttons.

But the routines that start and stop the streams, importantly, don't use it.
2019-07-01 21:25:50 -04:00
Paul Licameli 923128731d Do not store pause state in ControlToolBar...
... Move that into ProjectAudioManager instead, and update the button, only to
reflect it, in idle time.

However, AudioIO also has its mPaused member variable, and it is not obvious
that it was always kept the same as the button state.  No attempt was made
here to identify and fix any bugs, but only to preserve behavior.
2019-07-01 19:48:52 -04:00
Paul Licameli 7d504ba015 ControlToolBar uses idle events to update status message for itself 2019-07-01 19:48:51 -04:00
Paul Licameli 192530d8a5 Free ScrubbingToolBar from cycles...
... by having it update itself in idle time, not needing a push from Scrubber

Shrinking that remnant of the big strongly connected component to 6
2019-07-01 08:43:27 -04:00
Paul Licameli 3e3cf24c01 Scrub & seek toolbar buttons disable during recording, as was intended 2019-07-01 08:42:57 -04:00
Pokechu22 22ce129f8d Misc. cleanup 2019-06-29 23:32:19 -04:00
Pokechu22 87bf94e811 Fix bug 2140 2019-06-29 23:32:19 -04:00
Paul Licameli 37f75d8049 Bug2141: Tabbing should work in focused label track, selected or not 2019-06-28 18:12:48 -04:00
Paul Licameli f77ddc43d9 Smuggle AudacityProject into LabelTrackView::GetSelectedIndex() ...
... and eliminate some more calls to GetActiveProject
2019-06-28 18:09:29 -04:00
Paul Licameli 30715e4fe2 Pass AudacityProject as context into TrackPanelCell key handlers...
... as was done for mouse events.

This eliminates some need for GetActiveProject(), which is good, and prepares
for the fix for bug 2141
2019-06-28 13:18:07 -04:00
Paul Licameli c50acea328 Bug2127: Record, Pause, Record, Pause, Close button: shouldn't crash 2019-06-28 10:51:41 -04:00
Paul Licameli b05acc32da Move drawing code for track names 2019-06-27 00:10:53 -04:00
Paul Licameli dc216d669b Move drawing code for snap guidelines 2019-06-26 23:39:42 -04:00
Paul Licameli 4633f4f9d4 Move drawing code for background below tracks 2019-06-26 23:39:42 -04:00
Paul Licameli f84d92f0a8 Move drawing code for zoom guidelines 2019-06-26 23:39:42 -04:00
Paul Licameli 488cb466c3 Move drawing code for track controls 2019-06-26 23:39:42 -04:00
Paul Licameli b45d1387dc Move drawing (and updating) code for vertical rulers 2019-06-26 23:39:42 -04:00
Paul Licameli 363f6f8b7b Move drawing code for background of vertical rulers 2019-06-26 23:39:42 -04:00
Paul Licameli e7c1f7424d Move drawing code for background of track control panel 2019-06-26 23:39:42 -04:00
Paul Licameli b881a6e918 Move drawing code for tracks, free EnvelopeEditor from cycles 2019-06-26 23:39:42 -04:00
Paul Licameli 868481b686 GetSceenEndTime out of TrackPanel 2019-06-26 21:25:15 -04:00
Paul Licameli d29d10d712 GetTracksUsableArea() out of TrackPanel 2019-06-26 21:25:15 -04:00
Paul Licameli f87dfd43c1 GetVRulerWidth, GetLabelWidth, GetLeftOffset out of TrackPanel.h...
... And some things demoted from ViewInfo to ZoomInfo, related to x coordinates
only
2019-06-26 21:25:15 -04:00
Paul Licameli 25f4d6cf8b TrackPanelAx does not depend on TrackPanel...
... TrackPanelAx now sends an event to the project when track focus changes,
and TrackPanel listens for it.

TrackPanel also initializes TrackPanelAx with a callback to do the details of
rectangle calculation.
2019-06-25 11:24:40 -04:00
Paul Licameli 7fc3c5e7a7 Move namespace TransportMenus into ProjectAudioManager.cpp ...
... not the best thing for the long term, but hidden dependencies on
TransportMenus.cpp are eliminated

Tying CommonCommandFlags again into the big component, which is now 26
2019-06-25 00:14:53 -04:00
Paul Licameli d2f386a329 Move functions into new file TrackUtilities.cpp ...
... so that other files do not have link dependency on TrackMenus.cpp

The new project enlargest the big s.c.c. by 1, to 25
2019-06-24 23:13:22 -04:00
Paul Licameli 02e620d35f Move functions into new file SelectUtilities.cpp ...
... so that other files do not have link dependency on SelectMenus.cpp

The new file enlarges the big s.c.c. to 24
2019-06-24 23:06:44 -04:00
Paul Licameli 5627620b78 Remove dependency of AudioIO on Scrubbing.cpp ...
... though the demotion of the constant into AudioIO.h isn't wholly satisfactory
and there is still the scrubbing queue in AudioIO
2019-06-24 12:52:54 -04:00
Paul Licameli 1d6ff11fec Fix #include paths 2019-06-24 12:41:25 -04:00
Paul Licameli ab5a98003a Free EffectManager and EffectRack from the big s.c.c. ...
... though in a small cycle with each other, by moving RealtimeEffectManager to
new files, which remain in the big component.

Net loss of 1, the big component now has 27 files
2019-06-24 00:49:12 -04:00
Paul Licameli 04a3ed9d04 Separate class RealtimeEffectManager 2019-06-24 00:37:02 -04:00
Paul Licameli 86320838de WaveTrack.cpp does not depend on ODManager.cpp ...
... Breaking up an s.c.c. of 6 into 3 components:
ODManager, ODTask, ODWaveTrackTaskQueue
UndoManager
WaveClip, WaveTrack

Rewrite the OD tasks and queues to hold weak pointers to tracks, so the
track destructor need not notify them.
2019-06-22 21:46:35 -04:00
Paul Licameli 9e731390f6 Don't define any Track members outside of Track.cpp 2019-06-22 21:46:33 -04:00
Paul Licameli dc9e436dde Change the track view copy function...
... It is const, renamed CopyTo, and invokes the create-on-demand factory in
the destination track; this means Track.cpp doesn't need to do that, and so
does not need TrackView.h
2019-06-22 21:46:33 -04:00
Paul Licameli 8793d6b475 Demote Copy to CommonTrackCell; Track points only to that base class 2019-06-22 21:46:33 -04:00
Paul Licameli 3f1fd8ced0 TrackView handles its own special XML attributes via virtual functions 2019-06-22 21:46:33 -04:00
Paul Licameli 278509a505 TrackView, not TrackList, updates Y coordinates of views, using events 2019-06-22 21:46:33 -04:00
Paul Licameli 4339c0df68 Move height calculation utilities to class TrackView 2019-06-22 21:46:32 -04:00
Paul Licameli a6e2ca0aa8 Move some enums into new files WaveTrackViewConstants.* ...
... freeing TracksPrefs from the second largest s.c.c. which is now only 20
2019-06-22 21:46:32 -04:00