1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 06:09:47 +02:00

6233 Commits

Author SHA1 Message Date
Paul Licameli
f1cce8aa78 Define an AudacityException subclass for assertion violations 2017-03-17 17:52:57 -04:00
Paul Licameli
df077d171a Exception framework: define AudacityException and GuardedCall...
AudacityException is an abstract base class for exceptions generated by
Audacity.

GuardedCall wraps any function (usually a lambda) in an appropriate catch
block.

It can also accept a second function that defines a catch block action, which
can rethrow or return a value for the GuardedCall.

It can also accept a third function, that defines another, delayed action that
executes in the main thread at idle time if the second function intercepts an
AudacityException and completes without rethrow.

Defaults for the second function simply return void or false.  Default for the
third function invokes a virtual method of AudacityException, which for
subclass MessageBoxException, displays a message box.
2017-03-17 17:52:57 -04:00
Paul Licameli
26f917b1fd On-demand tasks check for i/o errors, and if so, make no false progress 2017-03-17 17:52:56 -04:00
Paul Licameli
1c91c2b804 ODDecodeTask makes progress unless there is an exception 2017-03-17 17:52:56 -04:00
Paul Licameli
1a3212611b ODComputeSummaryTask is safe for exceptions; makes no progress then 2017-03-17 17:52:55 -04:00
Paul Licameli
5de19dc952 ODDecode task checks blockfile error, making no progress if so...
... also replace explicit mutex locking with RAII and atomics.

This is a part of the big project that handles failure to write block files, as
from disk exhaustion.  ODDecodeBlockFile::WriteODDecodeBlockFile is the one
place calling WriteSimpleBlockFile but not (as in SimpleBlockFile constructor)
throwing an exception.

