Commit Graph

216 Commits

Author SHA1 Message Date
Steve Daulton 04ba10a1c3 Add help button support for other Nyquist effects 2017-05-21 23:11:21 +01:00
Steve Daulton d6a9011960 "Error opening sound device" as Error dialog
ShowErrorDialog could do with some polish, but it supports linking
a help button to the manual.
2017-05-20 17:11:02 +01:00
Steve Daulton fd3d41e82f Add help pages for shipped Nyquist effects 2017-05-20 14:49:07 +01:00
Steve Daulton 1dd6b848c2 Enable Help button for Nyquist effects 2017-05-20 14:49:07 +01:00
Steve Daulton 469120cebd Enable help button for effects 2017-05-20 14:49:07 +01:00
Steve Daulton e16f6f9221 Add small help button to Prefs pages 2017-05-14 19:02:36 +01:00
Paul Licameli e1473dfe76 void return, not boolean success, from some Track virtual functions...
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.

It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change.  No matter now.
2017-03-31 18:26:52 -04:00
Paul Licameli d1cbac4181 more finally, more const, remove unused, fix warnings 2017-03-31 17:47:18 -04:00
Paul Licameli 1fad6292a2 Exception safety in: overrides of ShowInterface 2017-03-21 14:11:24 -04:00
Paul Licameli 79c3bef2ce Exception safety in: general effect performing functions 2017-03-21 14:11:24 -04:00
Paul Licameli 3bb04245c5 Strong exception safety in all uses of XMLFileWriter...
... Strong, meaning that the file at the specified path is created or modified
only if all write operations complete without exceptions, barring one very
unlikely possibility that a final file rename fails, but even in that case the
output is successfully written to some path.

This commit does not add throws, but changes the type thrown to a subclass of
AudacityException, so that GuardedCall will cause the user to see an error
dialog in all cases.

Duplicated logic for making temporary files and backups is now all in one
place, the class XMLWriter.

There may be more new GuardedCalls than necessary -- the catch-all for the
event loop, AudacityApp::OnExceptionInMainLoop, might be trusted instead in
some cases --  but they are sufficient.
2017-03-18 11:45:33 -04:00
Paul Licameli b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli 576d3e3013 Don't let the catch-all block in Effect intercept the new exception 2017-03-17 17:53:01 -04:00
Paul Licameli a4c7d37d3e Remove naked new[] in: effects framework 2017-03-17 17:52:48 -04:00
Paul Licameli aebaaf46a0 require unsigned arguments for Array(s)Of::reinit 2017-03-17 17:52:43 -04:00
Paul Licameli 37e7b5704a a null check 2017-03-17 17:52:36 -04:00
Paul Licameli 08b99c533b Remove Effect::mWarper, and stack-allocate warpers instead 2017-03-17 17:52:32 -04:00
Paul Licameli 004df48438 Make Effect::mTracks private 2017-03-17 17:52:25 -04:00
Paul Licameli aa0d55ac83 Use enum class ProgressResult, don't interconvert with int or bool 2017-03-17 17:52:24 -04:00
Paul Licameli 81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
Steve Daulton a80556df2f Bug 1574 - Built-in generators may generate wrong length 2017-02-24 18:52:03 +00:00
Steve Daulton 81dd23bd16 Bug 1566 - Incorrect error message if Nyquist returns mono sound as an array
and quieten a load of compiler warnings.
2017-02-24 18:50:30 +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 078ff056e2 Make many conversions sampleCount->size_t are explicit and checked...
... with run-time assertions.

I examined each place and reasoned that the narrowing was safe, and commented
why so.

Again, there are places where the sampleCount variable will later be changed
to have a different type, and they are not changed here.
2016-09-15 21:02:32 -04:00
Paul Licameli 78be459fa1 Convert sampleCount <-> floating or -> long long explicitly ...
... A non-narrowing conversion out to long long is a necessity, but the
conversions to float and double are simply conveniences.

Conversion from floating is explicit, to avoid unintended consequences with
arithmetic operators, when later sampleCount ceases to be an alias for an
integral type.

