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

154 Commits

Author SHA1 Message Date
Paul Licameli
786c1da645 Move class SpectrogramSettings to its own file 2015-07-26 21:10:13 -04:00
Paul Licameli
8664c877ba WaveDisplay may or may not manage its own memory. 2015-07-19 11:44:16 -04:00
Paul Licameli
c14b326913 Publicize class SpecCache. TrackArtist will re-use it. 2015-07-19 11:44:15 -04:00
Paul Licameli
35e0897bf7 Avoid needless mix/max/rms calculation when showing individual samples. 2015-07-19 11:43:55 -04:00
Paul Licameli
b25994a82d Throw away EXPERIMENTAL_FFT_SKIP_POINTS...
... with James' consent.
2015-07-18 23:21:27 -04:00
Paul Licameli
97f06ec09c Less shimmer and maybe less CPU in display updates for scroll-scrub, because...
... tolerant comparison of pps values allows more cache reuse and avoids the
changing alignment of pixels to samples that causes the "shimmery" update.
2015-06-11 10:26:38 -04:00
Paul Licameli
e8d676c961 fix compilation warning 2015-06-09 14:22:13 -04:00
Paul Licameli
bb42f6e7c0 More minor spectrogram drawing changes...
... Removed an unnecessary zero-filling, added comments, removed a duplication
with a loop.
2015-06-07 17:37:52 -04:00
Paul Licameli
976eb6164f More reorganization of wave and spectrum caches, and performance...
Simplify the partial copying of wave and spectrum caches.  Use memcpy for speed.

Don't memcpy out of the caches into temporary buffers for TrackArtist,
just pass
pointers.

More vectors in the cache classes, fewer deletes.

Pulled big loop, and its body, out of the spectrogram routine into functions.
2015-06-06 11:43:10 -04:00
Paul Licameli
1916bc3142 Fix compilation of some disabled experimental branches for spectrograms ...
... Not promising that they work, just compilation.
2015-06-04 11:30:08 -04:00
Paul Licameli
afa2fe9fb4 Keep FFT windows for Spectrograms in one place in SpectrogramSettings...
... not redundantly in each WaveClip.
2015-06-04 11:29:18 -04:00
Paul Licameli
952a22c8b1 Created a global structure to hold spectrogram preferences...
Don't read "/Spectrum/" preferences anywhere but in SpectrumPrefs.cpp.
Don't store global values in TrackArtist.

Possibly some day, there will be other instances of SpectrogramSettings so we
can have independent per-track settings.
2015-06-04 11:29:17 -04:00
Paul Licameli
38f24a42ef Don't invalidate SpecCache for changes of min, max, gain or range...
... because those do not affect it.  They only affect the SpecPxCache.

Did other things to that class:  renamed fields, new constructors.
2015-06-04 11:29:16 -04:00
Paul Licameli
ba5738446c Bug1009: Correct interaction of Zero Padding and Frequency Gain...
... also an excuse to pull out a function I will want to reuse in a later
project.  The real fix was simply to use fftLen not windowSize.
2015-06-03 15:01:54 -04:00
Paul Licameli
8d5052bf4e Avoid assertion violation while scrolling 2015-06-02 22:38:08 -04:00
unknown
29fb5a2ffe Simplified passing of min/min/rmx/bl/where values for drawing waveforms 2015-06-01 22:58:18 -04:00
unknown
34b09053b4 Simplified some management of WaveClip caches 2015-06-01 22:58:17 -04:00
unknown
ee600ce30b Functions for common parts of waveform and spectrogram display update 2015-06-01 22:58:11 -04:00
Paul Licameli
6a1227f039 zero-padding factor for spectrograms, internals 2015-05-31 16:43:09 -04:00
Paul Licameli
e6ccd51326 Use WaveTrackCache for spectrograms
Zooming-in of spectrograms (or other view changes that invalidate the
whole pixel cache of the WaveClip) used to do at least one opening and
closing of a block file for each column of pixels.  With this change,
open each block file not more than once for each repopulation of the
cache.