It is called only when attempting to recover files at open time, or in worker
threads in an EXPERIMENTAL code branch.
2017-03-17 17:52:55 -04:00
Paul Licameli
a399d4e23a No naked malloc (calloc, strup, ...) and free! 2017-03-17 17:52:54 -04:00
Paul Licameli
1126925438 Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
Paul Licameli
cab99f7234 Remove naked malloc (or similar) and free in: other effects 2017-03-17 17:52:53 -04:00
Paul Licameli
0c7e467a08 Remove naked malloc (or similar) and free in: reverb 2017-03-17 17:52:53 -04:00
Paul Licameli
03809532ca Remove naked malloc (or similar) and free in: Equalization48x 2017-03-17 17:52:53 -04:00
Paul Licameli
1614db9994 Remove naked malloc (or similar) and free in: export 2017-03-17 17:52:52 -04:00
Paul Licameli
9314fe0cc0 Remove naked malloc (or similar) and free in: import 2017-03-17 17:52:52 -04:00
Paul Licameli
48d951d9c3 Remove naked malloc (or similar) and free in: RawAudioGuess.cpp 2017-03-17 17:52:52 -04:00
Paul Licameli
53b9869268 Remove naked malloc (or similar) and free in: FFmpeg 2017-03-17 17:52:51 -04:00
Paul Licameli
58574f2f78 Redo type HFFT as a smart pointer, remove malloc and free 2017-03-17 17:52:51 -04:00
Paul Licameli
c5007d846e No naked array new! 2017-03-17 17:52:50 -04:00
Paul Licameli
6ca89c28ff Remove naked new[] in: builtin effects 2017-03-17 17:52:49 -04:00
Paul Licameli
f858d97352 Remove naked new[] in: linear algebra functions for Repair 2017-03-17 17:52:49 -04:00
Paul Licameli
cb05476c45 Remove naked new[] in: effects plug-ins 2017-03-17 17:52:48 -04:00
Paul Licameli
a4c7d37d3e Remove naked new[] in: effects framework 2017-03-17 17:52:48 -04:00
Paul Licameli
692a033968 Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Paul Licameli
ce2e154e89 Remove naked new[] in: Benchmark 2017-03-17 17:52:47 -04:00
Paul Licameli
18be1bdad6 Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00
Paul Licameli
2b23667211 Remove naked new[] in: AudioIO 2017-03-17 17:52:46 -04:00
Paul Licameli
e6db1a57a3 Remove naked new[] in: blockfile and commands 2017-03-17 17:52:46 -04:00
Paul Licameli
88cac8cd7e Remove naked new[] in: import 2017-03-17 17:52:46 -04:00
Paul Licameli
9bdc7b2cbf Remove naked new[] in: export 2017-03-17 17:52:45 -04:00
Paul Licameli
ea05fac870 Remove naked new[] in: mixer 2017-03-17 17:52:45 -04:00
Paul Licameli
0113e6f44f Remove naked new[] in: ondemand, toolbars, widgets 2017-03-17 17:52:45 -04:00
Paul Licameli
089e696cab More utilities in MemoryX.h 2017-03-17 17:52:44 -04:00
Paul Licameli
5ca8766c52 define freer 2017-03-17 17:52:44 -04:00
Paul Licameli
1eff721f09 Define some useful type aliases for arrays of floats and doubles 2017-03-17 17:52:43 -04:00
Paul Licameli
aebaaf46a0 require unsigned arguments for Array(s)Of::reinit 2017-03-17 17:52:43 -04:00
Paul Licameli
ef2b747c16 Define ValueRestorer for a frequent kind of RAII action 2017-03-17 17:52:43 -04:00
Paul Licameli
a74ea83332 Last loose ends in removal of all naked scalar new 2017-03-17 17:52:42 -04:00
Paul Licameli
bb5dc07c51 Fix one scalar naked new that crept back in 2017-03-17 17:52:41 -04:00
Paul Licameli
38236a807c More new -> NEW, delete -> DELETE in comments 2017-03-17 17:52:41 -04:00
Paul Licameli
ec0297ec28 more safenew 2017-03-17 17:52:41 -04:00
Paul Licameli
9119d703ce Wave track duplication: don't append empty clips, do copy cutlines 2017-03-17 17:52:40 -04:00
Paul Licameli
b4734ff790 Duplicate command copies cutlines 2017-03-17 17:52:40 -04:00
Paul Licameli
934a505e1a Changes in WaveClip construction...
... Eliminate CreateFromCopy, add new one-step constructor instead.
It was wasteful to create a copy only to re-create the Sequence at once.

Sequence::Copy is a factory returning a unique_ptr.

Some error checks are removed, but there will be exceptions instead later.
2017-03-17 17:52:39 -04:00
Paul Licameli
25619fb46e Don't create placeholder clips in Duplicate command ...
... when there is no clip at the right edge of the selection.
2017-03-17 17:52:39 -04:00
Paul Licameli
65c722bfe5 Comment: resample, reformat of WaveClip needs no recursion for cutlines 2017-03-17 17:52:39 -04:00
Paul Licameli
3d29ba12a6 Various precautions, efficiencies, fixes of unreported bugs 2017-03-17 17:52:37 -04:00
Paul Licameli
ac246d0468 Fix bug 1566 differently (signed/unsigned comparison) 2017-03-17 17:52:37 -04:00
Paul Licameli
4744f5cc5e OD tasks store weak pointers to block files...
... This means unneeded block files can be reclaimed sooner.

This also eliminates the checks of use_count, which might vary in a
multithreaded context; though that didn't really matter (because once it
was below 2, the function had the only remaining shared_ptr to the block file,
so it could not have increased again to 2).
2017-03-17 17:52:37 -04:00
Paul Licameli
aee45d9cce Fix bogus error dialog when append-recording with no waves...
But with at least one track of other type, such as Time
2017-03-17 17:52:37 -04:00
Paul Licameli
0be66296cd Sort labels after warping time, just in case...
... Time warping functions should be nondecreasing, but let's not assume so.
If not, the insertion sort just takes linear time to check that there are no
disorders.
2017-03-17 17:52:36 -04:00
Paul Licameli
37e7b5704a a null check 2017-03-17 17:52:36 -04:00