comparison data/model/DenseTimeValueModel.cpp @ 1126:39019ce29178 tony-2.0-integration

Merge through to branch for Tony 2.0
author Chris Cannam
date Thu, 20 Aug 2015 14:54:21 +0100
parents 4d9816ba0ebe
children 48e9f538e6e9
comparison
equal deleted inserted replaced
1119:e22bfe8ca248 1126:39019ce29178
35 35
36 cerr << "f0 = " << f0 << ", f1 = " << f1 << endl; 36 cerr << "f0 = " << f0 << ", f1 = " << f1 << endl;
37 37
38 if (f1 <= f0) return ""; 38 if (f1 <= f0) return "";
39 39
40 float **all = new float *[ch]; 40 auto data = getMultiChannelData(0, ch - 1, f0, f1 - f0);
41 for (int c = 0; c < ch; ++c) {
42 all[c] = new float[f1 - f0];
43 }
44 41
45 sv_frame_t n = getData(0, ch - 1, f0, f1 - f0, all); 42 if (data.empty() || data[0].empty()) return "";
46 43
47 QStringList list; 44 QStringList list;
48 for (sv_frame_t i = 0; i < n; ++i) { 45 for (sv_frame_t i = 0; in_range_for(data[0], i); ++i) {
49 QStringList parts; 46 QStringList parts;
50 parts << QString("%1").arg(f0 + i); 47 parts << QString("%1").arg(f0 + i);
51 for (int c = 0; c < ch; ++c) { 48 for (int c = 0; in_range_for(data, c); ++c) {
52 parts << QString("%1").arg(all[c][i]); 49 parts << QString("%1").arg(data[c][i]);
53 } 50 }
54 list << parts.join(delimiter); 51 list << parts.join(delimiter);
55 } 52 }
56 53
57 for (int c = 0; c < ch; ++c) {
58 delete[] all[c];
59 }
60 delete[] all;
61
62 return list.join("\n"); 54 return list.join("\n");
63 } 55 }