Browse Source

espeakedit: move the definition of SpectFrame::GetRms out of the class

master
Reece H. Dunn 9 years ago
parent
commit
e5610301b0
3 changed files with 10 additions and 10 deletions
  1. 1
    1
      src/compiledata.cpp
  2. 7
    7
      src/spect.cpp
  3. 2
    2
      src/spect.h

+ 1
- 1
src/compiledata.cpp View File

@@ -1623,7 +1623,7 @@ int LoadSpect(const char *path, int control)

fr_out->frflags = fr->markers | klatt_flag;

rms = int(fr->GetRms(spectseq->amplitude));
rms = int(GetFrameRms(fr, spectseq->amplitude));
if(rms > 255) rms = 255;
fr_out->rms = rms;


+ 7
- 7
src/spect.cpp View File

@@ -222,7 +222,7 @@ int LoadFrame(SpectFrame &frame, wxInputStream& stream, int file_format_type)



double SpectFrame::GetRms(int seq_amplitude)
double GetFrameRms(SpectFrame *frame, int seq_amplitude)
{//=========================================
int h;
float total=0;
@@ -233,12 +233,12 @@ double SpectFrame::GetRms(int seq_amplitude)

for(h=0; h<9; h++)
{
height = (peaks[h].pkheight * seq_amplitude * amp_adjust)/10000;
height = (frame->peaks[h].pkheight * seq_amplitude * frame->amp_adjust)/10000;
wpeaks[h].height = height << 8;

wpeaks[h].freq = peaks[h].pkfreq << 16;
wpeaks[h].left = peaks[h].pkwidth << 16;
wpeaks[h].right = peaks[h].pkright << 16;
wpeaks[h].freq = frame->peaks[h].pkfreq << 16;
wpeaks[h].left = frame->peaks[h].pkwidth << 16;
wpeaks[h].right = frame->peaks[h].pkright << 16;
}

maxh = PeaksToHarmspect(wpeaks,90<<16,htab,0);
@@ -246,8 +246,8 @@ double SpectFrame::GetRms(int seq_amplitude)
{
total += ((htab[h] * htab[h]) >> 10);
}
rms = sqrt(total) / 7.25;
return(rms);
frame->rms = sqrt(total) / 7.25;
return(frame->rms);
}



+ 2
- 2
src/spect.h View File

@@ -91,8 +91,6 @@ public:
SpectFrame(SpectFrame *copy=NULL);
~SpectFrame();

double GetRms(int amp);

int keyframe;
int amp_adjust;
float length_adjust;
@@ -113,6 +111,8 @@ public:
peak_t peaks[N_PEAKS];
};

double GetFrameRms(SpectFrame *frame, int amp);

class SpectSeq
{//===========
public:

Loading…
Cancel
Save