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

10058 Commits

Author SHA1 Message Date
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
Paul Licameli
7fc3adb54d ThemePrefs.cpp has fewer dependencies...
... Send an event via the app that projects listen to for theme update; don't
push it to projects directly.

This frees three files from dependency cycles.
2019-05-18 20:29:25 -04:00
Paul Licameli
519a988467 RecordingPrefs.cpp does not depend on AudioIO.cpp...
... freeing it from dependency cycles, but no others
2019-05-18 20:29:25 -04:00
Paul Licameli
4bdcf3152f Theme.cpp has fewer dependencies...
It remains in a cycle with ImageManipulation, but the two are free from
other cycles
2019-05-18 20:29:25 -04:00
Paul Licameli
82f4948360 Dither.cpp and SampleFormat.cpp have fewer dependencies...
... Notably they longer depend indirectly on AudioIO.cpp (via QualityPrefs)

This frees nine files from dependency cycles
2019-05-18 20:29:25 -04:00
Paul Licameli
d68db39b5c HelpSystem.cpp has fewer dependencies...
... There was no reason to store the help location preferences as per-project
state.  Also move the dialog for quick fixes near its only use in
HelpMenus.cpp.

This takes 22 files out of the big strongly connected component, notably
the much used lower level utilities, ErrorDialog and AudacityException.

HelpSystem itself is still in a small cycle with LinkingHtmlWindow.
2019-05-18 20:29:25 -04:00
Paul Licameli
56b1d531b2 HelpText.cpp has fewer dependencies...
... freeing it to a low level and AboutDialog.cpp to a high level, by moving
functions from the latter into the former
2019-05-18 20:29:25 -04:00
Paul Licameli
4da02d667f ShuttleGui.cpp and ShuttlePrefs.cpp have fewer dependencies...
... Freeing 13 files from cyclic dependencies
2019-05-18 20:29:25 -04:00
Paul Licameli
5c1ae17f6d Prefs.cpp has fewer dependencies...
... when special initial population of preferences is lifted into
AudacityApp.cpp.

This takes four files out of the big strongly connected component of the graph
into low levels, but three of them (Prefs, Languages, FileNames) are still in
a small cycle.  FileHistory is the fourth, depending on the others.
2019-05-18 20:29:25 -04:00
Paul Licameli
25db4652b0 Internat.cpp has fewer dependencies...
... after we move a function to FileNames.cpp.

This frees ten files from cyclic dependencies
2019-05-18 20:29:25 -04:00
Paul Licameli
e3ad893887 Split three .cpp files each in two, to enable later cycle breaking 2019-05-18 20:28:07 -04:00
Paul Licameli
db8c4c5e5a Global keyboard capture handling into new files, better comments...
... and break its compile dependency on CommandManager.h by letting it install
callbacks.

This also removes Objective-C mixed code from CommmandManager.

This also eliminates four inclusions of Project.h!

Capture handler state is also global, not per project, though the
CommandManager's callbacks still do depend on the active project.
2019-05-18 15:14:18 -04:00
Paul Licameli
78a1263163 Move ShuttleGetDefinition to its own files...
... so Shuttle need not include CommandTargets.h
2019-05-18 15:10:07 -04:00