MCPcopy Create free account
hub / github.com/LMMS/lmms / AudioFileDevice

Method AudioFileDevice

src/core/audio/AudioFileDevice.cpp:33–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32
33AudioFileDevice::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

Callers

nothing calls this directly

Calls 3

setSampleRateFunction · 0.85
openMethod · 0.80
getSampleRateMethod · 0.45

Tested by

no test coverage detected