: __pBuf1(null)
, __pBuf2(null)
, __sampleSize(0)
+ , __sampleCount(0)
+ , __sampleCount1(0)
{
}
result r = E_SUCCESS;
r = Container::Construct(rect, true);
TryReturn(E_SUCCESS == r, r , "[%s] Propagated.", GetErrorMessage(r));
+
+ int width = rect.width;
+ r = __decodedPcmPitchBuf.Construct(width*DEFAULT_SAMPLE_SIZE);
+ TryReturn(E_SUCCESS == r, r , "[%s] Propagated.", GetErrorMessage(r));
+ r = __SrcPcmPitchBuf.Construct(width*DEFAULT_SAMPLE_SIZE);
+ TryReturn(E_SUCCESS == r, r , "[%s] Propagated.", GetErrorMessage(r));
return r;
}
{
__sampleSize = 2;
}
+
return r;
}
pCanvas->Clear();
pCanvas->Show();
+ __decodedPcmPitchBuf.Clear();
+ __SrcPcmPitchBuf.Clear();
+ __sampleCount = 0;
+ __sampleCount1 = 0;
CATCH:
SAFE_DELETE(pCanvas);
return r;
if (__pBuf1 != null)
{
- int length = __pBuf1->GetLimit();
- int samplesCount = length/__sampleSize;
-
- int limit = samplesCount > width ? width : samplesCount;
- int start = samplesCount > width ? 0 : (width-samplesCount)/2;
-
pCanvas = GetCanvasN();
TryCatch(pCanvas, r = GetLastResult(), "GetCanvasN failed:%s", GetErrorMessage(GetLastResult()));
//Draw the BaseLine for first PCM Pitch
pCanvas->DrawLine(Point(0,base),Point(width-1,base));
+ //Draw first PCM PitchMap
+ int limit = 0;
+
+ for(int i=0 ; i< SAMPLES_PER_FRAME_FOR_PITCHMAP; i=i+1)
+ {
+ __pBuf1->GetShort(i*sizeof(short),value);
+ __decodedPcmPitchBuf.SetShort(value);
+ __sampleCount++;
+ limit = (__sampleCount > width) ? width : __sampleCount;
+ if(__sampleCount == width)
+ {
+ __decodedPcmPitchBuf.SetPosition(0);
+ }
+
+ }
+
for(int i=0 ; i< limit ; i=i+1)
{
- __pBuf1->GetShort(2*i,value);
+ __decodedPcmPitchBuf.GetShort(i*sizeof(short),value);
int offset = (value*height1*AMPLIFICATION_FACTOR)/0xFFFF;
- pCanvas->DrawLine(Point(x+i+start,base),Point(x+i+start,base-offset));
+ pCanvas->DrawLine(Point(x+i,base),Point(x+i,base-offset));
}
+
if(__pBuf2 != null)
{
pCanvas->DrawLine(Point(0,base1),Point(width-1,base1));
pCanvas->DrawText(Point(x,y+height1),L"DECODED PCM PITCHMAP");
+ //Draw Second PCM PitchMap
+ limit = 0;
+ for(int i=0 ; i< SAMPLES_PER_FRAME_FOR_PITCHMAP; i=i+1)
+ {
+ __pBuf2->GetShort(i*sizeof(short),value);
+ __SrcPcmPitchBuf.SetShort(value);
+ __SrcPcmPitchBuf.GetPosition();
+ __sampleCount1++;
+ limit = (__sampleCount1 > width) ? width : __sampleCount1;
+
+ if(__sampleCount1 == width)
+ {
+ __SrcPcmPitchBuf.SetPosition(0);
+ }
+ }
+
for(int i=0 ; i< limit ; i=i+1)
{
- __pBuf2->GetShort(2*i,value);
+ __SrcPcmPitchBuf.GetShort(i*sizeof(short),value);
int offset1 = (value*height1*AMPLIFICATION_FACTOR)/0xFFFF;
- pCanvas->DrawLine(Point(x+i+start,base1),Point(x+i+start,base1-offset1));
+ pCanvas->DrawLine(Point(x+i,base1),Point(x+i,base1-offset1));
}
}