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

10320 Commits

Author SHA1 Message Date
Paul Licameli
caec2064e5 Preliminaries before further cycle-breaking 2019-05-20 21:38:14 -04:00
Paul Licameli
755a7b86a6 Some dependencies of PrefsDialog and AudacityProject weakened...
... though not eliminated.

PrefsDialog and AudacityProject do less special-purpose "pushing" of updates.
2019-05-20 21:38:14 -04:00
Paul Licameli
5d839c3e97 Lower the image updating for theme into GUIPrefs::Commit()...
... weakening dependency of PrefsDialog.cpp on particular preference page
implementations
2019-05-20 21:38:13 -04:00
Paul Licameli
62899a32f4 All things with an UpdatePrefs() message listen for an event...
... Still to do, improve the handling of updates of only subsets of the prefs
2019-05-20 21:38:13 -04:00
Paul Licameli
cc635e0498 Emit an event when the preferences dialog closes 2019-05-20 21:38:13 -04:00
Paul Licameli
a78ad42399 Various preliminaries for splitting up the class AudacityProject...
... Tags.cpp is temporarily put back into the big strongly connected component
of link dependencies
2019-05-20 21:38:12 -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
0bd9bb3b90 Some steps of ResetProjectToEmpty into a new function 2019-05-20 21:38:11 -04:00
Paul Licameli
582b0ee40c Repeated code moved into new AudacityProject::CloseLock() 2019-05-20 21:38:11 -04:00
Paul Licameli
24259413be Move UpdatePrefs() later in ctor of AudacityProject...
... and assume non-null for certain sub-windows
2019-05-20 21:38:11 -04:00
Paul Licameli
b3257c56da Remove AudacityProject::ExportFromTimerRecording 2019-05-20 21:38:10 -04:00
Paul Licameli
9c75ebe7f7 TrackPanel subscribes directly to ODManager for events...
... cutting middleman AudacityProject out
2019-05-20 21:38:10 -04:00
Paul Licameli
22f6ee789c Move function from AudacityProject to TransportActions 2019-05-20 21:38:10 -04:00
Paul Licameli
d2717cac21 Move functions from AudacityProject to SelectActions 2019-05-20 21:38:09 -04:00
Paul Licameli
5ed9fa972b AudacityProject::mIsBeingDeleted was redundant 2019-05-20 21:38:09 -04:00
Paul Licameli
9f377b3b75 Prepare to decouple factories for TP & Ruler into their own sources 2019-05-20 21:38:09 -04:00
Paul Licameli
735860c856 Remove the TrackPanelFactory...
... It was part of an attempt at decoupling that will be superseded by other
techniques
2019-05-20 21:38:08 -04:00
Paul Licameli
ada9f2baad Remove AudacityProject::IsCapturing()...
... because it was in fact tracking global state, not any per-project state.
2019-05-20 21:38:08 -04:00
Paul Licameli
227fb315ea Drawing sequence for overlays independent of insertion call sequence 2019-05-20 21:38:08 -04:00
Paul Licameli
f123ea5faa Missing alias dialog tracking is non-intrusive in class AudacityProject 2019-05-20 21:38:08 -04:00
Paul Licameli
e227d4dfb1 Remove some unnecessary declarations in class AudacityProject 2019-05-20 21:38:07 -04:00
Paul Licameli
390af96796 Dispatch read of top-level project XML tags with a table of functions...
... which makes Project.cpp a bit less dependent on some details of other
classes

This puts Tags.cpp back into the big strongly connected component of the
dependency graph.  That will be remedied later when Project.cpp becomes a
low-level file
2019-05-20 21:38:07 -04:00
Paul Licameli
a3edf9f6d7 New AudacityProject::ReadProjectFile for some steps of project opening 2019-05-20 21:38:06 -04:00
Henric Jungheim
6a04d36bbd Tell Visual Studio that KeyboardCapture.h is a header file. 2019-05-20 17:59:19 -07:00
Paul Licameli
02d5e6c597 Fix crash in script pipe caused by commit 9eb9104 2019-05-20 19:46:14 -04:00
Paul Licameli
4c3729040f comments 2019-05-20 19:46:14 -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
273ba9f64d Fix Windows build...
... unfortunately inclusion of ErrorDialog.h in FileNames.h ties nine files
into a low-level s.c.c.
2019-05-20 13:49:26 -04:00
Paul Licameli
6d257b04da Much link dependency cycle-busting...
... reducing the biggest strongly connected component, as determined by
scripts/graph.pl, from 215 .cpp files down to 123
2019-05-18 20:37:38 -04:00
Paul Licameli
ddd5fa6bd6 Break dependency cycles with Sequence, DirManager, BlockFile classes 2019-05-18 20:33:24 -04:00
Paul Licameli
96ffc424cf PluginManager.cpp does not depend on EffectManager.cpp...
... Taking PluginManager.cpp and ModuleManager.cpp out of other dependency
cycles, though still in a small cycle with each other
2019-05-18 20:32:19 -04:00
Paul Licameli
7b51653b36 Sequence.cpp does not depend on ODDecodeBlockFile.cpp...
... This frees Sequence.cpp from dependency cycles
2019-05-18 20:32:19 -04:00
Paul Licameli
0832bccc7b DirManager.cpp has fewer dependencies...
... To append files during recording or import, it doesn't depend on the
subclasses of BlockFile, instead taking a factory function to which it gives
the filename; and the choice of factory function is also lifted up through the
level of class Sequence which is just above DirManager.

