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

212 Commits

Author SHA1 Message Date
Paul Licameli
f4e2fb5eac AudioIO::StopStream stops exceptions in many non-editing actions 2017-03-17 17:53:00 -04:00
Paul Licameli
2b23667211 Remove naked new[] in: AudioIO 2017-03-17 17:52:46 -04:00
Paul Licameli
ed8c7fd60d Make EXPERIMENTAL_MIDI_OUT compile, but it fails to link 2017-03-17 17:52:18 -04:00
Paul Licameli
0eb2f85bfb Use DBL_MAX, not arbitrary 1000000000.0, as "infinite" time interval 2016-09-19 10:38:42 -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
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
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
39d514b183 Some more const, some stl idioms, remove unused declaration 2016-09-13 22:03:58 -04:00
James Crook
4eeef25191 More unused parameters and local variables. 2016-09-12 12:33:44 +01: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
5bf8291c97 ClearSamples takes size_t arguments 2016-09-06 20:46:26 -04:00
Paul Licameli
2a2013cb4b More decltype and auto, mostly for loop index variables 2016-09-06 20:46:25 -04:00
Paul Licameli
2910005780 Rewrite RingBuffer methods with size_t arguments and returns 2016-09-06 12:39:58 -04:00
Paul Licameli
c8e7372886 Rewrite Resample::Process to take and return size_t values 2016-09-06 12:39:58 -04:00
Paul Licameli
837a96d18a Scrub queue records positions as sampleCount not long 2016-09-04 16:28:40 -04:00
Paul Licameli
954a914ff7 A little more type agnosticism 2016-08-26 12:42:22 -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
15a60bde4b Fix linux debug complaints of missing thread shut-down...
... caused by commit b47bcb548e7866c1a44a4600ffbeff0ae0445516
2016-08-15 21:21:09 -04:00
Paul Licameli
a52f7f8410 new -> NEW in comments, so text search for naked new excludes them 2016-08-08 10:07:37 -04:00
Paul Licameli
b47bcb548e Remove some naked new amd delete in: AudioIO 2016-08-08 07:51:27 -04:00
Paul Licameli
27527ebf5c One less indirection for arrays of capture and playback tracks 2016-08-08 07:51:26 -04:00
James Crook
0a16141ee5 Flag PortAudio and PortMixer unhandled error returns. 2016-07-10 21:40:49 +01:00
James Crook
18eb2bbc7a Bug 193 - Audacity can't record at > 16-bit under MME or Windows DirectSound
Fix by Uwe and Carsten of DirectSound issue (only).  We can't interrogate for formats, so we use userData to tell PortAudio what the format should be.  I have a 16 bit built in sound device and that continues to function correctly at 16 bit with 24 bit requested.  Unable to test on a 24 bit device.
2016-07-05 11:56:04 +01:00
Paul Licameli
2361121b80 Bug860, edge case: when loop-playing < 1 sample interval, don't hang 2016-06-29 13:06:01 -04:00
Paul Licameli
7d0517a9c9 Don't busy-wait (excess CPU usage) after stopping scrub 2016-06-03 08:34:39 -04:00
Paul Licameli
35b0502ce1 Don't let seek make a stutter at less than unit speed 2016-05-28 12:11:26 -04:00
Paul Licameli
a9a404c7cf Further simplified argument passing 2016-05-28 12:02:16 -04:00
Paul Licameli
9a256d3790 Don't let the consumers discard too much from the scrub queue...
Producer adds silences when needed, so that the accounting in Transformer()
is correct
2016-05-28 11:59:22 -04:00
Paul Licameli
b6764d1bf7 Reduce scrub lag yet more, at expense of possible skips in play...
by discarding work from the queue sometimes on the consumer side.

Also more careful mixed long - double arithmetic.
2016-05-28 11:59:14 -04:00
Paul Licameli
57fb3cd12c Scrub lag: lock mutex not more than once per call to FillBuffers 2016-05-28 08:44:25 -04:00
Paul Licameli
b14fa507c9 Reorganize logic of initializing queue entries 2016-05-28 08:44:25 -04:00
Paul Licameli
c585bb16fb Move bounding times and minimum stutter length into ScrubOptions 2016-05-22 15:27:35 -04:00
Paul Licameli
ffe596c760 Move some fields into ScrubbingOptions 2016-05-22 15:27:35 -04:00
Paul Licameli
671f60492d Move some static functions into ScrubbingOptions 2016-05-22 15:27:35 -04:00
Paul Licameli
3dcf802bdc Have just one scrub enqueueing function: use options for distinctions 2016-05-22 15:27:35 -04:00
Paul Licameli
cdbdd6480b Define and pass around struct ScrubbingOptions, but nothing in it yet 2016-05-22 15:27:35 -04:00
Paul Licameli
36e5b4fbbc AudioIOStartStreamOptions includes the sample rate 2016-05-22 15:27:35 -04:00
Paul Licameli
aa9afb073e Show Actual Rate in status only if playing, recording, or monitoring 2016-05-22 10:44:18 -04:00
Paul Licameli
465b743fd3 Bug1365: Do not confuse Linux key event handling...
... So click on QP during scrub had to be implemented without relying on
SafeYield() when stopping play.
2016-05-18 10:08:46 -04:00
Paul Licameli
9535dce82c Fix deadlocks in scrubbing, again, and better...
see eac6f98cbf97d9cdb240da978581ce21ec0d6f9c
2016-05-16 21:03:04 -04:00
Paul Licameli
eac6f98cbf Avoid deadlocks that sometimes happened when starting a scrub...
... as a consequence of commit 52910f4f07d41904e5f8cc5fdc5e7f8484468a00
2016-05-16 18:20:43 -04:00
Paul Licameli
8247e87dbf Allow scrub timer interval to be 1 ms, without bogus out-of-memory warnings. 2016-05-15 16:18:00 -04:00
Paul Licameli
52910f4f07 Less scrub lag: don't poll for available data, get woken up directly 2016-05-15 16:18:00 -04:00
Paul Licameli
19ef2f6681 Implement drag-scrub, compatibly with the existing move-scrub...
... Start scrub by click or double click on the scrub head; release button or
not; then move.

If you release before moving, you get scrubbing as before, controlled by
motion.  Click or drag to switch in and out of seeking.  Stop with ESC,
spacebar, etc.  No change of selection.

But now if you drag, then scrubbing contines until you release the mouse or
otherwise stop with a key.

If by release of the mouse, then the selection changes as if by a click at
the last play position.  If you hold shift, then, as if by shift-click.

If drag begins with a double-click, then the play head remains centered and
the track moves.
2016-05-10 09:37:10 -04:00
Paul Licameli
a332d3cba0 Left click in quick play area during scrubbing stops scrub, starts quick play. 2016-05-02 21:33:41 -04:00
Paul Licameli
eb6e093912 Pass arrays by reference into AudioIO::StartStream 2016-04-09 15:14:07 -04:00
Paul Licameli
b28ec2957a Make EXPERIMENTAL_MIDI_OUT compilable, but it doesn't link 2016-04-09 15:10:05 -04:00
Paul Licameli
43790cfa56 std::vector for wave track pointers; remove deprecated TrackList function; ...
... and some more uses of const
2016-03-01 20:54:48 -05:00
Paul Licameli
60bcd7aea2 Fix warnings for unused variables and functions 2016-02-26 14:56:26 -05:00