Commit Graph

874 Commits

Author SHA1 Message Date
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
Paul Licameli aa1ce03100 WaveTrack does not depend directly on ProjectHistory...
... because  we undo the move,
"Demote vertical zooming code into WaveTrack.cpp ..." done at 1f4bf26

That was done so that WaveTrack would not depend on WaveTrackVZoomHandle, but
made it instead depend on ProjectHistory, which is undesirable.

But since then, commit 3797a52 moved the special minimizing code for WaveTrack
into WaveTrackView.
2019-06-22 21:46:32 -04:00
Paul Licameli 3e0d48cc14 Redefine the factories for track views and controls...
... non-intrusively in the Track suclasses, registering functions instead.

For each abstract factory function (of two), build a table of concrete factory
functions, paralleling the hierarchy of Track subclesses.  Dispatch using
runt time type information in the Track objects.
2019-06-21 09:16:49 -04:00
David Bailes 660b8c07ad Fix Windows build - fix include paths 2019-06-21 09:29:32 +01:00
Paul Licameli f75bf45478 Fix #include directives 2019-06-21 00:23:40 -04:00
Paul Licameli 5240c42cb6 No more LabelTrack::HasSelection...
... eliminating the last dependency of LabelTrack.cpp on LabelTrackView.h
2019-06-20 11:47:55 -04:00
Paul Licameli f2869597b6 Move code from LabelTrack into LabelTrackView...
... and remove many #include directives from LabelTrack
2019-06-20 11:47:55 -04:00
Paul Licameli 6622f494fe Move code from LabelTrack into LabelTextHandle 2019-06-20 11:47:47 -04:00
Paul Licameli e0c4a94cfd Move code from LabelTrack into LabelGlyphHandle 2019-06-20 10:47:26 -04:00
Paul Licameli 822183febc Remove friend LabelDefaultClickHandle 2019-06-20 10:47:26 -04:00
Paul Licameli c9fa8424ce Move declarations again, to LabelTextHandle; remove a friend 2019-06-20 10:47:26 -04:00
Paul Licameli bbc465920b Public functions get, set highlight boundaries, hit-test on text 2019-06-20 10:47:26 -04:00
Paul Licameli 6af9187003 Move declarations again, to LabelGlyphHandle; remove a friend 2019-06-20 10:47:25 -04:00
Paul Licameli 5eb5e24ab0 Make some hit testing utilities of LabelTrackView static and public 2019-06-20 10:47:25 -04:00
Paul Licameli e3efd52026 Move many declarations into LabelTrackView & define its Copy() 2019-06-20 10:47:25 -04:00
Paul Licameli 604fbd0a2c Addition, deletion, sort of Labels communicated by events...
... and LabelTrack listens to its own events, to update certain state.

This is roundabout for now, but that state is view-related and will move into
another class.
2019-06-20 10:47:25 -04:00
Paul Licameli aa5f9550bd LabelTrackView, not LabelTrack, handles focus changes when adding 2019-06-20 10:47:25 -04:00
Paul Licameli 0750f62e88 Track::SetSelected is not virtual...
... which will simplify later rewrites that associate selection state with
the track group, not the track.

Since LabelTrack isn't notified immediately of selection changes, instead it
always tests whether it is selected, before using the stored selected label
index.
2019-06-20 10:47:25 -04:00
Paul Licameli 0cecc6e48d Remove unnecessary assertion, that failed...
... Because, as the function now says, the selecting of the track is
purposely done later
2019-06-20 10:47:25 -04:00
Paul Licameli 87ef97abe2 Move code to PlayableTrackControls...
... eliminating some duplication in tables for Wave and Note track controls,
and freeing PlayableTrackButtonHandles from the big s.c.c, though in a cycle
yet with PlayableTrackControls
2019-06-19 19:02:56 -04:00
Paul Licameli 674b66128d New files for PlayableTrackControls 2019-06-19 18:34:48 -04:00
Paul Licameli 6a03e7c84a Global slider instances for control panels out of TrackPanel.cpp...
... and updating of them is accomplished privately in implementation files,
reducing intrusions into TrackPanel and ProjectWindow

This removes #include-s from TrackInfo.cpp, leaving dependency cycles better
than previously
2019-06-19 18:34:47 -04:00
Paul Licameli 627213cb74 Move drawing code specific to Wave or to Note track controls...
... making cycles of some TrackControls subclasses with their handles, which
perhaps means those files should be fused, but that's for later
2019-06-19 18:34:47 -04:00
Paul Licameli 52844d9200 Virtual in CommonTrackControls determines what to draw in the TCP...
... This adds #include-s to TrackInfo.cpp that temporarily worsen the
dependency cycles
2019-06-19 18:34:45 -04:00
Paul Licameli 23b584b529 Move code to TrackInfo.cpp 2019-06-19 12:59:08 -04:00
Paul Licameli a99b746520 Move class ZoomInfo to separate files 2019-06-19 11:35:45 -04:00
Paul Licameli ee68b69513 Fix #include 2019-06-18 19:23:28 -04:00
Paul Licameli 66e32ca35d Move Y position, height, and minimized state into TrackView...
... and eliminate some unnecessary calls to SubstitutePendingChangedTrack,
because the track and the substitute store Y and height in their shared
TrackView object.