Some conversions are not made explicit, where I expect to change the type of
the variable later to have mere size_t width.
2016-09-15 21:02:31 -04:00
Paul Licameli 88611a4530 Fewer C-style pointer casts of tracks; comments justify static_cast 2016-09-15 12:12:43 -04:00
Paul Licameli 39d514b183 Some more const, some stl idioms, remove unused declaration 2016-09-13 22:03:58 -04:00
Paul Licameli 2263a0f477 Don't use wxArrayPtrVoid with casts, use std::vector 2016-09-08 11:08:49 -04:00
Paul Licameli 67cec5ad83 Make many counts of tracks and channels unsigned...
... And in some places where a library uses signed types, assert that
the reported number is not negative.

What led me to this, is that there are many places where a size_t value for
an allocation is the product of a number of channels and some other number.
2016-09-07 10:11:41 -04:00
Paul Licameli 6043638e31 Another std::min, more auto & decltype, remove more casts 2016-08-29 20:07:43 -04:00
Paul Licameli 3b04bb1726 More uses of limitSampleBufferSize 2016-08-27 07:54:22 -04:00
Paul Licameli 52417c444d Remove unnecessary casts to sampleCount 2016-08-24 14:50:46 -04:00
Paul Licameli fd2b050d6f Type agnosticism for some other variables that were not sampleCount...
... in some cases, this fixes narrowings.
2016-08-24 14:50:45 -04:00
Paul Licameli 79c79f9cd3 Remove many mentions of sampleCount with auto and decltype...
... This makes much code agnostic about how other things (functions and
arguments) are typed.

Many of these neeed to become size_t instead of sampleCount.
2016-08-24 14:50:45 -04:00
Paul Licameli 1281f1b14b Common function limits buffer size to sampleCount known to be small 2016-08-23 12:46:10 -04:00
Paul Licameli 39df8d0b51 Don't use conversion of sampleCount to bool 2016-08-22 21:45:54 -04:00
Paul Licameli 56586770e0 EffectClientInterface::SetSampleRate takes double...
... All the overrides (except Ladspa) were casting it to floating poing anyway
2016-08-21 09:51:32 -04:00
Paul Licameli 49e699b1df Remove overloads for sampleCount from ConfigInterface...
... The value was always cast to int anyway when writing, and it was used
only for one value in VST effect, which did not need 64 bits
2016-08-21 09:11:44 -04:00
Paul Licameli 2a7d8dca77 time warper bug 2016-08-21 08:59:48 -04:00
Paul Licameli a0a76e86d1 Remove naked new and delete in effect preview 2016-08-16 13:30:26 -04:00
Paul Licameli 32f24eabb2 Review uses of safenew...
... add comments and assertions, and use make_unique instead where possible
2016-08-13 23:16:05 -04:00
Paul Licameli e599cfa6fa Effect::mOutputTracks is managed by smart pointer 2016-08-13 10:37:51 -04:00
Paul Licameli 11305b956f Use make_unique for wxMenu objects 2016-08-10 11:05:52 -04:00
Paul Licameli fec4069d9d Some uses of Destroy_ptr let us remove some naked news 2016-08-10 11:05:51 -04:00
Paul Licameli 384fc4a4ae Prefer Destroy() to deleting a window 2016-08-10 11:05:50 -04:00
Paul Licameli 6fec00149b Remove some naked new amd delete in: Built-in Effects 2016-08-08 07:51:25 -04:00
windinthew e24d6d825f Bug 858: Update recording error message too
Also remove redundant 'while' in the messages
2016-07-27 16:48:30 +01:00
Steve Daulton 6629733d35 Bug 858 - Update error message
Trying Gale's suggestion from
http://bugzilla.audacityteam.org/show_bug.cgi?id=858#c2
2016-07-24 16:35:17 +01:00
Steve Daulton ab135ff478 Disallow enabling RT preview when setting invalid 2016-07-24 15:41:15 +01:00
Paul Licameli 84c0337aba Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00