1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-07 07:12:34 +02:00

58 Commits

Author SHA1 Message Date
Paul Licameli
71250b1dc3 WaveTrack.cpp does not depend on ODDecodeBlockFile.cpp...
... cutting off ODDecodeBlockFile and ODDecodeTask into a small cycle of 2
2019-06-22 21:46:34 -04:00
Paul Licameli
7b51653b36 Sequence.cpp does not depend on ODDecodeBlockFile.cpp...
... This frees Sequence.cpp from dependency cycles
2019-05-18 20:32:19 -04:00
Paul Licameli
0832bccc7b DirManager.cpp has fewer dependencies...
... To append files during recording or import, it doesn't depend on the
subclasses of BlockFile, instead taking a factory function to which it gives
the filename; and the choice of factory function is also lifted up through the
level of class Sequence which is just above DirManager.

This frees four files from dependency cycles, including DirManager.cpp but not
yet Sequence.cpp
2019-05-18 20:32:19 -04:00
Paul Licameli
548192fcf3 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:58:34 -04:00
Paul Licameli
56f51d8176 Revert "Remove redundant #include-s from .h files..."
This reverts commit b7fe62d17067b4441530dd36b25052cea3ad44b5.
2019-05-16 14:33:55 -04:00
Paul Licameli
b7fe62d170 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:15:05 -04:00
Paul Licameli
1d0247607a Remove wx/string.h from headers 2019-03-26 11:33:55 -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
080dd34e61 Get rid of wx object arrays, use std::vector 2018-02-21 19:33:27 -05:00
Paul Licameli
b521fb8422 Earlier detection and abort editing in case of overlong block file...
... Bill has reported that the truncation in WriteXML happened, but a
reproducible case is not known yet.
2017-07-23 12:41:46 -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
fc0f093db7 Sequence::Append* give strong guarantee 2017-04-02 21:33:23 -04:00
Paul Licameli
63cf80d244 Sequence::Delete gives strong guarantee 2017-04-02 21:33:23 -04:00
Paul Licameli
06f6953c91 Sequence::SetSamples, ::SetSilence give strong guarantee 2017-04-02 21:33:23 -04:00
Paul Licameli
73e61592aa Sequence::ConvertToSampleFormat gives strong guarantee 2017-04-02 21:33:23 -04:00
Paul Licameli
3c65731f38 Sequence::InsertSilence gives strong guarantee 2017-04-02 21:33:22 -04:00
Paul Licameli
160d846643 Sequence::Paste gives strong guarantee 2017-04-02 21:33:22 -04:00
Paul Licameli
2ba6065961 Sequence consistency check throws; new unused commit functions use it 2017-04-02 21:33:22 -04:00
Paul Licameli
d1cbac4181 more finally, more const, remove unused, fix warnings 2017-03-31 17:47:18 -04:00
Paul Licameli
39b8d99a56 WaveTrack::Get, WaveClip::GetSamples take a mayThrow=true argument...
... and pass non-default in all needed places.

Don't throw, don't put up error dialogs, in drawing or hit-test code.
2017-03-21 17:23:34 -04:00
Paul Licameli
70d9e4bdc7 GetMinMax, GetRMS functions take a mayThrow argument, return numbers 2017-03-21 14:19:02 -04:00
Paul Licameli
52fd607b42 Sequence::AppendBlock and Sequence::Blockify are static 2017-03-20 17:49:03 -04:00
Paul Licameli
7b7ad75a49 Remove Sequence::CopyWrite and needless file reads in Sequence::Set 2017-03-20 17:49:03 -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
d174099c3d Disallow copy of Sequence 2017-03-17 17:52:23 -04:00
Paul Licameli
81285ee0c1 More const and override 2017-03-17 17:52:20 -04: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
26b5e77050 Define sampleCount as a class, not a type alias...
... Define lots of operators for disambiguation, but they will go away after
all conversions from sampleCount to built-in numerical types are forced
to be explicit.
2016-09-15 21:02:31 -04:00
Paul Licameli
ed21545c80 pixel column counts and sample window sizes use unsigned types 2016-09-11 20:28:13 -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
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
f7780adbf5 Comments about CloseLock() functions 2016-04-12 00:54:55 -04:00
Paul Licameli
daf92c43f8 Sequence::Copy is a factory returning smart pointer. WaveClip stores it. 2016-04-10 20:47:45 -04:00
Paul Licameli
5477781ea8 Remove unused Sequence::Duplicate 2016-04-06 16:06:35 -04:00
Paul Licameli
dfc84d030c Fix warnings for out-of-order initializers, with in-class member initializers 2016-02-26 14:56:30 -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
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
55d85f1b25 Remove more uses of at(); use a std::vector of bare pointers, not wx array 2016-02-16 09:35:03 -05:00
Paul Licameli
dd3df60a83 Avoid repeated FindBlock call in Sequence::Get when we can 2016-02-04 09:31:39 -05:00
Paul Licameli
dc599116f7 Use SampleBuffer in Sequence, reuse so there are fewer allocations of buffers 2016-02-04 09:31:38 -05:00
Paul Licameli
ca56876aaf Various minor fixes in Sequence 2016-02-04 01:06:51 -05:00
Paul Licameli
e6987284e3 Rewrote Sequence::FindBlock, without recursion, and with dictionary search 2016-02-04 00:53:55 -05:00
Paul Licameli
6c28276daf Use RAII idiom for lock and locking mutex in Sequence 2016-02-04 00:53:54 -05:00
Paul Licameli
7be911b7fb Simplify the use of Sequence::Blockify() 2016-02-03 22:17:10 -05:00
Paul Licameli
51fbc697cf One less indirection accessing Sequence::mBlock 2016-02-03 22:17:08 -05:00
Paul Licameli
38ba19183d One less indirection accessing SeqBlock 2016-02-03 22:17:07 -05:00
Paul-Licameli
bdc2839112 Preliminaries for bug 900
Create WaveTrackCache as a utility class but don't use it anywhere yet.

The possible minor performance problem with effects is fixed by changes
in WaveTrack::GetBestBlockSize().
2015-05-26 20:02:37 -04:00