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

10195 Commits

Author SHA1 Message Date
Paul Licameli
d4b44d16f1 Move details of mouse wheel handling into ProjectWindow.cpp ...
... to break some dependency cycles.  Install a callback at initialization time.

This frees CommonTrackPanelCell from cycles, which is important because it is
a base class of Track
2019-06-10 21:56:46 -04:00
Paul Licameli
7b09225bf7 Use a hook to implement the shift-click shortcut to keyboard prefs...
This frees EIGHTEEN files from the big strongly connected component!!

They are:

Dependencies
Export
ExportCL
ExportFFmpeg
ExportFFmpegDialogs
ExportFLAC
EportMP2
ExportMP3
ExportOGG
ExportPCM
ExtImportPrefs
Import
ImportRaw
KeyConfigPrefs
KeyView
LibraryPrefs
PrefsDialog
SpectrumPrefs

... and that includes all of the remaining *Prefs files.

It does still leave the nine Export* files in a smaller s.c.c, which could be
broken with a registration system, as was done for import at commit e2cf1d9
2019-06-10 21:56:46 -04:00
Paul Licameli
d69a76dc6f ProjectSettings.cpp does not depend on Snap, is free of cycles 2019-06-10 21:56:46 -04:00
Paul Licameli
490544cfd4 Lower EVT_TRACK_PANEL_TIMER into Project...
... so there are fewer dependencies on TrackPanel.

This frees ASlider, Ruler, and ViewInfo from cycles
2019-06-10 21:56:46 -04:00
Paul Licameli
8f3cd8436a Free DeviceManager and DevicePrefs from cycles 2019-06-10 21:56:10 -04:00
Paul Licameli
7ef5ebc97a Send event, so that DeviceManager does not depend on DeviceToolBar...
... freeing it and DevicePrefs from cycles
2019-06-10 21:55:34 -04:00
Paul Licameli
ccc49f8ccf Abstract virtual AudioIOBase::StopStream...
... so that DeviceManager, DeviceToolbar, and PrefsDialog do not depend directly
on AudioIO.

But no function in the base class for starting streams, which would require
mention of Track types, which we want to avoid.
2019-06-10 21:55:29 -04:00
Paul Licameli
240402e56f Split files AudioIO, Envelope, and Meter; shrinks the big s.c.c by 2 2019-06-10 21:52:17 -04:00
Paul Licameli
758e9813f1 Move MeterPanelBase to new files...
... which frees AudioIOBase, QualityPrefs, and ProjectAudioIO from cycles
2019-06-10 20:48:39 -04:00
Paul Licameli
17c04d1749 Separate an abstract base class from MeterPanel...
... to break its cycle with AudioIO
2019-06-10 20:48:38 -04:00
Paul Licameli
51051ee933 Separate AudioIOBase from AudioIO 2019-06-10 20:48:38 -04:00
Paul Licameli
42a4f55ffe Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).

AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.

It won't include StartStream.  It will contain functions to query the
present state of streams, and device capabilities.
2019-06-10 20:48:38 -04:00
Paul Licameli
46bf5a82fc Don't pass whole TimeTrack to Ruler or Mixer...
... they need only the information in a (Bounded)Envelope.
2019-06-10 20:48:38 -04:00
Paul Licameli
5ae606cf53 Move TimeTrack's upper and lower range into new BoundedEnvelope...
... confusingly, Envelope already carried its own limiting values, but those
in the TimeTrack were not guaranteed to be the same.

I'm just preserving behavior as I break file dependencies and won't try to fix
that confusion now.
2019-06-10 20:48:38 -04:00
Paul Licameli
d28ae00d88 Remove friends from Envelope 2019-06-10 20:48:38 -04:00
Paul Licameli
7ed99c6e8f Split EnvelopeEditor.cpp from Envelope.cpp...
... Envelope drops down out of the big strongly connected component, the new
piece stays behind
2019-06-10 20:48:38 -04:00
Paul Licameli
1dce507aaf Avoid repetition in computing arguments for export mixers 2019-06-10 20:48:37 -04:00
Paul Licameli
0563372216 Remove unnecessary #includes, free WaveformPrefs from cycles 2019-06-10 20:47:31 -04:00
Paul Licameli
bb7964122e Fix windows crash at startup, again...
... The fix done at 2f9322e was undone at 43b1afc because of the unacceptable
file dependencies.  This fixes it by other means.  Make a null check in
SetProjectTitle in case it is invoked before ProjectWindow has been constructed;
also ensure in ProjectManager::New that it is called at least once after that.
2019-06-10 11:49:38 -04:00
Steve Daulton
c5a1dad275 Fix bug 387
Mac and Linux (correctly) allow files to be saved with an arbitrary
file extension, or no file extension at all. For the exported file
to be visible in the export dialog, the dialog must include an optional
wildcard for "All files".
2019-06-09 19:25:59 +01:00
Paul Licameli
9bb5723777 More factoring of former AudacityProject and cycle-breaking...
... Four more pieces of former AudacityProject are:

