Display the wave form
| 266 | |
| 267 | // Display the wave form |
| 268 | void Frame::DisplayWaveform() |
| 269 | { |
| 270 | // Get audio wave form image |
| 271 | GetWaveform(720, 480, 0, 123, 255, 255); |
| 272 | |
| 273 | if (!QApplication::instance()) { |
| 274 | // Only create the QApplication once |
| 275 | static int argc = 1; |
| 276 | static char* argv[1] = {NULL}; |
| 277 | previewApp = std::make_shared<QApplication>(argc, argv); |
| 278 | } |
| 279 | |
| 280 | // Create window |
| 281 | QWidget previewWindow; |
| 282 | previewWindow.setStyleSheet("background-color: #000000;"); |
| 283 | QHBoxLayout layout; |
| 284 | |
| 285 | // Create label with current frame's waveform image |
| 286 | QLabel previewLabel; |
| 287 | previewLabel.setPixmap(QPixmap::fromImage(*wave_image)); |
| 288 | previewLabel.setMask(QPixmap::fromImage(*wave_image).mask()); |
| 289 | layout.addWidget(&previewLabel); |
| 290 | |
| 291 | // Show the window |
| 292 | previewWindow.setLayout(&layout); |
| 293 | previewWindow.show(); |
| 294 | previewApp->exec(); |
| 295 | |
| 296 | // Deallocate waveform image |
| 297 | ClearWaveform(); |
| 298 | } |
| 299 | |
| 300 | // Get magnitude of range of samples (if channel is -1, return average of all channels for that sample) |
| 301 | float Frame::GetAudioSample(int channel, int sample, int magnitude_range) |
nothing calls this directly
no outgoing calls
no test coverage detected