| @@ -18,7 +18,7 @@ | |||||
| /*******************************************************************************/ | /*******************************************************************************/ | ||||
| #include "Audio_File_SF.H" | #include "Audio_File_SF.H" | ||||
| #include "Timeline.H" | |||||
| // #include "Timeline.H" | |||||
| #include <sndfile.h> | #include <sndfile.h> | ||||
| @@ -41,11 +41,11 @@ Audio_File_SF::from_file ( const char *filename ) | |||||
| return NULL; | 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; | c = new Audio_File_SF; | ||||
| @@ -18,7 +18,8 @@ | |||||
| /*******************************************************************************/ | /*******************************************************************************/ | ||||
| #include "Peaks.H" | #include "Peaks.H" | ||||
| #include "Timeline.H" | |||||
| // #include "Timeline.H" | |||||
| #include <sys/mman.h> | #include <sys/mman.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| @@ -177,7 +178,13 @@ Peaks::peak ( nframes_t start, nframes_t end ) const | |||||
| Peak & | Peak & | ||||
| Peaks::operator[] ( int X ) const | 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 ) ); | |||||
| } | } | ||||
| @@ -70,7 +70,6 @@ class Peaks | |||||
| const char *peakname ( const char *filename ) const; | const char *peakname ( const char *filename ) const; | ||||
| Peak & peak ( nframes_t start, nframes_t end ) const; | |||||
| // Peaks ( ); | // Peaks ( ); | ||||
| @@ -110,6 +109,8 @@ public: | |||||
| bool current ( void ) const; | bool current ( void ) const; | ||||
| bool make_peaks ( int chunksize ); | bool make_peaks ( int chunksize ); | ||||
| Peak & peak ( nframes_t start, nframes_t end ) const; | |||||
| Peak & operator[] ( int X ) const; | Peak & operator[] ( int X ) const; | ||||
| }; | }; | ||||
| @@ -6,4 +6,5 @@ all: all | |||||
| %: | %: | ||||
| @ make -s -C FL CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ | @ make -s -C FL CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ | ||||
| @ make -s -C Timeline CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ | |||||
| @ make -s -C Mixer CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ | @ make -s -C Mixer CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" $@ | ||||
| @@ -64,7 +64,9 @@ Waveform::draw ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int chan | |||||
| j = start; | j = start; | ||||
| for ( int x = X; x <= X + W; ++x, ++j ) | 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.max *= _scale; | ||||
| p.min *= _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; | j = start; | ||||
| for ( int x = X; x <= X + W; ++x, ++j ) | 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; | 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; | j = start; | ||||
| for ( int x = X; x <= X + W; ++x, ++j ) | 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.max *= _scale; | ||||