David McPaul submitted this test fir the BTimeCode class
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@807 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6c062d1f93
commit
0e421f46d0
47
src/tests/kits/media/TimeCodeTest.cpp
Normal file
47
src/tests/kits/media/TimeCodeTest.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
|
||||
#include "TimeCode.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
BTimeCode *aBTimeCode;
|
||||
int32 i,j,k;
|
||||
char outStr[30];
|
||||
|
||||
aBTimeCode = new BTimeCode();
|
||||
|
||||
aBTimeCode->SetType(B_TIMECODE_30_DROP_2);
|
||||
|
||||
// Test us -> TimeCode -> us
|
||||
for (i=59000;i<=61000;i++) {
|
||||
aBTimeCode->SetMicroseconds(i);
|
||||
aBTimeCode->GetString(outStr);
|
||||
j = aBTimeCode->Microseconds();
|
||||
k = aBTimeCode->LinearFrames();
|
||||
printf("%ld = %s = %ld = %ld\n",i,outStr,j,k);
|
||||
}
|
||||
|
||||
// Test frames -> TimeCode -> frames
|
||||
for (i=8990;i<=8995;i++) {
|
||||
aBTimeCode->SetLinearFrames(i);
|
||||
aBTimeCode->GetString(outStr);
|
||||
j = aBTimeCode->LinearFrames();
|
||||
printf("%ld = %s = %ld\n",i,outStr,j);
|
||||
}
|
||||
|
||||
for (i=17981;i<=17990;i++) {
|
||||
aBTimeCode->SetLinearFrames(i);
|
||||
aBTimeCode->GetString(outStr);
|
||||
j = aBTimeCode->LinearFrames();
|
||||
printf("%ld = %s = %ld\n",i,outStr,j);
|
||||
}
|
||||
|
||||
for (i=26971;i<=26980;i++) {
|
||||
aBTimeCode->SetLinearFrames(i);
|
||||
aBTimeCode->GetString(outStr);
|
||||
j = aBTimeCode->LinearFrames();
|
||||
printf("%ld = %s = %ld\n",i,outStr,j);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user