Improved speed may be more noticeable on less powerful computers, or when
the audio file is in a slower storage device.
2015-05-26 20:02:38 -04:00
Paul-Licameli
da2b9e3233 Fix other assertion violations in wave clip cache code, and add comments.
Duplicate the assertion for the case of spectrograms.
2015-04-21 17:52:29 -04:00
Paul-Licameli
8bcec00e65 Rewrite Sequence::GetWaveDisplay
That is the function that computes the heights of dark and pale blue lines in
the waveform display.

It's not simple but now the flow of control is less strange and it is better
commented.

This doesn't fix or enhance anything, but it might find use later, such as in
a project to adapt the resolution of the display in reponse to slow scrolling
updates.
2015-04-21 11:11:20 -04:00
Paul-Licameli
46e937e3ea Fix assertion violations from the previous change. 2015-04-17 18:21:43 -04:00
Paul-Licameli
cc2a26956a Fix display caching for waveforms and spectrograms so smooth scrolling works
This will matter if the smooth-scrolling version of scrubbing is enabled

The problem was accumulation of roundoff errors when deciding which pixel
column data to copy from old caches to new caches, when the number of samples
scrolled was not an integer multiple of samples per pixel (itself, not always
an integer)

Thus repeated scrolling by small amounts caused the wave display or spectrogram
to creep relative to the time ruler!
2015-04-17 11:12:47 -04:00
Paul-Licameli
fe8d3535d8 Bug819 - Paste should not change clipboard contents when sample formats differ 2015-04-08 19:11:50 -04:00
james.k.crook@gmail.com
8305bfdb05 From: martin@steghoefer.eu [PATCH 01/15] Fix runtime problem with wxWidgets 3.0: Correct string formatting: wxLongLong -> %lld + long long
The functions wxString::Format, wxString::Printf (and others indirectly) have become stricter about parameter types that don't match (format specifier vs. function parameters). So the bugs (that were already present in audacity before) become visible in wx3.0 as error message dialogs. I've checked all occurrences of Printf, wxPrintf, PrintfV, Format, FormatV, wxLogDebug and wxLogError systematically and made the type match.

Note: In Shuttle.cpp this patch supersedes one related change done in r13466 because a wxLongLong_t can be bigger than an int and in a generic function like "TransferLongLong" this should be taken into account.
2014-11-08 16:06:28 +00:00
benjamin.drung@gmail.com
277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
RichardAsh1981@gmail.com
28e9f0ca73 make many functions which do not require access to class member variables static so they can be called without an object to do so with. Based on part of a patch by Campbell Barton 2013-09-21 19:15:42 +00:00
v.audacity
030d2450a8 Go back to simpler architecture for Resample class, now that libsoxr is proven for variable rate resampling. 2013-08-04 01:58:54 +00:00
v.audacity
9d0daf8662 Campbell Barton's patch to turn many, many tabs to our 3-space convenbtion 2013-02-20 23:42:58 +00:00
v.audacity
ce9bd9fa90 I think this completes the refactoring for const-rate vs var-rate resampling. 2012-11-04 04:44:10 +00:00
v.audacity
5460b5c668 This commit is partial effort toward more libsoxr integration, that implements Rob Sykes's latest patch. I have no idea whether the Linux-specific stuff from the patch (e.g., M4 file) is still correct in this.
For Resample.* and QualityPrefs.cpp, this commit has my restructuring for distinguishing constant-rate vs variable-rate resamplers more generally. I think it's complete and ready for const-rate, but I have more review and testing to do for the var-rate cases. 

Variable-rate resampling is not implemented here, so Time Tracks are still broken, but this is a milestone in getting to a more general and correct structure. 

Also I think this fixes AboutDialog issues Steve noticed.
2012-11-03 02:06:07 +00:00
martynshaw99
ffea5a2273 Addressing one of the problems reported with 'Normalise' if the offset is greater than the signal. Comments on other possible problems. 2012-04-23 23:39:36 +00:00
v.audacity
111278c61b In WaveTrack.*:
* Fix P2 bug described by Bill Wharrie in "Problem dragging clips between tracks with different sample rates" thread on audacity-quality. Made sure the clips get resampled to the destination WaveTrack rate, and marked changed.

