1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

10179 Commits

Author SHA1 Message Date
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
Paul Licameli
236b188d6b ProjectWindow does not depend on ProjectFileIO 2019-06-05 07:24:01 -04:00
Paul Licameli
2f9322e7f7 Fixes for Windows build and run-time problems suggested by Pokechu22 2019-06-05 07:24:01 -04:00
Paul Licameli
f951fe0522 CommandManager.cpp compilable without AudacityHeaders.h 2019-06-03 09:54:58 -04:00
Paul Licameli
ba6db6e438 class AudacityProject is gutted and becomes a low-level class! ...
... Five new classes are split out for various special purposes, one odd thing
(the play region) is moved into ViewInfo, and very little remains in
Project.cpp and Project.h.

The five new things are intended to rank thus in the compilation dependency
hierarchy:

ProjectManager
ProjectFileIO
ProjectWindow
ProjectSettings ProjectAudioIO

And AudacityProject is lower than all.

The project class now holds the file name, status message, and a pointer
to its window, and a few other things that should perhaps go to
ProjectSettings instead.

It is also a container of other attached extension objects and window pointers,
which it treats opaquely.  The several attached classes define their static
Get() functions, non-intrusively in AudacityProject.

It is also an event handler where other objects can post events or bind to
them, defining their own added event protocols non-instrusively.

The files for the new classes are still stuck in the big strongly connected
component, but Project is freed from it, with eight others -- notably
DirManager is again free (see comments at 2947a43).

The nine are:
AButton
DirManager
MissingAliasFileDialog
PCMAliasBlockFile
Project
Sequence
SilentBlockFile
SimpleBlockFile
Tags
2019-06-03 01:43:27 -04:00
Paul Licameli
63b93fd2d1 Play region and its lock are stored together in ViewInfo 2019-06-03 01:43:27 -04:00
Paul Licameli
0a843806f8 Split class ProjectWindow out of AudacityProject...
... as a middle-level class that handles scrolling and zooming
2019-06-03 01:43:26 -04:00
Paul Licameli
4f940c855d New files for ProjectWindow 2019-06-03 01:43:26 -04:00
Paul Licameli
4abc71c6b4 Do the separation of classes ProjectWindow and AudacityProject 2019-06-03 01:43:23 -04:00
Paul Licameli
135af0480e Split class ProjectFileIO out of AudacityProject...
... as a middle-level class that handles reading and writing of the .aup file
format.

There is only one small dependency on ProjectWindow for
mbInitializingScrollbar. Can that be removed, so we can just use
GetProjectFrame instead?
2019-06-03 01:24:03 -04:00
Paul Licameli
3fc961f74a New files for ProjectFileIO 2019-06-03 01:24:01 -04:00
Paul Licameli
f7e79406ee Split class ProjectManager out of AudacityProject...
... as a high-level class allowed access to all of the sub-structures,
handling major events in project lifetime (creation, destruction, pushing
and resetting undo states), and also file opening and import
2019-06-03 01:21:15 -04:00
Paul Licameli
7b8bfd1d02 New attached structure ProjectFileIO handles load and save 2019-06-03 01:21:15 -04:00
Paul Licameli
fee5582826 New files for ProjectManager 2019-06-03 01:21:12 -04:00
Paul Licameli
0d1d8d20c6 Move management of saved window size into ProjectManager...
... So that class AllProjects does not use ProjectWindow
2019-06-03 01:18:12 -04:00
Paul Licameli
4274d44ab7 New attached structure ProjectManager handles project lifetime...
... that is, a factory function, open, close, import, undo/redo/rollback.

Also the callbacks from AudioIO, which need to invoke undo history push when
recording stops.

It is meant as a high-level class using several of the other things attached
to the project, while AudacityProject will be a low level class acting mostly
as just the container of the attached structures.
2019-06-03 01:18:12 -04:00
Paul Licameli
c629d44c41 Split class ProjectAudioIO out of AudacityProject...
... as a low-level class to store the AudioIO token associated with the
project, and pointers to meters
2019-06-03 01:18:11 -04:00