Mercurial > hg > svcore
comparison base/test/TestRealTime.h @ 1040:a1cd5abcb38b cxx11
Introduce and use a samplerate type
author | Chris Cannam |
---|---|
date | Wed, 04 Mar 2015 12:01:04 +0000 |
parents | abe13fe10ed6 |
children | b8a788c9a6f1 |
comparison
equal
deleted
inserted
replaced
1039:b14064bd1f97 | 1040:a1cd5abcb38b |
---|---|
280 1, 2, 8000, 22050, 44100, 44101, 192000 | 280 1, 2, 8000, 22050, 44100, 44101, 192000 |
281 }; | 281 }; |
282 int m = sizeof(rates)/sizeof(rates[0]); | 282 int m = sizeof(rates)/sizeof(rates[0]); |
283 | 283 |
284 for (int i = 0; i < n; ++i) { | 284 for (int i = 0; i < n; ++i) { |
285 int frame = frames[i]; | 285 sv_frame_t frame = frames[i]; |
286 for (int j = 0; j < m; ++j) { | 286 for (int j = 0; j < m; ++j) { |
287 int rate = rates[j]; | 287 int rate = rates[j]; |
288 | 288 |
289 RealTime rt = RealTime::frame2RealTime(frame, rate); | 289 RealTime rt = RealTime::frame2RealTime(frame, rate); |
290 int conv = RealTime::realTime2Frame(rt, rate); | 290 sv_frame_t conv = RealTime::realTime2Frame(rt, rate); |
291 QCOMPARE(frame, conv); | 291 QCOMPARE(frame, conv); |
292 | 292 |
293 rt = RealTime::frame2RealTime(-frame, rate); | 293 rt = RealTime::frame2RealTime(-frame, rate); |
294 conv = RealTime::realTime2Frame(rt, rate); | 294 conv = RealTime::realTime2Frame(rt, rate); |
295 QCOMPARE(-frame, conv); | 295 QCOMPARE(-frame, conv); |