| 69 | } |
| 70 | |
| 71 | bool |
| 72 | ExportSamplesTask::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 | |
| 95 | done: |
| 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 | |
| 105 | bool |
| 106 | ExportSamplesTask::exportToWav(void) |