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

10292 Commits

Author SHA1 Message Date
Paul Licameli
eccc62f99f Embed enum in struct definition in namespace in header 2019-06-19 12:59:08 -04:00
Paul Licameli
23b584b529 Move code to TrackInfo.cpp 2019-06-19 12:59:08 -04:00
Paul Licameli
015e3abfe5 New files for TrackInfo 2019-06-19 12:59:02 -04:00
Paul Licameli
f534d7b8d7 ReCreateSliders doesn't need a parent window 2019-06-19 12:58:29 -04:00
Paul Licameli
db140902ff Free TimeTrack, Mix, EnvelopeHandle from cycles...
... the first two, intermediate between the two large s.c.c.'s, the last at
a high level.

The size of the largest s.c.c. is now 35.
2019-06-19 11:35:48 -04:00
Paul Licameli
7466556e21 Move drawing code for TimeTrack...
... Freeing 3 files from cycles:
EnvelopeHandle
Mix
TimeTrack
2019-06-19 11:35:48 -04:00
Paul Licameli
63350d8573 TimeTrack drawing not dependent on EnvelopeEditor...
... after a static function is moved from EnvelopeEditor to Envelope
2019-06-19 11:35:47 -04:00
Paul Licameli
a99b746520 Move class ZoomInfo to separate files 2019-06-19 11:35:45 -04:00
Paul Licameli
f7dfc34de9 Supply missing lines in src/Makefile.am for new files at e30ffc3 2019-06-19 11:33:26 -04:00
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