From b846d29c4b5eb997155b615b92a426a9a2e6c6bc Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 20 Mar 2008 03:43:45 -0500 Subject: [PATCH] Try to get timeline working again. --- Engine/Audio_File_SF.C | 12 ++++++------ Engine/Peaks.C | 11 +++++++++-- Engine/Peaks.H | 3 ++- Makefile | 1 + Timeline/Waveform.C | 10 +++++++--- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Engine/Audio_File_SF.C b/Engine/Audio_File_SF.C index 1c70d28..0de8878 100644 --- a/Engine/Audio_File_SF.C +++ b/Engine/Audio_File_SF.C @@ -18,7 +18,7 @@ /*******************************************************************************/ #include "Audio_File_SF.H" -#include "Timeline.H" +// #include "Timeline.H" #include @@ -41,11 +41,11 @@ Audio_File_SF::from_file ( const char *filename ) return NULL; } - if ( si.samplerate != timeline->sample_rate() ) - { - printf( "error: samplerate mismatch!\n" ); - goto invalid; - } +/* if ( si.samplerate != timeline->sample_rate() ) */ +/* { */ +/* printf( "error: samplerate mismatch!\n" ); */ +/* goto invalid; */ +/* } */ c = new Audio_File_SF; diff --git a/Engine/Peaks.C b/Engine/Peaks.C index f0303aa..c8b56b5 100644 --- a/Engine/Peaks.C +++ b/Engine/Peaks.C @@ -18,7 +18,8 @@ /*******************************************************************************/ #include "Peaks.H" -#include "Timeline.H" + +// #include "Timeline.H" #include #include @@ -177,7 +178,13 @@ Peaks::peak ( nframes_t start, nframes_t end ) const Peak & Peaks::operator[] ( int X ) const { - return peak( timeline->x_to_ts( X ), timeline->x_to_ts( X + 1 ) ); + + Peak p; + p.min = 0; + p.max = 0; + return p; +// return peak( timeline->x_to_ts( X ), timeline->x_to_ts( X + 1 ) ); + } diff --git a/Engine/Peaks.H b/Engine/Peaks.H index d9472ca..e5b1455 100644 --- a/Engine/Peaks.H +++ b/Engine/Peaks.H @@ -70,7 +70,6 @@ class Peaks const char *peakname ( const char *filename ) const; - Peak & peak ( nframes_t start, nframes_t end ) const; // Peaks ( ); @@ -110,6 +109,8 @@ public: bool current ( void ) const; bool make_peaks ( int chunksize ); + Peak & peak ( nframes_t start, nframes_t end ) const; + Peak & operator[] ( int X ) const; }; diff --git a/Makefile b/Makefile index 7d46950..c9c2461 100644 --- a/Makefile +++ b/Makefile @@ -6,4 +6,5 @@ all: all %: @ make -s -C FL CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ + @ make -s -C Timeline CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ @ make -s -C Mixer CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ diff --git a/Timeline/Waveform.C b/Timeline/Waveform.C index d1340fd..6177009 100644 --- a/Timeline/Waveform.C +++ b/Timeline/Waveform.C @@ -64,7 +64,9 @@ Waveform::draw ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int chan j = start; for ( int x = X; x <= X + W; ++x, ++j ) { - Peak p = (*pk)[ j ]; +// Peak p = (*pk)[ j ]; + + Peak p = pk->peak( timeline->x_to_ts( j ), timeline->x_to_ts( j + 1 ) ); p.max *= _scale; p.min *= _scale; @@ -112,7 +114,8 @@ Waveform::draw ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int chan j = start; for ( int x = X; x <= X + W; ++x, ++j ) { - Peak p = (*pk)[ j ]; +// Peak p = (*pk)[ j ]; + Peak p = pk->peak( timeline->x_to_ts( j ), timeline->x_to_ts( j + 1 ) ); p.min *= _scale; @@ -126,7 +129,8 @@ Waveform::draw ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int chan j = start; for ( int x = X; x <= X + W; ++x, ++j ) { - Peak p = (*pk)[ j ]; +// Peak p = (*pk)[ j ]; + Peak p = pk->peak( timeline->x_to_ts( j ), timeline->x_to_ts( j + 1 ) ); p.max *= _scale;