1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

118 Commits

Author SHA1 Message Date
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
James Crook
95861bf7f2 Bug 1567 - Amelioration. Delete EMPTY temp dirs on close in multiproject
This fix adds flags to RecursivelyRemove to be more specific about what to remove.  With the kCleanDirsOnlyIfEmpty option it is now safe to call CleanDir on closing a second unsaved project.  In particular, if some of the wave has been copied to the clipboard, that part of the wave does not get deleted on close, and is available to paste into the other project which is still open.  In CleanDir the folders containing those block files are not deleted.  They will get deleted later when the second project is closed too.

CleanDir is now called with that option when closing a project that is not the last one being closed.  .DS_Store files, if present, will be deleted, and any empty directories for that project.  I have also tested that clipboard contents are preserved.
2017-03-01 15:57:01 +00:00
James Crook
1ffe7367a3 Comment about missing/broken ERR_HANDLING. 2017-02-24 17:21:17 +00:00
James Crook
89c44f9cd6 Add fileSpec to CleanDir, so can be selective about files to delete.
Note that CleanDir may be used on a temp directory, deleting entire projects, and in that case
we delete all files too, but do not want to delete files that are at the top level, only ones inside
projects.
2017-02-20 12:58:11 +00:00
James Crook
0a518b65d1 Don't follow symlinks in RecursivelyEnumerate
Projects will only have symlinks in them if they have been tampered with, and then
following the links, especially when doing CleanDir(), would be dangerous.  So don't.

Improved comments, otherwise it isn't clear that CleanDir is needed on Windows
and Linux, not just Mac.  It is deleting whole subdirs, not just .DS_Store files.
2017-02-20 12:17:16 +00:00
Paul Licameli
5b10c386e9 Bug1594, 1567: Don't destroy source project when saving-as! 2017-02-19 12:55:01 -05:00
Paul Licameli
856dfef30f More accurate comments, after foregoing bug1567 fixes. 2017-01-31 14:25:35 -05:00
Paul Licameli
5392feefd4 Bug1521 residual: Save new project, still must remove project* folder 2017-01-31 12:41:54 -05:00
Paul Licameli
6b65375ee5 Bug1521, bug1567 Mac: wipe .DS_Store in temp folder when saving too 2017-01-28 17:23:15 -05:00
Paul Licameli
dd836f4841 Bug1567 Residual - Use wxDIR_HIDDEN in recursive delete.
Added for consistency with log of remaining files.  This change should clear up .DS_Store on Mac, and so help with 1567 residual issue when files are not deleted on exit.
2017-01-28 11:33:55 +00:00
Paul Licameli
04c3a7c13d wxRmDir() diagnostics
Logs files remaining, if wxRmDir() failed in our function, RecursivelyRemove.
2017-01-27 19:46:55 +00:00
Paul Licameli
62cfeea4a6 Unless on Windows, don't remove directories like files...
... avoiding spurious log messages.
2017-01-27 19:40:26 +00:00
Paul Licameli
ad04187a41 Change sampleCount arguments, variables, return values to size_t...
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
2016-09-15 21:03:17 -04:00
Paul Licameli
d783762737 Remove unnecessary std::move in return statements...
... and comment where it is necessary.
2016-09-15 07:39:46 -04:00
Paul Licameli
debe935099 Bug1482: fix hangs caused by 8b72bd2f92b27b60a3e631dab53b16750228ea59 2016-08-17 16:49:55 -04:00
Paul Licameli
8b72bd2f92 Manage block files with std::shared_ptr, BlockHash stores weak_ptr 2016-08-16 12:29:59 -04:00
Paul Licameli
84ccdca5c3 Gather balance info hashes into one struct guarded by an accessor...
Doing BalanceInfoDel in this delayed fashion will be needed when the other
call to it is eliminated, as shared_ptr simplifies the management of BlockFile
and makes the many calls to Ref and Deref disappear.
2016-08-16 12:29:59 -04:00
Paul Licameli
cde61edbf4 Don't assume BlockHashes contain non-null pointers ...
... They won't always, when they become weak pointers.
2016-08-16 12:29:59 -04:00
Paul Licameli
e7b4d935a5 Hide the use of new in factory functions for BlockFiles 2016-08-16 12:29:59 -04:00
Paul Licameli
2ede67be96 Use type alias for pointer to BlockFile, which is still a dumb pointer 2016-08-16 12:29:59 -04:00
Paul Licameli
46f38708ed Dir manager uses std::shared_ptr 2016-08-13 12:23:05 -04:00
Paul Licameli
3d102a3390 Access BlockFile::mFileName without copying, with proper multithreading cautions 2016-04-17 13:58:21 -04:00
Paul Licameli
3e6f0bed78 fix bugs in previous 2016-04-17 13:58:21 -04:00
Paul Licameli
b6fdffbab2 Don't copy wxFileName often, it's not lightweight! Use wxFileNameWrapper...
... which is a new class that defines moves.
2016-04-16 11:57:39 -04:00
Paul Licameli
6c2773cb0b This really fixes a bug, but only with certain Experimentals enabled...
... and certain other changes too.  It is involved in code that makes sure
the save of a file with incomplete on-demand loads properly waits for them
to finish.  It should not really affect production.

The experimentals are EXPERIMENTAL_OD_FLAC and EXPERIMENTAL_OD_FFMPEG.
2016-04-11 14:04:55 -04:00
Paul Licameli
df28289058 Avoid repeated calls to BlockFile::GetFileName...
... because wxFileName is not a featherweight.
2016-04-11 09:46:00 -04:00
Paul Licameli
f94b3b3afa Add some const qualifiers to BlockFile methods 2016-04-10 21:05:20 -04:00
Paul Licameli
0c9deb398c Fix mac build. No standard headers in Audacity.h. 2016-03-01 12:22:37 -05:00
Paul Licameli
1398d1a953 Fix warnings for ambiguous else 2016-02-26 14:56:29 -05:00
Paul Licameli
a8652c5e74 uses 2016-02-25 20:18:31 -05:00
Paul Licameli
9bf098c7d9 Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -05:00