Browse Source

Try to get timeline working again.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
b846d29c4b
5 changed files with 25 additions and 12 deletions
  1. +6
    -6
      Engine/Audio_File_SF.C
  2. +9
    -2
      Engine/Peaks.C
  3. +2
    -1
      Engine/Peaks.H
  4. +1
    -0
      Makefile
  5. +7
    -3
      Timeline/Waveform.C

+ 6
- 6
Engine/Audio_File_SF.C View File

@@ -18,7 +18,7 @@
/*******************************************************************************/

#include "Audio_File_SF.H"
#include "Timeline.H"
// #include "Timeline.H"

#include <sndfile.h>

@@ -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;



+ 9
- 2
Engine/Peaks.C View File

@@ -18,7 +18,8 @@
/*******************************************************************************/

#include "Peaks.H"
#include "Timeline.H"

// #include "Timeline.H"

#include <sys/mman.h>
#include <sys/types.h>
@@ -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 ) );

}




+ 2
- 1
Engine/Peaks.H View File

@@ -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;

};

+ 1
- 0
Makefile View File

@@ -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)" $@

+ 7
- 3
Timeline/Waveform.C View File

@@ -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;



Loading…
Cancel
Save