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

10133 Commits

Author SHA1 Message Date
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
Paul Licameli
2faa24c96b Move ProjectFSCK out of DirManager...
... which makes DirManager.cpp not depend on MissingAliasFileDialog.cpp
2019-05-18 15:06:50 -04:00
Paul Licameli
f4703bbd1f ViewInfo doesn't need Project.h 2019-05-18 14:57:24 -04:00
Paul Licameli
e5c7e5a21f Three new files in the build, still empty 2019-05-18 14:57:24 -04:00
Paul Licameli
597cdb7428 AudacityApp.cpp and some others freed from cyclic link dependencies 2019-05-17 16:30:05 -04:00
Paul Licameli
6e3ebc0938 ScriptCommandRelay.cpp is not link dependent on AudacityApp.cpp ...
... Let it send an event to the application instead of calling the handler
directly.
2019-05-17 16:29:41 -04:00
Paul Licameli
b04387a21d Move AudacityApp::GenerateCrashReport to its own files 2019-05-17 16:29:31 -04:00
Paul Licameli
8da6529329 Remove AudacityApp::GetLogger() & HelpActions::DoShowLog() 2019-05-17 16:29:04 -04:00
Paul Licameli
e845bd9544 Move AudacityApp::MacActivateApp out of WindowMenus.cpp 2019-05-17 16:29:04 -04:00
Paul Licameli
e4a8d6c3fc Don't call AudacityApp::OnMenuAbout directly from HelpMenus.cpp 2019-05-17 16:29:04 -04:00
Paul Licameli
6cde697a8e Don't call QuitAudacity directly from src/menus...
... This cuts link dependency on AudacityApp.cpp, and allows the function to
be private to that file
2019-05-17 16:29:04 -04:00
Paul Licameli
187e3be0d6 Move SaveWindowSize to Project.cpp & it no longer needs AudacityApp.h 2019-05-17 16:29:04 -04:00
Paul Licameli
d4b0fd1b83 AudacityProject.cpp does not need gIsQuitting from AudacityApp.h 2019-05-17 16:29:04 -04:00
Paul Licameli
4a4f8ebe4e Move language setting and event from AudacityApp.h to GUIPrefs.h 2019-05-17 16:29:04 -04:00
Paul Licameli
236c8ed51e Move version keys from AudacityApp to AudacityPrefs 2019-05-17 16:29:04 -04:00
Paul Licameli
a1ff74b5bb Move AudacityPathList & utilities from AudacityApp.h to FileNames.h 2019-05-17 16:29:03 -04:00
Paul Licameli
757d90d3b9 Move default temporary directory from AudacityApp.h to FileNames 2019-05-17 16:29:03 -04:00
Paul Licameli
a047fa6e7a Missing alias file tracking out of AudacityApp, into new files...
... which reduces the need for including AudacityApp.h
2019-05-17 16:28:50 -04:00
Paul Licameli
0ab29d21e9 Some naming consistency...
Prefer "MissingAliasFiles" not other permutations of the words
2019-05-17 06:47:53 -04:00
Paul Licameli
2d8c287384 Do not require AudacityApp.h when using global file history 2019-05-17 06:47:53 -04:00
Paul Licameli
d4f71c2c64 Move an event type definition out of AudacityApp.h 2019-05-17 06:47:53 -04:00
Paul Licameli
338d7cd164 A class encapsulating the global clipboard 2019-05-17 06:47:53 -04:00
David Bailes
ca13f08ff8 Grid accessibility: incorrect focus can be read
Problem: this affects NVDA and Narrator, but not Jaws. If a user moves to the Delete button and presses it to delete a label, a label is incorrectly read as the new focus - the focus remains on the Delete button.
GridAx::SetCurrentCell() can be called when the Grid is not the focus, and send a focus event.

Fix: In GridAx::SetCurrentCell() only send an focus event if the Grid is the focus.
2019-05-17 11:06:49 +01:00
David Bailes
be55d891db Trackpanel accessibility: incorrect focus can be read
Problem: If the initial focus is a control in a toolbar, then after applying an effect such as amplify, then the focus is read as being a track, not the control in the toolbar.
TrackPanelAx::SetFocus() can be called when the TrackPanel is not the focus, and send a focus event.

Fix: In TrackPanelAx::SetFocus(), only send a focus event if the TrackPanel is the focus.
2019-05-17 09:56:01 +01:00
David Bailes
6da84b0adc Keyboard prefs accessibility: Narrator can misread the radio buttons.
Problem. If an item in the list is selected, then if a different view by radio button is selected, Narrator reads the selected item rather than the radio button.
KeyViewAx::SetCurrentLine(int line) can be called when the KeyView is not the focus, and send a focus event.

Fix: In KeyViewAx::SetCurrentLine(int line), only send focus event if the KeyView is the focus.
2019-05-17 08:33:33 +01:00
Paul Licameli
ddaadfb7e7 Remove NumericTextCtrl.h from other headers or comment why you can't 2019-05-16 19:01:00 -04:00