summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-05-14 21:04:02 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-05-29 15:19:07 +0000
commit0fb5e86053427aa527d3780d279d7faf5b3469bf (patch)
tree4360c46704caa3293086848939d9e278b40ca44e /examples
parentf60c028d522ce3e4ed01cf00e6601956a1f0ed01 (diff)
parentcf28371c1edd0c6d04c4518cdf3270067d0cf8a7 (diff)
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'examples')
-rw-r--r--examples/multimedia/audiodecoder/audiodecoder.cpp24
-rw-r--r--examples/multimedia/audiodecoder/main.cpp10
2 files changed, 17 insertions, 17 deletions
diff --git a/examples/multimedia/audiodecoder/audiodecoder.cpp b/examples/multimedia/audiodecoder/audiodecoder.cpp
index 15c88ebc9..f812fd3b6 100644
--- a/examples/multimedia/audiodecoder/audiodecoder.cpp
+++ b/examples/multimedia/audiodecoder/audiodecoder.cpp
@@ -129,16 +129,16 @@ void AudioDecoder::error(QAudioDecoder::Error error)
case QAudioDecoder::NoError:
return;
case QAudioDecoder::ResourceError:
- m_cout << "Resource error" << Qt::endl;
+ m_cout << "Resource error\n";
break;
case QAudioDecoder::FormatError:
- m_cout << "Format error" << Qt::endl;
+ m_cout << "Format error\n";
break;
case QAudioDecoder::AccessDeniedError:
- m_cout << "Access denied error" << Qt::endl;
+ m_cout << "Access denied error\n";
break;
case QAudioDecoder::ServiceMissingError:
- m_cout << "Service missing error" << Qt::endl;
+ m_cout << "Service missing error\n";
break;
}
@@ -149,10 +149,10 @@ void AudioDecoder::stateChanged(QAudioDecoder::State newState)
{
switch (newState) {
case QAudioDecoder::DecodingState:
- m_cout << "Decoding..." << Qt::endl;
+ m_cout << "Decoding...\n";
break;
case QAudioDecoder::StoppedState:
- m_cout << "Decoding stopped" << Qt::endl;
+ m_cout << "Decoding stopped\n";
break;
}
}
@@ -160,12 +160,12 @@ void AudioDecoder::stateChanged(QAudioDecoder::State newState)
void AudioDecoder::finished()
{
if (!m_fileWriter.close())
- m_cout << "Failed to finilize output file" << Qt::endl;
+ m_cout << "Failed to finilize output file\n";
- m_cout << "Decoding finished" << Qt::endl;
+ m_cout << "Decoding finished\n";
if (m_isPlayback) {
- m_cout << "Starting playback" << Qt::endl;
+ m_cout << "Starting playback\n";
m_soundEffect.setSource(QUrl::fromLocalFile(m_targetFilename));
m_soundEffect.play();
} else {
@@ -176,7 +176,7 @@ void AudioDecoder::finished()
void AudioDecoder::playbackStatusChanged()
{
if (m_soundEffect.status() == QSoundEffect::Error) {
- m_cout << "Playback error" << Qt::endl;
+ m_cout << "Playback error\n";
emit done();
}
}
@@ -184,7 +184,7 @@ void AudioDecoder::playbackStatusChanged()
void AudioDecoder::playingChanged()
{
if (!m_soundEffect.isPlaying()) {
- m_cout << "Playback finished" << Qt::endl;
+ m_cout << "Playback finished\n";
if (m_isDelete)
QFile::remove(m_targetFilename);
emit done();
@@ -200,7 +200,7 @@ void AudioDecoder::updateProgress()
progress = position / (qreal)duration;
if (progress > m_progress + 0.1) {
- m_cout << "Decoding progress: " << (int)(progress * 100.0) << "%" << Qt::endl;
+ m_cout << "Decoding progress: " << (int)(progress * 100.0) << "%\n";
m_progress = progress;
}
}
diff --git a/examples/multimedia/audiodecoder/main.cpp b/examples/multimedia/audiodecoder/main.cpp
index 46e70445e..9c536ef0a 100644
--- a/examples/multimedia/audiodecoder/main.cpp
+++ b/examples/multimedia/audiodecoder/main.cpp
@@ -63,10 +63,10 @@ int main(int argc, char *argv[])
QTextStream cout(stdout, QIODevice::WriteOnly);
if (app.arguments().size() < 2) {
- cout << "Usage: audiodecoder [-p] [-pd] SOURCEFILE [TARGETFILE]" << Qt::endl;
- cout << "Set -p option if you want to play output file." << Qt::endl;
- cout << "Set -pd option if you want to play output file and delete it after successful playback." << Qt::endl;
- cout << "Default TARGETFILE name is \"out.wav\" in the same directory as the source file." << Qt::endl;
+ cout << "Usage: audiodecoder [-p] [-pd] SOURCEFILE [TARGETFILE]\n";
+ cout << "Set -p option if you want to play output file.\n";
+ cout << "Set -pd option if you want to play output file and delete it after successful playback.\n";
+ cout << "Default TARGETFILE name is \"out.wav\" in the same directory as the source file.\n";
return 0;
}
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
int sourceFileIndex = (isPlayback || isDelete) ? 2 : 1;
if (app.arguments().size() <= sourceFileIndex) {
- cout << "Error: source filename is not specified." << Qt::endl;
+ cout << "Error: source filename is not specified.\n";
return 0;
}
sourceFile.setFile(app.arguments().at(sourceFileIndex));