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

46 Commits

Author SHA1 Message Date
Paul Licameli
7a0475e39f Remove most uses of AUDACITY_OLD_STD 2018-05-10 00:56:36 -04:00
Paul Licameli
356763c90b remove unused 2018-01-16 17:51:03 -05:00
Paul Licameli
cb403954fa Use std::[tr1::]unordered_(set|map), not the wxWidgets container macros 2018-01-08 18:22:51 -05: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
55439247ad All the catches are in place for BlockFile and other errors, now throw. 2017-04-03 23:32:40 -04:00
Paul Licameli
7159966eb4 Comment that cache-filling should be no-fail (we don't use it anyway) 2017-03-21 14:11:26 -04:00
Paul Licameli
81285ee0c1 More const and override 2017-03-17 17:52:20 -04: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
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
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
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
52cb094f0f A safenew and comment changes 2016-08-16 13:00:07 -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
2ede67be96 Use type alias for pointer to BlockFile, which is still a dumb pointer 2016-08-16 12:29:59 -04:00
Paul Licameli
41efaeeef0 Fix Windows build 2016-08-14 09:35:04 -04:00
Paul Licameli
46f38708ed Dir manager uses std::shared_ptr 2016-08-13 12:23:05 -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
f94b3b3afa Add some const qualifiers to BlockFile methods 2016-04-10 21:05:20 -04:00
Paul Licameli
527a826b86 Define and use PROFILE_DLL_API 2016-02-24 21:29:25 -05:00
Paul Licameli
7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls.  Mostly useful as documentation of design intent.

Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
2016-02-24 20:58:30 -05:00
Paul Licameli
9bf098c7d9 Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -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
ca56876aaf Various minor fixes in Sequence 2016-02-04 01:06:51 -05:00
Paul Licameli
38ba19183d One less indirection accessing SeqBlock 2016-02-03 22:17:07 -05:00
Paul Licameli
d39eaa4e65 Remove WaveTrack.h from other headers 2015-07-28 10:02:05 -04: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
benjamin.drung@gmail.com
277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
richardash1981
72f6eded20 I got fed up of unused parameter warning from my compiler hiding the warnings I wanted to see, so have added WXUNUSED annotations to a lot of widely used header files, and cleaned up trailing junk on the way. 2012-12-31 16:57:15 +00:00
v.audacity
6f50a64050 comments, cleanup 2012-07-19 23:42:47 +00:00
v.audacity
4038f214cd (bug 451, p2) Add some asserts against mMaxSamples. In Sequence::Paste(), correct var largerBlockLen declaration to be sampleCount, not the smaller int, that can overflow on comparing to sampleCount and add log error msg. Add alert dialog, log warning, and limitation in Sequence::WriteXML() if mMaxSamples exceeded. Obviate EnvPoint::WriteXML(), unused. A few comments on some "TODO" comments. Make DirManager::WriteXML() fail in debug mode, as it should not be called. 2011-11-01 04:39:14 +00:00
mchinen
ee9e244b77 Bug 137 (P2) - fix false positive detection of orphaned files that belong to the clipboard (triggered by cut commands) 2011-04-21 21:51:56 +00:00
mchinen
91d8f132a6 Bug 330 (P2) - Fix an issue where multiple projects would cause the warning dialogs to pop up above the wrong project.
I refactored the code into AudacityApp with a new timer.  This is provisional pending discussion - if it is decided that it should go somewhere else I will move it.
2011-03-29 23:39:00 +00:00
mchinen
df6e56a57e DirManager.cpp: refactor near identical methods Move/CopyToNewProjectDirectory to use the same code 2011-02-02 20:42:43 +00:00
v.audacity
8f20e65167 (bug 20, P2)
Fix auto-recovery failures that Gale reported, when auto-recovered projects had been saved to top-level directories, e.g., "E:\dtmf.aup" on Windows. Problem was with file separators. This DirManager code is quite convoluted, touched by multiple chefs, and called from many places, so this fix does not correct the origination(s) of the problem, but doesn't break anything higher up, and is a failsafe against probably multiple errors at higher levels.

Make some parameter names clearer vs class vars. Readability is better if the names are not lexicographically exactly the same.
2010-09-28 05:03:50 +00:00
v.audacity
a26652acfd (bug 20, P2)
Changed the bSilentlyCorrect parameter to DirManager::ProjectFSCK() to be bAutoRecoverMode. If project check errors are found during auto-recovery, it's hazardous to allow the user the various options available during normal project open. But rather than squelching the messages as well as option dialogs during auto-recover, show the messages in the log and bring up an alert. 

This means the helper methods Find*() no longer need bSilentlyCorrect -- they always report to the log.
2010-09-17 22:50:01 +00:00
v.audacity
ad09727b7f Fix some old typos, indentations.
Clarify some comments. 

Remove some DirManager methods that were declared but not defined.
2010-08-25 23:24:02 +00:00
v.audacity
70145b8457 (bug 113)
In light of discussion about crazy things users do, decided to leave in the former "Temporarily replace..." options, but changed the wording to "Treat missing audio as silence" and warn that the waveform may not show silence.

Added FSCKstatus_SAVE_AUP flag (and returned FSCKstatus_* to being flags). FSCKstatus_SAVE_AUP is set for missing aliased files, so that AudacityProject does a save, fixing a bug where after "Close project immediately...", opening other projects failed in a way that made them incorrectly report missing _data folders, rather than go through Project Check (DirManager::ProjectFSCK). 

Decided to continue with the fake-out fixes for missing aliased files and missing SimpleBlockFiles, i.e., writing zeroes instead of replacing with SilentBlockFiles. Replacing is difficult, and there are other places where the zeroes trick is used, e.g., after project check, if there's a disk error, such as a .au being inaccessible in the middle of edits. 

Made the "permanent immediately" and "regenerate" options not do a PushState, because they were not possible to Undo.
2010-08-24 02:52:01 +00:00
v.audacity
ea68057638 (bug 113)
DirManager::ProjectFSCK (project check):
   Made the enumerations interleaved with handling, because, 
   for example, user choosing to replace missing aliased block files with silence 
   needs to put in SilentBlockFiles and delete the corresponding auf files, 
   so those would then not be cumulated in missingAliasBlockFileHash.
   We still do the FindX methods outside the conditionals, 
   so the log always shows all found errors.

   Moved check for orphan files to last, so user first has a chance to get 
   messages about missing files that user may have mistakenly renamed 
   (and the renamed ones would appear to be orphans).

   Re-ordered user choices for orphan files dialog to safest-to-boldest.

   Changed FSCKstatus_CLOSEREQ and FSCKstatus_CHANGED to be integers rather 
   than binary flags. They were never returned with both in the result, nor used that way.

   Made the project check log warnings use full paths instead of just file names.


Removed close box and system menu from MultiDialog, so that project check dialogs cannot just be closed. User has to decide on one of the choices. 

Fixed some handling in AudacityProject::OnShowLog(). If the log was already showing before MultiDialog came up, it froze because it was not re-enabled.
2010-08-20 03:19:14 +00:00
v.audacity
2ef7a3fd31 (bug 113)
More comments about things to fix (FIX-ME items this time).

Made AudacityProject::OnShowLog make the log window taller so more likely to show the bottom. The implementation of wxLogWindow makes it hard/impossible to scroll to the bottom.

Fix error of duplicate reports of missing aliased files.
2010-08-17 03:46:58 +00:00
v.audacity
af52a83ec1 (bug 113)
restructuring and renaming for clarity, granularity, and reduction of code duplication

Found and commented on more errors in this code. In the "Close immediately" cases, it doesn't do a real close and that can break subsequent opening of other or the same problematic projects. 

Changed several cases where GetDirManager()->ProjectFSCK returned FSCKstatus_CHANGED. These caused a PushState, but Undo could not do anything. Changed corresponding wordings for "Replace missing audio with silence" to say "permanent immediately" instead of "permanent on save", which was incorrect.
2010-08-15 01:22:24 +00:00
v.audacity
5d2f9301b6 (bug 113)
restructuring and renaming for clarity, granularity, and reduction of code duplication
2010-08-13 04:15:17 +00:00
v.audacity
8f8504b5a6 some progress on bug 113, including rewordings DependencyDialog based on some suggested by Gale
code cleanup

naming improvements for clarity (e.g., aliasedFileName instead of aliasedFile for an instance of wxFileName -- it's not an instance of AliasedFile)

parens, not square brackets, for parenthetic phrases
2010-07-28 23:06:10 +00:00
ra
e74978ba77 Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches 2010-01-23 19:44:49 +00:00