1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-19 06:07:42 +02:00

10326 Commits

Author SHA1 Message Date
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
Paul Licameli
3847b66638 MenuManager::GetUpdateFlags is now table-driven 2019-06-14 10:12:00 -04:00
Paul Licameli
82ea023843 Distinguish the quick-to-compute command flags 2019-06-14 10:11:58 -04:00
Paul Licameli
705b4b28e7 Register a predicate with each CommandFlag bit 2019-06-14 00:31:15 -04:00
Paul Licameli
36e3a03c7f Redo CommandFlags as std::bitset, allow registration of values 2019-06-14 00:31:15 -04:00
Paul Licameli
1f763984c9 Remove unused command flags 2019-06-14 00:31:15 -04:00
Paul Licameli
6c860229e8 Free two more toolbars and one other file from cycles to high levels 2019-06-14 00:29:43 -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