()
| 140 | } |
| 141 | |
| 142 | async stop() { |
| 143 | if (this.started) { |
| 144 | this.eventPromises.createStopPromise(); |
| 145 | const stopResult = this.csoundApi.csoundStop(this.csoundInstance); |
| 146 | await this.eventPromises.waitForStop(); |
| 147 | if (this.watcherStdOut) { |
| 148 | this.watcherStdOut.close(); |
| 149 | delete this.watcherStdOut; |
| 150 | } |
| 151 | |
| 152 | if (this.watcherStdErr) { |
| 153 | this.watcherStdErr.close(); |
| 154 | delete this.watcherStdErr; |
| 155 | } |
| 156 | |
| 157 | delete this.csoundInputBuffer; |
| 158 | delete this.csoundOutputBuffer; |
| 159 | delete this.currentPlayState; |
| 160 | return stopResult; |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | async start() { |
| 165 | if (!this.csoundApi) { |
no test coverage detected