| 31 | |
| 32 | |
| 33 | AudioFileDevice::AudioFileDevice( OutputSettings const & outputSettings, |
| 34 | const ch_cnt_t _channels, |
| 35 | const QString & _file, |
| 36 | Mixer* _mixer ) : |
| 37 | AudioDevice( _channels, _mixer ), |
| 38 | m_outputFile( _file ), |
| 39 | m_outputSettings(outputSettings) |
| 40 | { |
| 41 | setSampleRate( outputSettings.getSampleRate() ); |
| 42 | |
| 43 | if( m_outputFile.open( QFile::WriteOnly | QFile::Truncate ) == false ) |
| 44 | { |
| 45 | QString title, message; |
| 46 | title = ExportProjectDialog::tr( "Could not open file" ); |
| 47 | message = ExportProjectDialog::tr( "Could not open file %1 " |
| 48 | "for writing.\nPlease make " |
| 49 | "sure you have write " |
| 50 | "permission to the file and " |
| 51 | "the directory containing the " |
| 52 | "file and try again!" |
| 53 | ).arg( _file ); |
| 54 | |
| 55 | if( gui ) |
| 56 | { |
| 57 | QMessageBox::critical( NULL, title, message, |
| 58 | QMessageBox::Ok, |
| 59 | QMessageBox::NoButton ); |
| 60 | } |
| 61 | else |
| 62 | { |
| 63 | fprintf( stderr, "%s\n", message.toUtf8().constData() ); |
| 64 | exit( EXIT_FAILURE ); |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | |
| 70 |
nothing calls this directly
no test coverage detected