X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Faudio%2FaudioStreamInfo.cpp;h=dcd9989a3c6c36ce0061623f0f50f2bee2a2967e;hb=f41d1de9f855972a98ded4ce11394ca11ad5b32e;hp=c4706527bd4778c788e968f63d21ac71d2cd2583;hpb=daf4290d903c670627d68727c6d1293235b50c7a;p=kdenlive diff --git a/src/lib/audio/audioStreamInfo.cpp b/src/lib/audio/audioStreamInfo.cpp index c4706527..dcd9989a 100644 --- a/src/lib/audio/audioStreamInfo.cpp +++ b/src/lib/audio/audioStreamInfo.cpp @@ -1,51 +1,67 @@ -/*************************************************************************** - * Copyright (C) 2012 by Simon Andreas Eugster (simon.eu@gmail.com) * - * This file is part of kdenlive. See www.kdenlive.org. * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - ***************************************************************************/ +/* +Copyright (C) 2012 Simon A. Eugster (Granjow) +This file is part of kdenlive. See www.kdenlive.org. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +*/ #include "audioStreamInfo.h" +#include #include -#include #include AudioStreamInfo::AudioStreamInfo(Mlt::Producer *producer, int audioStreamIndex) : m_audioStreamIndex(audioStreamIndex) { - QByteArray key; - key = QString("meta.media.%1.codec.sample_fmt").arg(audioStreamIndex).toLocal8Bit(); - m_samplingFormat = QString(producer->get(key.data())); + key = QString::fromLatin1("meta.media.%1.codec.sample_fmt").arg(audioStreamIndex).toLocal8Bit(); + m_samplingFormat = QString::fromLatin1(producer->get(key.data())); - key = QString("meta.media.%1.codec.sample_rate").arg(audioStreamIndex).toLocal8Bit(); + key = QString::fromLatin1("meta.media.%1.codec.sample_rate").arg(audioStreamIndex).toLocal8Bit(); m_samplingRate = atoi(producer->get(key.data())); - key = QString("meta.media.%1.codec.bit_rate").arg(audioStreamIndex).toLocal8Bit(); + key = QString::fromLatin1("meta.media.%1.codec.bit_rate").arg(audioStreamIndex).toLocal8Bit(); m_bitRate = atoi(producer->get(key.data())); - key = QString("meta.media.%1.codec.channels").arg(audioStreamIndex).toLocal8Bit(); + key = QString::fromLatin1("meta.media.%1.codec.channels").arg(audioStreamIndex).toLocal8Bit(); m_channels = atoi(producer->get(key.data())); - key = QString("meta.media.%1.codec.name").arg(audioStreamIndex).toLocal8Bit(); - m_codecName = QString(producer->get(key.data())); + key = QString::fromLatin1("meta.media.%1.codec.name").arg(audioStreamIndex).toLocal8Bit(); + m_codecName = QString::fromLatin1(producer->get(key.data())); - key = QString("meta.media.%1.codec.long_name").arg(audioStreamIndex).toLocal8Bit(); - m_codecLongName = QString(producer->get(key.data())); + key = QString::fromLatin1("meta.media.%1.codec.long_name").arg(audioStreamIndex).toLocal8Bit(); + m_codecLongName = QString::fromLatin1(producer->get(key.data())); } + AudioStreamInfo::~AudioStreamInfo() { } -int AudioStreamInfo::streamIndex() const { return m_audioStreamIndex; } -int AudioStreamInfo::samplingRate() const { return m_samplingRate; } -int AudioStreamInfo::channels() const { return m_channels; } -int AudioStreamInfo::bitrate() const { return m_bitRate; } +int AudioStreamInfo::streamIndex() const +{ + return m_audioStreamIndex; +} + +int AudioStreamInfo::samplingRate() const +{ + return m_samplingRate; +} + +int AudioStreamInfo::channels() const +{ + return m_channels; +} + +int AudioStreamInfo::bitrate() const +{ + return m_bitRate; +} + const QString& AudioStreamInfo::codecName(bool longName) const { if (longName) { @@ -57,11 +73,9 @@ const QString& AudioStreamInfo::codecName(bool longName) const void AudioStreamInfo::dumpInfo() const { - std::cout << "Info for audio stream " << m_audioStreamIndex << std::endl - << "\tCodec: " << m_codecLongName.toLocal8Bit().data() << " (" << m_codecName.toLocal8Bit().data() << ")" << std::endl - << "\tChannels: " << m_channels << std::endl - << "\tSampling rate: " << m_samplingRate << std::endl - << "\tBit rate: " << m_bitRate << std::endl - ; - + qDebug() << "Info for audio stream " << m_audioStreamIndex + << "\n\tCodec: " << m_codecLongName.toLocal8Bit().data() << " (" << m_codecName.toLocal8Bit().data() << ")" + << "\n\tChannels: " << m_channels + << "\n\tSampling rate: " << m_samplingRate + << "\n\tBit rate: " << m_bitRate; }