Also make GetMinimizedHeight() virtual to avoid inclusion of TrackPanel.h in
TrackView.cpp.
2019-06-18 16:01:06 -04:00
Paul Licameli 3797a5227a Minimized state moved into TrackView 2019-06-18 16:01:06 -04:00
Paul Licameli e581fa60d9 Move responsibilities from Track to TrackView classes...
... And Track no longer inherits TrackPanelCell, so be careful to rewrite
some dynamic_casts too to check instead for TrackView.  Those casts won't fail
to recompile if not rewritten.
2019-06-18 16:01:06 -04:00
Paul Licameli e0b8bd78eb Move functions handling label keystrokes to class LabelTrackView 2019-06-18 16:01:06 -04:00
Paul Licameli 9d26eb7a41 Define LabelTrackView::Get(), LabelTrackView::FindLabelTrack() 2019-06-18 16:01:06 -04:00
Paul Licameli c8b62f5d8a Define TrackView::Copy, cause all track duplications to invoke it...
... but it does nothing yet.

This will be important to preserve undo/redo behavior of view changes, when
view state is moved out of the proper Track objects.
2019-06-18 16:01:06 -04:00
Paul Licameli b4c7a8ef2a TrackPanelResizerCell, also in 1-to-1 with TrackView, now owned by it 2019-06-18 16:01:06 -04:00
Paul Licameli 18b4c01c51 TrackVRulerControl is directly owned by TrackView not Track...
... in anticipation of making views to tracks many-to-one, but then the rulers
should be one-to-one with the views.  So go through the view to get the ruler.
The ruler is really a left-hand extension for each view.
2019-06-18 16:01:06 -04:00
Paul Licameli e90943cfe1 Move code into CommonTrackView.cpp 2019-06-18 16:01:06 -04:00
Paul Licameli e77799d62c Split out class CommonTrackView ...
... so base class TrackView can be used by TrackPanel to define its subdivision,
avoiding dependency on any special callbacks in CommonTrackView
2019-06-18 16:01:06 -04:00
Paul Licameli 059d7eaa42 Associate View object with Track, analogous with controls 2019-06-18 16:01:06 -04:00
Paul Licameli 18ba27a641 Define static accessor functions for VRulerControls and TrackControls...
... and use std::enable_shared_from_this

Temporarily putting TrackControls.cpp back into the big s.c.c, now 59 files

Future rewriting might even eliminate all mention of those classes in
the definition of the Track classes.
2019-06-18 16:01:06 -04:00
Paul Licameli 2259f12acb Move code into CommonTrackControls.cpp 2019-06-18 16:01:06 -04:00
Paul Licameli e30ffc340a New files CommonTrackControls.cpp, CommonTrackView.cpp 2019-06-18 16:01:06 -04:00
Paul Licameli bebd709e98 Define and use CommonTrackCell 2019-06-18 16:01:06 -04:00
Paul Licameli 2bb823e1b6 Split out class CommonTrackControls...
... so base class TrackControls can be used by TrackPanel to define its
subdivision, not depending on any special callbacks in CommonTrackControls
2019-06-18 16:01:06 -04:00
Paul Licameli d7753f7acd Rename old .cpp files, add new .h files 2019-06-18 16:01:05 -04:00
Paul Licameli bc2eda2ac8 Remove another unnecessary #include 2019-06-18 16:00:23 -04:00
Paul Licameli 1594fc0cb1 Remove some unncessary #include directives 2019-06-18 14:33:38 -04:00
Paul Licameli 4c5b65d7f6 Move some constants and GetVRulerOffset() out of TrackPanel.h 2019-06-18 11:36:50 -04:00
Paul Licameli 2b2d13d5be TimeShiftHandle.h doesn't need Track.h 2019-06-18 11:36:50 -04:00
Paul Licameli c0adb35839 Command flag functions out of Menus.cpp, reducing its dependencies...
... Mostly into CommonCommandFlags.cpp, but some elsewhere, to avoid giving
that new file problematic dependencies on LabelTrack, ControlToolBar, and
EffectManager.

Note that CutCopyAvailableFlag is critically ordered, for message purposes,
only with AudioIONotAvailableFlag, the only flag with a message that it combines
with in menu item definitions.

The dependency on LabelTrack.cpp might not be a bad one later, if the track and
its view can be separated, and that would allow CutCopyAvailableFlag to be
put with the others.  But much other work on LabelTrack must happen first.
2019-06-16 01:21:05 -04:00
Paul Licameli 352380d58f Scrubbing.cpp does not depend on TranscriptionToolBar...
... Freeing the latter from cycles, and also VoiceKey.

As with ToolsToolBar, use low-level ProjectSettings as the chalkboard for
sending a message.
2019-06-14 00:27:31 -04:00
Paul Licameli 1884eb8619 Fix #include 2019-06-13 10:21:51 -04:00
Paul Licameli 2f18c624f8 ToolsToolBar.cpp is free from cycles...
... Use ProjectSettings instead to communicate just an integer to the rest of
the program.
2019-06-13 10:13:09 -04:00
Paul Licameli 6b5161f9d9 NoteTrackVZoomHandle.cpp compilable with WaveTrack.h ...
... which it doesn't actually include, except with precompiled headers in
the Windows build
2019-06-11 03:44:28 -04:00
Paul Licameli 1f4bf262b1 Demote vertical zooming code into WaveTrack.cpp ...
... Freeing WaveTrackVRulerControls and WaveTrackVZoomHandle from the big
s.c.c., to higher levels, though still in a cycle of two
2019-06-10 21:56:46 -04:00
Paul Licameli e969315c90 Free TrackControls and TrackSelectHandle from cycles, to high levels 2019-06-10 21:56:46 -04:00
Paul Licameli d4b44d16f1 Move details of mouse wheel handling into ProjectWindow.cpp ...
... to break some dependency cycles.  Install a callback at initialization time.

This frees CommonTrackPanelCell from cycles, which is important because it is
a base class of Track
2019-06-10 21:56:46 -04:00
Paul Licameli 51051ee933 Separate AudioIOBase from AudioIO 2019-06-10 20:48:38 -04:00
Paul Licameli 42a4f55ffe Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).

AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.

It won't include StartStream.  It will contain functions to query the
present state of streams, and device capabilities.
2019-06-10 20:48:38 -04:00
Paul Licameli 46bf5a82fc Don't pass whole TimeTrack to Ruler or Mixer...
... they need only the information in a (Bounded)Envelope.
2019-06-10 20:48:38 -04:00
Paul Licameli 7ed99c6e8f Split EnvelopeEditor.cpp from Envelope.cpp...
... Envelope drops down out of the big strongly connected component, the new
piece stays behind
2019-06-10 20:48:38 -04:00
Paul Licameli f03684db4f New class ProjectHistory split from ProjectManager for undo, etc...
... And yet fewer inclusions of Projectmanager.h, though it's still not yet
free of cycles
2019-06-09 12:10:48 -04:00
Paul Licameli d979a8959b New files for ProjectAudioManager...
... This eliminates some inclusions of ProjectManager, helping to free it from
cycles into a higher level
2019-06-09 12:10:47 -04:00
Paul Licameli 4f940c855d New files for ProjectWindow 2019-06-03 01:43:26 -04:00
Paul Licameli 4abc71c6b4 Do the separation of classes ProjectWindow and AudacityProject 2019-06-03 01:43:23 -04:00
Paul Licameli fee5582826 New files for ProjectManager 2019-06-03 01:21:12 -04:00
Paul Licameli 4274d44ab7 New attached structure ProjectManager handles project lifetime...
... that is, a factory function, open, close, import, undo/redo/rollback.

Also the callbacks from AudioIO, which need to invoke undo history push when
recording stops.

It is meant as a high-level class using several of the other things attached
to the project, while AudacityProject will be a low level class acting mostly
as just the container of the attached structures.
2019-06-03 01:18:12 -04:00
Paul Licameli e5cf2165d1 New files for ProjectAudioIO 2019-06-03 01:18:08 -04:00
Paul Licameli 1f4202c878 New attached structure ProjectAudioIO handles tokens and meters 2019-06-03 01:15:47 -04:00
Paul Licameli 05efeeb5bd New files for ProjectSettings 2019-06-03 01:13:13 -04:00
Paul Licameli dd10e00a2d New attached structure ProjectSettings stores rate, snap-to, et al. 2019-06-02 14:42:00 -04:00
Paul Licameli 82663892dc Accessors to get the project window...
... as a preparation for splitting up class AudacityProject.

Use ProjectWindow as an alias for AudacityProject, and fetch it from the
project with a static member function, where certain of its services are used;
pretending they are not the same class.

Use global accessor functions to get wxFrame from the project where only
wxFrame's member functions are needed, so there will be less dependency on
ProjectWindow when it becomes a distinct class.
2019-05-28 23:18:13 -04:00
Paul Licameli ae18f2f220 Construction of default play options moved out of AudacityProject 2019-05-28 19:33:21 -04:00
Paul Licameli 3416b5bad6 Toolbars accessed by static Get() functions, not through AudacityProject 2019-05-24 16:08:29 -04:00
Paul Licameli 7bb71257ed static AdornedRulerPanel::Get()...
... not member functions of AudacityProject
2019-05-24 15:48:16 -04:00
Paul Licameli d1ad8f55e0 static TrackPanel::Get()...
... not member functions of AudacityProject
2019-05-24 15:46:30 -04:00
Paul Licameli 8eb39cd606 Fix #include directives 2019-05-24 12:23:57 -04:00
Paul Licameli 52abbcdc4b static ::Get functions for overlays on TrackPanel...
... not member functions of AudacityProject.

AdornedRulerPanel is not (yet) made similarly independent of its overlay
code.

Two .cpp files implementing overlays escape dependency cycles to higher levels.
2019-05-23 16:35:06 -04:00
Paul Licameli 004997cec1 static BackgroundCell::Get()...
... not member functions of AudacityProject.

This frees BackgroundCell.cpp from dependency cycles
2019-05-23 16:35:05 -04:00
Paul Licameli 2f0a76ed10 static Scrubber::Get()...
... not member functions of AudacityProject
2019-05-23 16:01:10 -04:00
Paul Licameli 15dd230ee1 static ToolManager::Get()...
... not member functions of AudacityProject
2019-05-23 15:24:28 -04:00
Paul Licameli 68e25f3b7d static SelectionState::Get()...
... not member functions of AudacityProject
2019-05-23 14:11:05 -04:00
Paul Licameli 4ba4d0978b static CommandManager::Get()...
... not member functions of AudacityProject
2019-05-23 13:17:29 -04:00
Paul Licameli b5a57682b6 static ViewInfo::Get() and ZoomInfo::Get()...
... not member functions of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli 14ab93a01f static TrackList::Get()...
... not member function of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli d5b2507af9 Remove unneeded inclusions of Project.h, no cycles broken 2019-05-22 10:02:24 -04:00
Paul Licameli dccb716f39 enum PlayMode tells whether there's cut preview; out of Project.h 2019-05-20 21:38:12 -04:00
Paul Licameli 22f6ee789c Move function from AudacityProject to TransportActions 2019-05-20 21:38:10 -04:00
Paul Licameli 227fb315ea Drawing sequence for overlays independent of insertion call sequence 2019-05-20 21:38:08 -04:00
Paul Licameli f86403378b Move AudacityMessageBox to its own files...
... breaking cycles among low-level files introduced by 273ba9f
2019-05-20 14:48:36 -04:00
Paul Licameli 6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli 548192fcf3 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:58:34 -04:00
Paul Licameli 56f51d8176 Revert "Remove redundant #include-s from .h files..."
This reverts commit b7fe62d170.
2019-05-16 14:33:55 -04:00
Paul Licameli b7fe62d170 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:15:05 -04:00
Paul Licameli 11c8377460 NormalizedKeyString redefined as TaggedIdentifier 2019-05-16 12:30:29 -04:00
Paul Licameli bf005c0dec PrefsPanel::Factory is a specialization of std::function...
... We don't need to define a class for it
2019-05-16 12:14:51 -04:00
James Crook 88dc11f525 Fix 'Set Track Name' input box too short.
This was a regression relative to Audacity 2.0.3
2019-05-15 13:38:16 +01:00
James Crook 1866be6145 Refresh NoteTrack after zooming. 2019-04-15 19:16:01 +01:00
Pokechu22 fe6afb91cf Add Up Octave and Down Octave to note track vruler menu
These currently are present in the track dropdown, but I think it's also suited for the vruler.
2019-04-15 16:52:26 +01:00
Pokechu22 99f4c35e18 Add support for zooming to show all notes, separate from max zoom
This is now the behavior of Zoom Reset, with Max Zoom being given the previous behavior.  Shift+Right-Click alternates between the two -- it zooms to all notes, unless it currently is zoomed to all notes in which case it performs a max zoom.

This fixes Bug 2093.  It also fixes Bug 1815, by performing the all-notes zoom when importing a track.
2019-04-15 16:52:26 +01:00
Pokechu22 567b3972b8 Call ModifyState(false) after changing zoom
This doesn't need to trigger an autosave (which is what passing true would do), but the state should still be modified.

Unfortunately this doesn't seem to enable saving -- probably because no undo state is being pushed.  That's something to consider for the future.
2019-04-15 16:52:25 +01:00
Pokechu22 53823270e0 Rework note tracks to store top and bottom notes instead of pitch height
This simplifies a bunch of other work -- in particular zooming so that specific notes are visible, and keeping the same notes on screen when resizing the track.

Also included is a fix to YToIPitch to make it use mPitchHeight directly -- this solves some roundoff errors, which previously caused inaccurate results on some zoom levels.
2019-04-15 16:52:24 +01:00