1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 08:09:41 +02:00

10320 Commits

Author SHA1 Message Date
Paul Licameli
77eeba5463 Define utility AttachedVirtualFunction 2019-06-21 09:16:48 -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
Steve Daulton
13ca42638d Fix for bug 2136
Don't translate doubles in Scripting messages. For valid JSON we need to
retain the dot as decimal separator.
2019-06-20 23:19:23 +01:00
Paul Licameli
df14253a50 Remove unnecessary #include-s in TimeTrack 2019-06-20 16:44:47 -04:00
Paul Licameli
a7cc55e9e7 Much code moved out of LabelTrack.cpp, freeing 3 files from cycles...
They are:

LabelTrack
Snap
TimeShiftHandle

The code, about 2000 lines, moved mostly into LabelTrackView, with some into
LabelTextHandle and LabelGlyphHandle.

With this commit, Track and its four subclasses are all free from the big
s.c.c, which has 29 remaining files, according to scripts/graph.pl.

But in truth there are still linkage dependencies not shown in the graph,
because overrides of Track::DoGetView and Track::DoGetControls are still in
scattered places, and they are needed to populate the virtual function tables
of those classes.

Thus dependency on LabelTrack still really implies dependency on LabelTrackView
and likewise for the other three Track subclasses.
2019-06-20 13:10:10 -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
8ff5a4b345 Do without some friend declarations in LabelTrack...
... and leave "updated" alone, it's only for use in interactive dragging
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
2d3f9a432a 4 "handle" files quit the big strongly connected component...
... They are:

NoteTrackButtonHandle
NoteTrackSliderHandles
PlayableTrackButtonHandles
WaveTrackSliderHandles

Though they are now in small cycles with their respective TrackControls
subclasses.

One new file, TrackInfo, is left behind in the big s.c.c.  Another is
PlayableTrackControls.

This makes the size of the big s.c.c 32, down from 35
2019-06-19 19:21:32 -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
63bf49adad CalcItemY and DefaultTrackHeight into the TrackInfo namespace 2019-06-19 13:59:50 -04:00
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