1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +02:00

10283 Commits

Author SHA1 Message Date
Paul Licameli
ee68b69513 Fix #include 2019-06-18 19:23:28 -04:00
Paul Licameli
796301efda CommandManager.cpp does not include AudacityHeaders.h ...
... which I think was only meant to define a precompiled header for speed on
Windows, and is not necessary for compilation.  It is not included in many
other places.

The result is to shrink the big s.c.c. from 44 to 38.  Five files remain in
a new small component:

CommandManager
Menus
ToolBar
ToolDock
ToolManager

The sixth freed file is AudacityHeaders itself.
2019-06-18 18:30:40 -04:00
Paul Licameli
de3a5aea2e An important restructuring separating TrackView classes from Tracks ...
... somewhat analogously to separating AudacityProject from ProjectWindow:
separating core data from views of it.

Track is no longer a cell of TrackPanel, but is associated with objects that
are cells, and one hope for the future is to make the association one-to-many,
supporting, for instance, simultaneous wave and spectrogram views.

The big strongly connected component shrinks from 58 to 44:

+2 files in it are new:

CommonTrackControls
CommonTrackView

+6 files are unfortunately back in it, but should be free again after some
further work to separate LabelTrack from LabelTrackView:

BackgroundCell
LabelTrackControls
LabelTrackView (renamed from LabelTrackUI)
SelectHandle
TimeShiftHandle
TrackSelectHandle

-18 files break out into another strongly connected component, with one new
file (TrackView) and one formerly free file now trapped (TrackPanelResizerCell):

AutoRecovery
Clipboard
NoteTrack
ODComputeSummaryTask
ODDecodeBlockFile
ODDecodeTask
ODManager
ODPCMAliasBlockFile
ODTask
ODWaveTrackTaskQueue
ProjectFileIO
ProjectHistory
Track
TrackPanelResizeHandle
TrackPanelResizerCell
TrackView
TracksPrefs
UndoManager
WaveClip
WaveTrack

-3 files are freed from cycles, intermediate between the two components:

ButtonHandle
SelectionState
SliderHandle

-1 more is freed, not used by the big component, using the smaller one:

TrackVRulerControls
2019-06-18 18:02:24 -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
7a91cc8e8d Applying pending changed tracks causes adoption of cell objects...
... This will simplify the updating of pending tracks when state is moved into
the view cell object.  No copies of those fields will then be needed.
2019-06-18 16:01:06 -04:00
Paul Licameli
d335276931 Define Track::AdjustPositions() 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
79191d985d Separate Track::Clone (protected virtual) from Track::Duplicate 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
Henric Jungheim
9a02e93604 Add AUDACITY_DLL_API to CommonCommandFlags.h 2019-06-18 16:00:18 -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
98f322d685 Move writing and reading of common Track fields into functions...
... also now writing selected state of TimeTrack as for other tracks, fixing
an omission, with no harm to forward compatibility
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
Steve Daulton
722cb67baf Fix bug 2132
Selected audio tracks should be NOT empty. The test for Note Tracks is
incorrect - Note tracks are NOT audio - but this needs fixing elsewhere.
2019-06-18 12:22:39 +01:00
Paul Licameli
d84ab5948d Reduce dependencies of Menus, CommandManager, ToolManager...
... so that they and a few others will be in a small s.c.c. that breaks off
the big one -- when the dependencies of Track and its subclasses on TrackPanel
are severed.
2019-06-16 01:24:30 -04:00
Paul Licameli
e1908ab8e2 ToolManager does not depend on ProjectWindow 2019-06-16 01:24:29 -04:00
Paul Licameli
0b897c81b0 ToolManager.cpp does not depend on Meter 2019-06-16 01:24:29 -04:00
Paul Licameli
b84f5b66f0 CommandManager.cpp does not depend on EffectManager...
... some code lifted into BatchCommands.cpp to realize this.

It also doesn't depend on PluginManager, but that is not important for breaking
cycles.
2019-06-16 01:24:29 -04:00
Paul Licameli
c506536912 Menus.cpp does not depend directly on ProjectWindow 2019-06-16 01:24:29 -04:00
Paul Licameli
3d71edca52 Testing of conditions to enable menu commands is table driven...
... allowing the registered test functions to live in other files that
Menus.cpp does not depend on.
2019-06-16 01:21:06 -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
45436db166 New files for CommonCommandFlags 2019-06-16 01:21:05 -04:00
Paul Licameli
1b329b0e36 Error messages for disallowed commands are table-driven too 2019-06-16 01:21:05 -04:00
Paul Licameli
b09a1af564 Separate the flags mentioned in TellUserWhyDisallowed 2019-06-16 01:21:04 -04:00
Paul Licameli
f9b0281b47 Move TellUserWhyDisallowed into MenuManager...
... so we don't have MenuManager calling CommandManager which calls it back.
2019-06-16 01:21:04 -04:00
Paul Licameli
76996bf0cd TryToMakeActionAllowed is also table driven...
... and also the logic for relaxing the conditions for enabling the menu items
2019-06-16 01:21:02 -04:00
Paul Licameli
9a4c18255e Eliminate type alias CommandMask 2019-06-14 10:12:45 -04:00
Paul Licameli
6c6d0b869e So we prove that MissingFlags was always reassigned zero...
... so remove this piece of confused logic that did nothing
2019-06-14 10:12:45 -04:00
Paul Licameli
94d9593df8 3rd arg of TryToMakeActionAllows always == 2nd; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
e5a786c420 4th arg of ReportIfActionNotAllowed always == 3rd; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
ca5259712c HandleCommandEntry's 3rd parameter was two-valued, make it bool...
... false when it was NoFlagsSpecified, true when it was AlwaysEnabledFlag
2019-06-14 10:12:45 -04:00
Paul Licameli
0f2278d394 Eliminate the confusing mask from CommandManager entries...
... In fact it was only ever different from flags when flags had the special
NoAutoSelect and mask did not.  Now put that bit in the mask too, and make
the special NoAutoSelect always true in MenuManager::GetUpdateFlags().  This
still preserves the intended effects of NoAutoSelect.
2019-06-14 10:12:45 -04:00
Paul Licameli
64650b9a55 Third argument of EnableUsingFlags was always all-ones; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
a34f1cbba5 Reimplement the rejection of select-all-on-none for certain commands...
... Specify it in the menu descriptions.  Don't put special ad hoc logic
in Menus.cpp.
2019-06-14 10:12:44 -04:00