MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / exportToMat5

Method exportToMat5

Tasks/ExportSamplesTask.cpp:71–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool
72ExportSamplesTask::exportToMat5(void)
73{
74 size_t size = this->data.size();
75 bool ok = false;
76
77 for (size_t i = 0; !this->cancelFlag && i < size; ++i) {
78 SU_TRYCATCH(
79 su_mat_file_stream_col(
80 this->mf,
81 SU_C_REAL(this->data[i]),
82 SU_C_IMAG(this->data[i])),
83 goto done);
84
85 if (i % SIGDIGGER_EXPORT_SAMPLES_BREATHE_BLOCK_SIZE == 0) {
86 SU_TRYCATCH(su_mat_file_flush(mf), goto done);
87 this->breathe(i);
88 }
89 }
90
91 SU_TRYCATCH(su_mat_file_flush(mf), goto done);
92
93 ok = true;
94
95done:
96 if (!ok)
97 emit error(
98 "Cannot save data to Mat5 file "
99 + this->path
100 + ". See error log for details.");
101
102 return ok;
103}
104
105bool
106ExportSamplesTask::exportToWav(void)

Callers 1

workMethod · 0.95

Calls 2

breatheMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected