Commit Graph

81 Commits

Author SHA1 Message Date
Paul Licameli 7e697d1d8f Replace many inclusions of Types.h with Identifier.h 2021-05-27 09:51:32 -04:00
Paul Licameli 406b23cae7 More uses of AUDACITY_DLL_API...
... in many places where the function call will later need to be between
modules (or libraries, or the executable) and the annotation will be a necessity
to keep the linkage working on Windows.

That's all that this sweeping commit does.
2021-05-10 10:46:55 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli b9ca0acb4a Move some macros out of Audacity.h into various header files 2021-05-10 00:05:23 -05:00
Leland Lucius ffebbe064e Bug 2714 - (Japanese & Korean) "Unable to parse project information" 2021-03-25 00:19:11 -05:00
Leland Lucius 7547de9f52 Bug 1398 - Metadata Editor tag fields emptied when field length stored in project exceeds a given length 2021-02-12 10:32:43 -06:00
freddii 534359de6c
Fix minor typos (#720)
Co-authored-by: freddii <https://freddii@github.com>
2021-01-12 11:56:09 +00:00
Paul Licameli 558d4bbc3d Fix an error message 2020-07-07 01:28:05 -04:00
Leland Lucius d39590cf41 AUP3: First round of updates
!!! THERE WILL NO DOUBT BE BUGS !!!

This is a big one and there's still several things to
complete. Just want to get this in the wild to start
receiving feedback.

One big thing right now is that it will NOT load pre-aup3
files.  An importer is on the way for that.
2020-07-01 02:30:18 -05:00
Paul Licameli 6f402b3071 Remove expat.h from XMLFileReader.h 2020-06-12 14:02:37 -04:00
Leland Lucius 866edf8801 Provide useful path to FileException 2020-04-01 15:53:47 -05:00
Paul Licameli e3ea93a624 Define and use function Verbatim...
... in cases of "TranslatableString" that are not really translated.

This makes it easier to scan the code for such unusual constructions of
TranslatableString, distinct from mere mentions of the TranslatableString type.
2019-12-19 22:49:23 -05:00
Paul Licameli 3a633e4fd8 XMLFileWriter takes TranslatableString caption 2019-12-19 16:41:48 -05:00
Paul Licameli 89df7a3ffc Use TranslatableString in XMLFileReader & move the help URL logic 2019-12-16 10:58:05 -05:00
Paul Licameli 503ccabdd8 TranslatableString caption & message in MessageBoxException 2019-12-16 10:58:05 -05:00
Paul Licameli 191cd23b54 XMLTagHandler.cpp has fewer dependencies...
... freeing three files from dependency cycles
2019-05-18 20:29:25 -04:00
Paul Licameli 6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli 3eeb91f23a Define class Identifier and template TaggedIdentifier...
... Identifier holds strings used for internal purposes and not shown to users;
TaggedIdentifier generates subclasses of Identifier for different purposes,
which won't implicitly (that is, inadvertently) interconvert as function
arguments.
2019-05-16 12:30:28 -04:00
Paul Licameli 70e88782fe Remove wx/{grid,font,ffile,colour,button,bmpbuttn}.h from headers 2019-03-28 12:27:10 -04:00
Paul Licameli 40b4361732 Remove wx/arrstr.h from headers 2019-03-26 12:41:44 -04:00
Paul Licameli 1d0247607a Remove wx/string.h from headers 2019-03-26 11:33:55 -04:00
Paul Licameli f45300f032 This is only comments, in files where USE_ macros are tested...
... following the comment convention used in the preceding commit.
2019-03-22 12:38:30 -04:00
Paul Licameli 5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... except Audacity.h

This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
2019-03-17 22:54:52 -04:00
Paul Licameli 173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli a30000cf74 Use type aliases FilePath, FilePaths...
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
2019-03-15 15:18:11 -04:00
Paul Licameli 06b3b42794 Remove unnecessary initializers for empty wxString 2019-03-15 15:18:11 -04:00
Paul Licameli 135c2a71ce Replace "" and wxEmptyString with {} in default argument values 2019-03-15 15:18:11 -04:00
Paul Licameli 795b6a2e42 More std:: style for wxString and wxArrayString...
... Replacing:

Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
   (but only when second argument was true or default)
2019-03-10 14:45:12 -04:00
Paul Licameli c68e336247 More use of std:: style members of wxString...
... replacing:

Length => length
Len => length
2019-03-10 14:44:54 -04:00
Paul Licameli 2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
James Crook 9eab948fb1 Bug 1905 - Labels with more than 260 characters fail to load (with no warning) 2018-08-07 11:46:21 +01:00
Paul Licameli 8be1e8fdad Remove wxArray(Int|Long|Double) except where wxWidgets fns need it 2018-02-21 19:33:31 -05:00
Paul Licameli 080dd34e61 Get rid of wx object arrays, use std::vector 2018-02-21 19:33:27 -05:00
Paul Licameli 8e0cffb7f2 Simplify GuardedCall and default its return type to void 2018-01-13 01:32:41 -05:00
Paul Licameli c6696f1b49 Move definition of _ and related into Internat.h 2018-01-06 21:03:32 -05:00
James Crook d2fe7b1757 Clean up most remaining MSVC warnings. 2018-01-06 13:03:48 +00: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
James Crook 52e9763337 Fix multiple bugs in IsGoodInt and IsGoodInt64
Alerted to this buggy code by Darrell Walisser's comment:
"Whoops, the range on the 64-bit signed integer check is incorrect."

After these fixes,  I saw that IsGoodInt was being used to test a dotted
version number, so I commented out that (bogus) test which was previously
always succeeding.

The IsGood{num} functions did no range checking if the numbers were shorter
than the max value.  Then, if the number was similar in length, the first digit could
be an invalid character and the code also previously accepted all 9's followed by 1.

My new code would benefit from code review and unit tests.
2017-12-29 20:15:29 +00:00
Yarn366 26a6815db8 Fixed the value of MAX_HIGH_SURROGATE 2017-11-06 21:15:56 +00:00
Yarn366 f667b9f269 When escaping characters for XML, don't escape valid surrogate pairs on platforms where wchar_t (and, by extension, wxUChar) is 2 bytes. Also, ignore invalid surrogates and the noncharacters U+FFFE and U+FFFF. 2017-11-06 21:15:56 +00:00
Paul Licameli 58f07d2021 Flush .aup before writing .au; no redundant out-of-space messages 2017-10-25 15:06:35 -04:00
Paul Licameli fd2a242012 XMLFileWriter cleans up correctly in case of failure 2017-10-25 15:06:23 -04:00
Paul Licameli c613a0bd40 revert last three 2017-10-24 04:32:46 -04:00
Paul Licameli a6c69dec74 XMLFileWriter cleans up correctly in case of failure 2017-10-24 04:24:41 -04:00
Paul Licameli e9a4fc8354 fix the XML writer -- don't throw if target path did not previously exist. 2017-03-21 14:11:17 -04:00
James Crook 5b9ae95930 Bug 1610 - Unable to save projects
We were throwing an exception for attempting to delete a file that was not there.
2017-03-20 11:53:39 +00: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 0c9deb398c Fix mac build. No standard headers in Audacity.h. 2016-03-01 12:22:37 -05:00
Paul Licameli 990080ae7d Replace virtual with override wherever possible; eliminate needless virtual...
... for functions in final classes.

override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.

There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
2016-02-26 12:35:38 -05:00