* Comment out unused override of WaveTrack::MoveClipToTrack().

* Added an ANSWER-ME about what appears to be a useless declaration and assignment.


In WaveClip.cpp, remove wxASSERT that Michael was trying to convince me to do yesterday. In debugging this, found a case when it's not a bad call. Thanks, Michael! :-)

In TrackPanel.cpp, removed some cruft.
2012-03-03 01:34:14 +00:00
v.audacity
3b90ee098e Martyn's fix for http://bugzilla.audacityteam.org/show_bug.cgi?id=474 2012-02-27 01:43:33 +00:00
v.audacity
5f5b9778de Fixes per Vigilant Sentry (http://www.vigilantsw.com/)
* Fix memory leaks.

* Add comments about initializations and checking for successful results.

* Add checks for NULL deref.

* Consistency in "TODO" vs "TO-DO" comments!
2012-02-08 05:09:14 +00:00
v.audacity
2f043dfb0f (bug 451, p2)
Correct Sequence::ConvertToSampleFormat() errors resulting in wrong block file sizes, per offline discussions with Martyn and James.

In WaveClip::ConvertToSampleFormat(), distinguish between failure and no change.

Changed deprecated calls to wxArray::Count() to GetCount(),

In Sequence::Blockify(), no reason to call Alloc() if we know we have no samples, so rearranged that code.
2011-12-02 06:54:52 +00:00
v.audacity
e695f447b3 Start to handle results from subordinates. 2011-12-01 05:21:07 +00:00
v.audacity
3bcb940843 (bug 451) Remove uncertain comment. Call WaveClip::ConvertToSampleFormat() instead of Sequence::ConvertToSampleFormat(), so it does MarkChanged() and an assert on the result from Sequence::ConvertToSampleFormat(). 2011-11-22 05:10:54 +00:00
v.audacity
8cc8a275f8 (bug 451, P2)
Changes per Martyn's suggestion (http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c24), i.e., deal with sample format mismatch in WaveClip::Paste() and Sequence::Paste().

Also add error checking for bad s parameter values passed to Sequence::Paste().
2011-11-20 03:46:00 +00:00
v.audacity
3a1d4334f2 Make wxLog* calls consistently not have \n at the end. Turn some wxLogWarning calls to wxLogError. Put some periods at the ends of sentences. 2011-10-09 21:14:03 +00:00
clayton.otey
71dedc3d35 Revert r11214 (sbsms timescale effect update) & r11215 (mixed-radix-fft narrow/broaden spectrum menu items) to honor the feature freeze. 2011-07-06 09:49:59 +00:00
clayton.otey
df9865f26a Added an sse enabled mixed-radix-fft implementation and a menu/view/{narrow,broaden} spectrum item which adjusts the spectrogram window size 2011-07-02 18:42:38 +00:00
mchinen
fbe3a80ab1 Bug 373/378 (P2) - Fix a case where one track of an aligned stereo pair could be moved independently 2011-04-26 16:47:06 +00:00
mchinen
9321b1634e Bug 377 (P2) - fix case where the R channel of a stereo clip wouldn't be dragged if it was off-screen and sync-lock was off 2011-04-25 18:10:32 +00:00
mchinen
6b752e96dc Fix bug 263 Paste into a track at a different sample rate is not resampled 2010-12-24 13:43:57 +00:00
martynshaw99
0d84a2d934 Revert r10691 - re-allowing clips to be floating around, not on a sample. There has been much discussion on -devel about this and I think we can keep things in order without this restriction. 2010-10-05 21:46:51 +00:00
martynshaw99
48e04173b1 Make sure that whenever a clip is offset, it is by a whole number of samples at it's sample rate. 2010-09-23 23:06:12 +00:00
v.audacity
ec047e7c71 (bugs 20 and 137, P2) Working on these bugs, tightened up some code and corrected some comments. 2010-09-23 00:30:05 +00:00
BusinessmanProgrammerSteve
c0b5fb01da Performance improvements for track spectrum display and PCM
import submitted by Sami Liedes.
2010-09-13 01:31:54 +00:00