Browse Source

espeakedit: move the definition of GetFrameLength into spect.cpp

master
Reece H. Dunn 9 years ago
parent
commit
bb2d73a875
2 changed files with 7 additions and 14 deletions
  1. 7
    12
      src/spect.cpp
  2. 0
    2
      src/spect.h

+ 7
- 12
src/spect.cpp View File

} }




float SpectSeq::GetFrameLength(int frame, int plus, int *original)
static float GetFrameLength(SpectSeq &spect, int frame)
{//=============================================================== {//===============================================================
int ix; int ix;
float adjust=0; float adjust=0;


if(frame >= numframes-1) return(0);
if(frame >= spect.numframes-1) return(0);
// include the adjustment for this frame ?
if(plus) adjust = frames[frame]->length_adjust;
for(ix=frame+1; ix<numframes-1; ix++)
for(ix=frame+1; ix<spect.numframes-1; ix++)
{ {
if(frames[ix]->keyframe) break; // reached next keyframe
adjust += frames[ix]->length_adjust;
if(spect.frames[ix]->keyframe) break; // reached next keyframe
adjust += spect.frames[ix]->length_adjust;
} }
if(original != NULL)
*original = int((frames[ix]->time - frames[frame]->time) * 1000.0 + 0.5);
return ((frames[ix]->time - frames[frame]->time) * 1000.0 + adjust);
return ((spect.frames[ix]->time - spect.frames[frame]->time) * 1000.0 + adjust);
} }




for(ix=0; ix<numframes; ix++) for(ix=0; ix<numframes; ix++)
{ {
if(frames[ix]->keyframe) if(frames[ix]->keyframe)
frames[ix]->length_adjust = frames[ix]->length - GetFrameLength(ix,0,NULL);
frames[ix]->length_adjust = frames[ix]->length - GetFrameLength(*this,ix);
} }
return(0); return(0);
} // end of SpectSeq::Load } // end of SpectSeq::Load

+ 0
- 2
src/spect.h View File

~SpectSeq(); ~SpectSeq();
int Load(wxInputStream& stream); int Load(wxInputStream& stream);


float GetFrameLength(int frame, int plus, int *original_mS);

int numframes; int numframes;
int amplitude; int amplitude;
int spare; int spare;

Loading…
Cancel
Save