1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 07:29:29 +02:00

103 Commits

Author SHA1 Message Date
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
Paul Licameli
dbaa811577 Stack-allocate where possible! ...
... Removed many unnecessary naked news and deletes.
2016-02-17 18:15:57 -05:00
Paul Licameli
7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Paul Licameli
56e7653343 "delete"->"DELETE" in comments, easier to find remaining naked operator delete 2016-02-14 18:50:45 -05:00
Paul Licameli
38ba19183d One less indirection accessing SeqBlock 2016-02-03 22:17:07 -05:00
Leland Lucius
7bc176f5ac Just adding some comments for later work 2015-08-14 18:40:29 -05:00
Paul Licameli
d39eaa4e65 Remove WaveTrack.h from other headers 2015-07-28 10:02:05 -04:00
Paul Licameli
7b01339e51 Future subclasses of PrefsDialog may choose the preferred page by other means. 2015-07-26 19:53:15 -04:00
Daniel Winzen
759ff8cd0d Performance improvements 2015-04-23 16:07:25 +02:00
lllucius
09c213feed Applying Paul's fix for bug #818
While I didn't see the crash in action, the patch definitely
fixes the possibility of one.
2015-01-20 06:34:55 +00:00
lllucius
f60afbb8da Fix disk space checking to prevent error message
The error message only happens in debug builds, but the cause of
the message still happens in release builds.  Basically, the temporary
project directory may not yet be created if the person is only monitoring.
2015-01-06 16:16:01 +00:00
james.k.crook@gmail.com
8a9987a0d9 From: martin@steghoefer.eu [PATCHES 02-15 of 15] Fix runtime problem with wxWidgets 3.0:
Correct string formatting for:
2/15  %d + enum => %d + int
3/15  %lld + int64_t => %lld + long long
4/15  %d + int64_t => %lld + long long
5/15  %d + double => %f + double
6/15  %d + int32_t => %d + int
7/15  %d + intptr_t => %p + void*
8/15  gint, guint
9/15  %d + long => %ld + long
10/15 %n + int => %d + int
11/15 %x + int => %x + unsigned int
12/15 %f + int => %d + int
13/15 %S + wxChar* => %s + wxChar*
14/15 %d + size_t => %d + int
15/15 %d + size_t => %lld + long long

"The functions wxString::Format, wxString::Printf (and others indirectly) have become stricter about parameter types that don't match (format specifier vs. function parameters). So the bugs (that were already present in audacity before) become visible in wx3.0 as error message dialogs. I've checked all occurrences of Printf, wxPrintf, PrintfV, Format, FormatV, wxLogDebug and wxLogError systematically and made the type match."

Note (9/15): In TrackPanel.cpp, ExportMP2.cpp and CompareAudioCommand.cpp this patch supersedes related change done in r13466 because the new solution requires fewer casts and therefore simplifies the code.

Note: Many .po files are affected, and we need to be very careful about this.  Incorrect "%d" and similar in translation files may lead to crashes in those languages (only).  This is something we should actually have been more careful about in the past.  We need to write a script to check that the "%d" and similar format specifiers match between English and translation.
2014-11-08 16:42:34 +00:00
benjamin.drung@gmail.com
277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
v.audacity
cc876ce7be just some cleanups on FIXMEs and unused method parameters 2013-08-31 05:57:48 +00:00
v.audacity
c7daafede2 In off-list discussion, Steve mentioned that kdevelop / kate highlighting recognizes "FIXME", but not "FIX-ME", which has been the Audacity convention. This commit changes Audacity code to use the "FIXME" convention (though I've never known it as convention and MSVC doesn't recognize it).
Also, minor change in WaveTrack.cpp in the effort on bug 641. Should have no functional difference.
2013-08-24 20:30:47 +00:00
v.audacity
9d0daf8662 Campbell Barton's patch to turn many, many tabs to our 3-space convenbtion 2013-02-20 23:42:58 +00:00