This frees four files from dependency cycles, including DirManager.cpp but not
yet Sequence.cpp
2019-05-18 20:32:19 -04:00
Paul Licameli
ca0fb190e6 Register factory functions with DirManager to interpret XML tags...
... Removes direct dependency on ODManager.h and some BlockFile subclasses,
but does not yet break any dependency cycles
2019-05-18 20:32:19 -04:00
Paul Licameli
81d4c217e6 Rewrite DirManager::EnsureSafeFileName without downcasts...
... weakening but not yet eliminating dependency on BlockFile subclasses
2019-05-18 20:32:19 -04:00
Paul Licameli
d46bb29e3a DirManager.cpp does not depend on Sequence.cpp...
... This does not yet break any dependency cycles
2019-05-18 20:32:19 -04:00
Paul Licameli
9b32fc7a2b DirManager.cpp doesn't depend on Clipboard...
... Locate other outstanding DirManagers by other means, a global tracking
array.

This does not yet break any dependency cycles.
2019-05-18 20:32:19 -04:00
Paul Licameli
ce27977ff2 BlockFile.cpp does not depend on MissingAliasFileDialog.cpp ...
... instead use a hook function to call back when it is discovered that a
block file is missing.

This frees three files from dependency cycles
2019-05-18 20:32:19 -04:00
Paul Licameli
c401a54469 Break dependency cycles related to Commands 2019-05-18 20:31:49 -04:00
Paul Licameli
74c53efadc Command.cpp does not depend on Project.cpp...
... To do that, hoist the call to GetActiveProject() into the factory that
makes BatchEvalCommand

Also remove unnecessary inclusion of CommandBuilder.h.

This frees Command.cpp from dependency cycles;  CommandBuilder and
ScriptCommandRelay are now in a small cycle of only two.
2019-05-18 20:31:17 -04:00
Paul Licameli
ae0cd061c6 ScriptCommandRelay.cpp doesn't depend on AudacityProject.cpp ...
... This doesn't break any dependency cycles yet.
2019-05-18 20:31:17 -04:00
Paul Licameli
016e1949ae CommandDirectory.cpp has fewer dependencies...
... This involved populating it with a new registration system.

BatchEvalCommand, HelpCommand, MessageCommand escape from cycles and move
higher in the dependency graph, and CommandDirectory moves lower.
2019-05-18 20:31:17 -04:00
Paul Licameli
13713aab67 Remove nullary overload of AudacityCommand::Apply...
... which by default used GetActiveProject(); do that call instead at a
higher level; so that AudacityCommand.cpp does not depend on Project.cpp.

We lose the override of that for CompareAudioCommand which just did nothing.

But in fact this overload of the base class method could only be used
by EffectUIHost constructed from a command, which never happened: it was only
ever constructed from effects.

This frees two files from dependency cycles
2019-05-18 20:31:17 -04:00
Paul Licameli
d81ca99643 CommandContext.cpp has fewer dependencies...
... freeing it (alone) from dependency cycles
2019-05-18 20:31:17 -04:00
Paul Licameli
9eb9104859 Remove CommandContext::GetProject() ...
... which called ::GetActiveProject(), but one purpose of the CommandContext
class was to eliminate many uses of that global function, because a
CommandContext must always be constructed from a reference to a project
(which was always in fact the active one), then passed around to where it is
needed!

Also, just use the project member directly -- because CommandContext was
intended as just a P.O.D (plain-old-data) structure.

This also eliminates a dependency of CommandContext.cpp on Project.cpp.

This is not enough by itself to break any dependency cycles.
2019-05-18 20:31:17 -04:00
Paul Licameli
1c0453106d CommandTargets.cpp has fewer dependencies...
... freeing two files from dependency cycles
2019-05-18 20:31:17 -04:00
Paul Licameli
87a9f34c22 ScreenshotCommand uses hooks in AudacityCommand and Effect dialogs...
... so that they don't have a static linkage dependency on it, and that frees
it from dependency cycles, to a high level
2019-05-18 20:31:17 -04:00
Paul Licameli
7677638ded Break various dependency cycles 2019-05-18 20:30:51 -04:00
Paul Licameli
6bed41a9be Move class ODTaskThread out of ODTaskThread.* (!) ...
... freeing three files from dependency cycles.

The class is only constructed by ODManager so move its definition there.

Meanwhile, the (now misnamed) ODTaskThread.cpp implements some thread
synchronization utilities used in several other places, not dependent now on
ODManager.cpp, and also not on ODTask.cpp.

These utilities should be eliminated in favor of standard library alternatives,
but that is a task for later.
2019-05-18 20:29:25 -04:00
Paul Licameli
191cd23b54 XMLTagHandler.cpp has fewer dependencies...
... freeing three files from dependency cycles
2019-05-18 20:29:25 -04:00