1 ProjectAudioManager, for the callbacks from AudioIO
2 ProjectSelectionManager, for the callbacks from selection toolbars
3 ProjectHistory, for interacting with the undo manager
4 ProjectFileManager, combining parts that were in ProjectManager and
  ProjectFileIO; it is intermediate between them

To summarize relations among the nine pieces of former AudacityProject:

ProjectManager (highest level) uses:
   ProjectAudioManager, which uses ProjectAudioIO, and
   ProjectFileManager, which uses ProjectSelectionManager and ProjectFileIO

Those subordinate managers are also directly used elsewhere, avoiding uses of
the top manager that would make cycles.

ProjectHistory is used in many places to make undo transactions, and it also
uses ProjectFileIO for auto-save.  It uses ProjectWindow and ProjectSettings
too.

ProjectWindow is widely used, and uses ProjectAudioIO.

ProjectAudioIO and ProjectSettings are lowest-level and widely used.

Dependency of ProjectFileIO on ProjectWindow is now severed.

AutoRecovery is also split in two, with a new high-level file for a dialog.

There are thus five new .cpp files.  ProjectAudioManager and ProjectHistory are
still in the big strongly connected component, as still are ProjectAudioIO,
ProjectFileIO, ProjectSettings, and ProjectWindow.

13 files, including ProjectManager, are freed from it to higher levels.

Net loss of 11, leaving 102 files.

Import file handles also use a registration system so Import.cpp doesn't depend
on them.  This move was needed to free ProjectManager and others from the
cycles.
2019-06-09 12:10:53 -04:00
Paul Licameli
e2cf1d93c2 Import.cpp does not depend on subclasses of ImportPlugin...
... freeing 15 files from the big strongly connected component:

ImportFFmpeg & ODDecodeFFMpegTask (still in a cycle of two)
ImportFLAC
ImportGStreamer
ImportLOF
ImportMIDI
ImportMP3
ImportOGG
ImportPCM
ImportQT
ProjectFileManager
ProjectFSCK
ProjectManager
ProjectSelectionManager
ODDecodeFlacTask

And eight header files in src/import are deleted.

This breaks a lot of cycles because Import, which is still in the big component,
no longer includes ImportLOF, which recursively uses ProjectManager. A
registration system for the subclasses of ImportFileHandle allows that
recursion without the cyclic compilation dependencies.
2019-06-09 12:10:52 -04:00
Paul Licameli
3cf124d92a New ProjectFileManager from parts of ProjectManager and ProjectFileIO 2019-06-09 12:10:52 -04:00
Paul Licameli
8b70203e45 Lower functions from ProjectManager to ProjectFileManager...
... not improving the dependency graph, but it's a more sensible division of
duties, keeping related functions together.
2019-06-09 12:10:51 -04:00
Paul Licameli
27eeb1035c New files for ProjectFileManager 2019-06-09 12:10:51 -04:00
Paul Licameli
c24aa39e3a ProjectFileIO has fewer dependencies...
... after lifting some steps of file opening into ProjectManager

see also commit 0a109d2
2019-06-09 12:10:51 -04:00
Paul Licameli
43b1afc679 ProjectFileIO, ProjectFileManager don't use ProjectWindow...
... or SelectionBar, after lifting some steps of file opening into
ProjectManager

