1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-08 15:52:53 +02:00

148 Commits

Author SHA1 Message Date
Paul Licameli
805af452a4 static DirManager::Get()...
... not member functions of AudacityProject

This puts DirManager.cpp and four others back into the big strongly connected
component of link dependencies.  They will break out again when Project.cpp
becomes a low-level file.
2019-05-23 13:10:19 -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
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
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
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
338d7cd164 A class encapsulating the global clipboard 2019-05-17 06:47:53 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
James Crook
71a2683c5f Add a TODO comment. 2019-04-04 12:51:29 +01:00
Paul Licameli
3760db9dff Remove wx/wxchar.h from headers 2019-03-29 15:56:54 -04:00
Paul Licameli
c698d85cc8 more comments for including Audacity.h 2019-03-23 14:16:05 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
1bcb7c20a5 Remove some nested #include from Project.h 2019-03-16 13:09:54 -04:00
Paul Licameli
a30000cf74 Use type aliases FilePath, FilePaths...
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
2019-03-15 15:18:11 -04:00
Paul Licameli
b8c0125143 Replace comparisons against wxEmptyString with empty() 2019-03-14 16:20:18 -04:00
Paul Licameli
50074f2cfe Replace comparisons against "" with empty() 2019-03-14 13:23:41 -04:00
Paul Licameli
795b6a2e42 More std:: style for wxString and wxArrayString...
... Replacing:

Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
   (but only when second argument was true or default)
2019-03-10 14:45:12 -04:00
Paul Licameli
dd8eb9e3d9 Less use of wxArrayString::Index() ...
... instead use the utility make_iterator_range and its index() or contains()
method.  This generic utility works with any container defining begin() and
end().

This further lessens dependency on wxWidgets container idioms.
2019-03-10 14:45:06 -04:00
Paul Licameli
2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
Paul Licameli
e832b6895e Case insensitive comparison for file extensions in two places...
... consistent with handling of file extensions elsewhere
2019-03-10 12:55:53 -04:00
Paul Licameli
9d18263be6 Bug2059: Save empty,record,save-as shouldn't delete old _data folder 2019-02-09 17:04:45 -05:00
Paul Licameli
529e1e2afb Bug1979 partial: Faster first-time save, if possible, on Mac and Linux 2018-10-13 13:56:05 -04:00
Paul Licameli
ec506ab52b Define DirManager::ProjectSetter so that commit steps can be deferred 2018-10-13 12:55:29 -04:00
Paul Licameli
0db0c6e0d5 Reorganize some commit logic in DirManager::SetProject 2018-10-13 12:55:29 -04:00
James Crook
5fd95dd131 Fix C4456 Warnings.
"C4456 declaration hides previous local declaration."
These arise from repeated declarations of the same name.
2018-10-10 17:28:50 +01:00
Paul Licameli
968d63d5fd Rewrite many iterations over tracks and channels in various places 2018-10-01 13:35:51 -04:00
Paul Licameli
8e0cffb7f2 Simplify GuardedCall and default its return type to void 2018-01-13 01:32:41 -05:00
Paul Licameli
7fd78183d2 Remove needless uses of wxString::c_str() in wxString::Format...
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
2018-01-01 20:34:33 -05:00
Paul Licameli
ccb4bbac33 Translate "Message" as default title of message box...
... This required a sweeping change of all calls to wxMessageBox!  But it seems
safe to me, despite the great number of touched files.
2018-01-01 17:50:02 -05:00
Paul Licameli
6463e12576 Move MyCopyFile into class FileNames 2017-12-31 16:18:55 -05:00
Paul Licameli
e06a6fd797 Fix blank filenames in .aup saved then saved-as twice to same path...
Bug was introduced at commit c1d1bee6b1914faba750dd4c488e99ced32edad4
2017-12-30 18:00:18 -05:00
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
Paul Licameli
0532f9be37 More sanity checking in file save ...
... against corruption as seen in:

http://forum.audacityteam.org/viewtopic.php?f=47&t=97787

Maybe this early check would have alerted the user sooner and prevented
trouble.
2017-11-22 22:41:35 -05:00
Paul Licameli
b94b49265a Don't make orphans in original after save-as 2017-11-08 03:52:40 -05:00
Paul Licameli
7eeb88384d Compensate for bug in wxCopyFile, which can return incorrect success 2017-10-25 15:06:34 -04:00
Paul Licameli
f370df6520 Sense empty .au at opening, treat as missing, give recovery options 2017-10-21 13:02:34 -04:00
Paul Licameli
e050516702 Correct other failure paths in DirManager::SetProject 2017-10-21 13:02:34 -04:00
Paul Licameli
15a1fa14e9 a comment about the new saving procedure 2017-10-21 13:02:34 -04:00
Paul Licameli
c1d1bee6b1 Better error handling when moving a project to another directory...
... Do NOT remove original files, or change the stored path names, until after
successful creation of ALL new copies; then, it is a no-throw commit operation.

In case of failure of some copies, cleanup code already existed to fix
partial results.
2017-10-21 12:59:36 -04:00
Paul Licameli
39a5669cb9 Allow user cancellation of save 2017-10-20 23:56:23 -04:00
Paul Licameli
8a762f95b6 In case save of new project fails, clean up the _data directory 2017-10-16 21:22:19 -04:00
Paul Licameli
55439247ad All the catches are in place for BlockFile and other errors, now throw. 2017-04-03 23:32:40 -04:00
Paul Licameli
ed6f2ea80f Exception safety in: locking of BlockFile for read 2017-03-21 14:11:27 -04:00
Paul Licameli
d11027c2a7 Allow exceptions from BlockFile::Recover, handle them in ProjectFSCK 2017-03-17 17:53:02 -04:00
Paul Licameli
38236a807c More new -> NEW, delete -> DELETE in comments 2017-03-17 17:52:41 -04:00
James Crook
4576ccb1ad HasFiles and HasSubDirs require a successfully opened directory.
Issue found by David Bailes.
2017-03-02 13:08:19 +00:00