[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src core/Peak.cpp core/Peak.h traverso...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src core/Peak.cpp core/Peak.h traverso... |
Date: |
Thu, 20 Sep 2007 18:24:10 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/09/20 18:24:10
Modified files:
src/core : Peak.cpp Peak.h
src/traverso/songcanvas: AudioClipView.cpp
Log message:
* slightly cleaner way to supply the position for
Peak::calculate_peaks()
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Peak.cpp?cvsroot=traverso&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Peak.h?cvsroot=traverso&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/AudioClipView.cpp?cvsroot=traverso&r1=1.89&r2=1.90
Patches:
Index: core/Peak.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Peak.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- core/Peak.cpp 18 Sep 2007 15:52:18 -0000 1.54
+++ core/Peak.cpp 20 Sep 2007 18:24:10 -0000 1.55
@@ -230,7 +230,7 @@
}
-int Peak::calculate_peaks(int chan, float** buffer, int zoomLevel, nframes_t
startPos, int pixelcount)
+int Peak::calculate_peaks(int chan, float** buffer, int zoomLevel, TimeRef
startlocation, int pixelcount)
{
PENTER3;
@@ -258,6 +258,7 @@
// Macro view mode
if ( zoomLevel > MAX_ZOOM_USING_SOURCEFILE) {
+ nframes_t startPos = startlocation.to_frame(44100);
int offset = (startPos / zoomStep[zoomLevel]) * 2;
@@ -293,7 +294,6 @@
// Calculate the amount of frames to be read
nframes_t toRead = pixelcount * zoomStep[zoomLevel];
- TimeRef startlocation(startPos, 44100);
nframes_t readFrames =
m_source->file_read(data->peakdataDecodeBuffer, startlocation, toRead);
if (readFrames == 0) {
Index: core/Peak.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/Peak.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- core/Peak.h 18 Sep 2007 15:52:18 -0000 1.19
+++ core/Peak.h 20 Sep 2007 18:24:10 -0000 1.20
@@ -109,7 +109,7 @@
void process(uint channel, audio_sample_t* buffer, nframes_t frames);
int prepare_processing();
int finish_processing();
- int calculate_peaks(int chan, float** buffer, int zoomLevel, nframes_t
startPos, int count);
+ int calculate_peaks(int chan, float** buffer, int zoomLevel, TimeRef
startlocation, int count);
void close();
Index: traverso/songcanvas/AudioClipView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/AudioClipView.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- traverso/songcanvas/AudioClipView.cpp 20 Sep 2007 17:08:49 -0000
1.89
+++ traverso/songcanvas/AudioClipView.cpp 20 Sep 2007 18:24:10 -0000
1.90
@@ -274,7 +274,7 @@
int availpeaks = peak->calculate_peaks( chan,
&buffers[chan],
microView ?
m_song->get_hzoom() : m_song->get_hzoom() + 1,
- (xstart *
m_sv->scalefactor) + clipstartoffset.to_frame(44100),
+ (xstart *
m_sv->timeref_scalefactor) + clipstartoffset,
microView ?
peakdatacount : peakdatacount / 2);
if (peakdatacount != availpeaks) {