see also commit 0a109d2
2019-06-09 12:10:50 -04:00
Paul Licameli
4bf3365af4 Split class ProjectFileManager from ProjectFileIO...
... The former will handle File menu items, and the choosing of file paths to
write; the latter will handle the XML contents and do auto-save.  Auto-save is
a lower-level thing that must be done in many places whenever undo history
is pushed or modified.
2019-06-09 12:10:50 -04:00
Paul Licameli
e84dae4093 Remove a ProjectFileIO data member, a stack variable can serve 2019-06-09 12:10:50 -04:00
Paul Licameli
aa2850ec49 Eliminate a data member of ProjectFileIO...
... use a local variable of export file paths instead, for duration of full
save; not needed at all for auto-saves
2019-06-09 12:10:50 -04:00
Paul Licameli
4036ccbf24 Split ProjectSelectionManager from ProjectManager 2019-06-09 12:10:49 -04:00
Paul Licameli
997bf9781d New files for ProjectSelectionManager 2019-06-09 12:10:49 -04:00
Paul Licameli
0c6cda50c3 Split AutoRecoveryDialog.cpp from AutoRecovery.cpp...
... leaving AutoRecovery as a lower-level file, to be used by ProjectHistory
for auto-save, and not including ProjectManager.

The new file floats to a high level of the graph, but AutoRecovery.cpp
remains in the big strongly connected component.
2019-06-09 12:10:48 -04:00
Paul Licameli
186f2f6ac7 Split class ProjectSelectionManager from ProjectManager...
... handling the callbacks from the selection toolbars.

Next ProjectFileManager will be split out of ProjectManager, and
ProjectSelectionManager will be used by it during file opening, so separating
files for it avoids a cycle.
2019-06-09 12:10:48 -04:00
Paul Licameli
f03684db4f New class ProjectHistory split from ProjectManager for undo, etc...
... And yet fewer inclusions of Projectmanager.h, though it's still not yet
free of cycles
2019-06-09 12:10:48 -04:00
Paul Licameli
7857d59f57 Split ProjectAudioManager from ProjectManager 2019-06-09 12:10:47 -04:00
Paul Licameli
d979a8959b New files for ProjectAudioManager...
... This eliminates some inclusions of ProjectManager, helping to free it from
cycles into a higher level
2019-06-09 12:10:47 -04:00
Paul Licameli
0c2c2803a3 New class ProjectAudioManager implements AudioIO callbacks 2019-06-09 12:10:46 -04:00
Steve Daulton
feb35a2601 Update beatfinder to version 4
No changes to algorithm or behaviour, but removed duplicate resampling.
2019-06-09 16:57:40 +01:00
Paul Licameli
090374381c Supply #include "Experimental.h" in recent new files 2019-06-09 08:56:38 -04:00
Paul Licameli
b020e8fbd0 Remove unnecesary inclusions of TrackPanel.h 2019-06-08 16:18:39 -04:00
Henric Jungheim
7d38ef8ed5 Declare GetProjectFrame() as AUDACITY_DLL_API.
The mod-null project uses it so it is presumable intended to be part of the
external API.
2019-06-08 12:13:14 -07:00
Henric Jungheim
acadd4b7fb Fix comment typo. 2019-06-08 12:07:25 -07:00
Paul Licameli
577fdb200f Fix error in playing from cursor, introduced at 4abc71c 2019-06-08 13:59:20 -04:00
Paul Licameli
66a0a93e17 Fix crash opening History...
... This should have been done with commit 4abc71c

But the C style pointer casting (bad practice!) left the mistake compilable.

I reviewed all other casts to wxWindow* in the source and this was the only
bad one.
2019-06-08 10:17:30 -04:00
Paul Licameli
d7e9d7a38e Fix a comment 2019-06-08 10:17:30 -04:00
David Bailes
a55cba3241 Fix tab order of top panel
Problem:
When the keyboard first moves to the top panel using ctrl+f6, the click to pin button in the ruler is the focus. It should be the first control in the top tooldock.
This problem was introduced by commit: 4abc71c. Prior to this commit the top tooldock was created before the ruler, and afterwards the order was reversed. The default tab order is the order of creation.

Fix:
Explicitly set the tab order of the top tooldock and the ruler, so that the creation order doesn't matter.
2019-06-08 12:42:56 +01:00
Paul Licameli
ee592b633e Revert "Put initial focus in the Control toolbar again..."
This reverts commit 6f3342a8956b423299fe8fd314afb823de0deacb.
2019-06-08 07:00:46 -04:00
Paul Licameli
0b85251885 Fewer inclusions of AudioIO.h and Import.h 2019-06-06 12:53:20 -04:00
Paul Licameli
6f3342a895 Put initial focus in the Control toolbar again...
... it had changed after commit 4abc71c
2019-06-06 12:42:51 -04:00