diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index eab0e326..47fd1e58 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -238,6 +238,18 @@ Version + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1603,6 +1615,18 @@ MetaInfoDialog + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + Load Artwork From File diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 78b6a376..a2ed7c5d 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -238,6 +238,18 @@ Version Version + + Bitrate + Bitrate + + + Constant + konstant + + + Variable + variabel + CueImportDialog @@ -1632,6 +1644,18 @@ Sorry, failed to load artwork from selected file! Artwork konnte nicht aus der Ausgewählten Datei geladen werden! + + Edit this Information + Diese Information bearbeiten + + + Copy everything to Meta Info tab + Alles in den Metadaten-Tab kopieren + + + Clear all Meta Info + Metainformationen löschen + MetaInfoModel diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index d877c86d..7903f1bb 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -238,6 +238,18 @@ Version Versión + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1631,6 +1643,18 @@ Sorry, failed to load artwork from selected file! ¡Lo sentimos, ha habido un error al cargar la carátula desde el archivo seleccionado! + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + MetaInfoModel diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 12fa1cc9..9dceef4f 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -242,6 +242,18 @@ Version Version + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1641,6 +1653,18 @@ Ouvrir le dossier récursivement... Sorry, failed to load artwork from selected file! Impossible de charger l'oeuvre depuis le fichier sélectionné ! + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + MetaInfoModel diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index f4673257..7327dbdf 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -238,6 +238,18 @@ Version + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1632,6 +1644,18 @@ Sorry, failed to load artwork from selected file! + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + MetaInfoModel diff --git a/etc/Translation/LameXP_KR.ts b/etc/Translation/LameXP_KR.ts index d4813993..017b4c7d 100644 --- a/etc/Translation/LameXP_KR.ts +++ b/etc/Translation/LameXP_KR.ts @@ -238,6 +238,18 @@ Version 버전 + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1631,6 +1643,18 @@ Sorry, failed to load artwork from selected file! 죄송하지만, 선택한 파일로부터 아트워크 불러기가 실패되었습니다! + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + MetaInfoModel diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts index 8bf9c453..0d0fc723 100644 --- a/etc/Translation/LameXP_RU.ts +++ b/etc/Translation/LameXP_RU.ts @@ -238,6 +238,18 @@ Version Версия + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1634,6 +1646,18 @@ Sorry, failed to load artwork from selected file! Извините, немогу загрузит картинку из выделенного файла! + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + MetaInfoModel diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index 482608d5..98d54dd1 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -238,6 +238,18 @@ Version Версія + + Bitrate + + + + Constant + + + + Variable + + CueImportDialog @@ -1631,6 +1643,18 @@ Sorry, failed to load artwork from selected file! Вибачте, але неможливо завантажити обкладинку з вибраного файла! + + Edit this Information + + + + Copy everything to Meta Info tab + + + + Clear all Meta Info + + MetaInfoModel diff --git a/gui/MetaInfo.ui b/gui/MetaInfo.ui index 017373f9..97bdb029 100644 --- a/gui/MetaInfo.ui +++ b/gui/MetaInfo.ui @@ -172,6 +172,9 @@ + + Qt::CustomContextMenu + QAbstractItemView::SingleSelection @@ -498,6 +501,7 @@ + diff --git a/res/Icons.qrc b/res/Icons.qrc index 703a9a4c..51cf126b 100644 --- a/res/Icons.qrc +++ b/res/Icons.qrc @@ -64,6 +64,7 @@ icons/page_white_cplusplus.png icons/page_white_add.png icons/page_white_cd.png + icons/page_white_copy.png icons/paste_plain.png icons/photo.png icons/play.png diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index ece2cac9..15c1a1c8 100644 Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ diff --git a/src/Config.h b/src/Config.h index 56b45da1..8a09bbd2 100644 --- a/src/Config.h +++ b/src/Config.h @@ -29,8 +29,8 @@ #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_TYPE Beta -#define VER_LAMEXP_PATCH 5 -#define VER_LAMEXP_BUILD 554 +#define VER_LAMEXP_PATCH 6 +#define VER_LAMEXP_BUILD 558 /////////////////////////////////////////////////////////////////////////////// // Tools versions diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 9979cbe1..2b480661 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -648,7 +648,11 @@ void MainWindow::showEvent(QShowEvent *event) m_accepted = false; m_dropNoteLabel->setGeometry(0, 0, sourceFileView->width(), sourceFileView->height()); sourceModelChanged(); - tabWidget->setCurrentIndex(0); + + if(!event->spontaneous()) + { + tabWidget->setCurrentIndex(0); + } if(m_firstTimeShown) { @@ -1760,6 +1764,13 @@ void MainWindow::showDetailsButtonClicked(void) ( iResult = metaInfoDialog->exec(file, index.row() > 0, index.row() < m_fileListModel->rowCount() - 1); ) + + if(iResult == INT_MAX) + { + m_metaInfoModel->assignInfoFrom(file); + tabWidget->setCurrentIndex(tabWidget->indexOf(tabMetaData)); + break; + } if(!iResult) break; } diff --git a/src/Dialog_MetaInfo.cpp b/src/Dialog_MetaInfo.cpp index 45af622a..ed05a38a 100644 --- a/src/Dialog_MetaInfo.cpp +++ b/src/Dialog_MetaInfo.cpp @@ -62,12 +62,21 @@ MetaInfoDialog::MetaInfoDialog(QWidget *parent) connect(editButton, SIGNAL(clicked()), this, SLOT(editButtonClicked())); //Create context menu - m_contextMenu = new QMenu(); - QAction *loadArtworkAction = m_contextMenu->addAction(QIcon(":/icons/folder_image.png"), tr("Load Artwork From File")); - QAction *clearArtworkAction = m_contextMenu->addAction(QIcon(":/icons/bin.png"), tr("Clear Artwork")); + m_contextMenuInfo = new QMenu(); + m_contextMenuArtwork = new QMenu(); + QAction *editMetaInfoAction = m_contextMenuInfo->addAction(QIcon(":/icons/table_edit.png"), tr("Edit this Information")); + QAction *copyMetaInfoAction = m_contextMenuInfo->addAction(QIcon(":/icons/page_white_copy.png"), tr("Copy everything to Meta Info tab")); + QAction *clearMetaInfoAction = m_contextMenuInfo->addAction(QIcon(":/icons/bin.png"), tr("Clear all Meta Info")); + QAction *loadArtworkAction = m_contextMenuArtwork->addAction(QIcon(":/icons/folder_image.png"), tr("Load Artwork From File")); + QAction *clearArtworkAction = m_contextMenuArtwork->addAction(QIcon(":/icons/bin.png"), tr("Clear Artwork")); + SET_FONT_BOLD(editMetaInfoAction, true); SET_FONT_BOLD(loadArtworkAction, true); - connect(labelArtwork, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); - connect(frameArtwork, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); + connect(tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(infoContextMenuRequested(QPoint))); + connect(labelArtwork, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(artworkContextMenuRequested(QPoint))); + connect(frameArtwork, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(artworkContextMenuRequested(QPoint))); + connect(editMetaInfoAction, SIGNAL(triggered(bool)), this, SLOT(editButtonClicked())); + connect(copyMetaInfoAction, SIGNAL(triggered(bool)), this, SLOT(copyMetaInfoActionTriggered())); + connect(clearMetaInfoAction, SIGNAL(triggered(bool)), this, SLOT(clearMetaInfoActionTriggered())); connect(loadArtworkAction, SIGNAL(triggered(bool)), this, SLOT(editButtonClicked())); connect(clearArtworkAction, SIGNAL(triggered(bool)), this, SLOT(clearArtworkActionTriggered())); @@ -77,7 +86,8 @@ MetaInfoDialog::MetaInfoDialog(QWidget *parent) MetaInfoDialog::~MetaInfoDialog(void) { - LAMEXP_DELETE(m_contextMenu); + LAMEXP_DELETE(m_contextMenuInfo); + LAMEXP_DELETE(m_contextMenuArtwork); } //////////////////////////////////////////////////////////// @@ -165,8 +175,7 @@ void MetaInfoDialog::editButtonClicked(void) } } - -void MetaInfoDialog::contextMenuRequested(const QPoint &pos) +void MetaInfoDialog::infoContextMenuRequested(const QPoint &pos) { QAbstractScrollArea *scrollArea = dynamic_cast(QObject::sender()); QWidget *sender = scrollArea ? scrollArea->viewport() : dynamic_cast(QObject::sender()); @@ -175,11 +184,38 @@ void MetaInfoDialog::contextMenuRequested(const QPoint &pos) { if(pos.x() <= sender->width() && pos.y() <= sender->height() && pos.x() >= 0 && pos.y() >= 0) { - m_contextMenu->popup(sender->mapToGlobal(pos)); + m_contextMenuInfo->popup(sender->mapToGlobal(pos)); } } } +void MetaInfoDialog::artworkContextMenuRequested(const QPoint &pos) +{ + QAbstractScrollArea *scrollArea = dynamic_cast(QObject::sender()); + QWidget *sender = scrollArea ? scrollArea->viewport() : dynamic_cast(QObject::sender()); + + if(sender) + { + if(pos.x() <= sender->width() && pos.y() <= sender->height() && pos.x() >= 0 && pos.y() >= 0) + { + m_contextMenuArtwork->popup(sender->mapToGlobal(pos)); + } + } +} + +void MetaInfoDialog::copyMetaInfoActionTriggered(void) +{ + done(INT_MAX); +} + +void MetaInfoDialog::clearMetaInfoActionTriggered(void) +{ + if(MetaInfoModel *model = dynamic_cast(tableView->model())) + { + model->clearData(true); + } +} + void MetaInfoDialog::clearArtworkActionTriggered(void) { labelArtwork->setPixmap(QPixmap::fromImage(QImage(":/images/CD.png"))); diff --git a/src/Dialog_MetaInfo.h b/src/Dialog_MetaInfo.h index fcca527e..ff700ac4 100644 --- a/src/Dialog_MetaInfo.h +++ b/src/Dialog_MetaInfo.h @@ -40,9 +40,13 @@ private slots: void upButtonClicked(void); void downButtonClicked(void); void editButtonClicked(void); - void contextMenuRequested(const QPoint &pos); + void infoContextMenuRequested(const QPoint &pos); + void artworkContextMenuRequested(const QPoint &pos); + void copyMetaInfoActionTriggered(void); + void clearMetaInfoActionTriggered(void); void clearArtworkActionTriggered(void); private: - QMenu *m_contextMenu; + QMenu *m_contextMenuInfo; + QMenu *m_contextMenuArtwork; }; diff --git a/src/Model_AudioFile.cpp b/src/Model_AudioFile.cpp index a6a2f2d9..4a57dfa3 100644 --- a/src/Model_AudioFile.cpp +++ b/src/Model_AudioFile.cpp @@ -1,4 +1,4 @@ -/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// // LameXP - Audio Encoder Front-End // Copyright (C) 2004-2011 LoRd_MuldeR // @@ -26,6 +26,8 @@ #include #include +#define U16Str(X) QString::fromUtf16(reinterpret_cast(L##X)) + //////////////////////////////////////////////////////////// // Constructor & Destructor //////////////////////////////////////////////////////////// @@ -51,6 +53,8 @@ AudioFileModel::AudioFileModel(const AudioFileModel &model, bool copyMetaInfo) setFormatAudioSamplerate(model.m_formatAudioSamplerate); setFormatAudioChannels(model.m_formatAudioChannels); setFormatAudioBitdepth(model.m_formatAudioBitdepth); + setFormatAudioBitrate(model.m_formatAudioBitrate); + setFormatAudioBitrateMode(model.m_formatAudioBitrateMode); setFileDuration(model.m_fileDuration); if(copyMetaInfo) @@ -87,6 +91,8 @@ AudioFileModel &AudioFileModel::operator=(const AudioFileModel &model) setFormatAudioSamplerate(model.m_formatAudioSamplerate); setFormatAudioChannels(model.m_formatAudioChannels); setFormatAudioBitdepth(model.m_formatAudioBitdepth); + setFormatAudioBitrate(model.m_formatAudioBitrate); + setFormatAudioBitrateMode(model.m_formatAudioBitrateMode); return (*this); } @@ -122,6 +128,8 @@ void AudioFileModel::resetAll(void) m_formatAudioSamplerate = 0; m_formatAudioChannels = 0; m_formatAudioBitdepth = 0; + m_formatAudioBitrate = 0; + m_formatAudioBitrateMode = BitrateModeUndefined; } //////////////////////////////////////////////////////////// @@ -222,6 +230,16 @@ unsigned int AudioFileModel::formatAudioBitdepth(void) const return m_formatAudioBitdepth; } +unsigned int AudioFileModel::formatAudioBitrate(void) const +{ + return m_formatAudioBitrate; +} + +unsigned int AudioFileModel::formatAudioBitrateMode(void) const +{ + return m_formatAudioBitrateMode; +} + const QString AudioFileModel::fileDurationInfo(void) const { if(m_fileDuration) @@ -295,6 +313,21 @@ const QString AudioFileModel::formatAudioCompressInfo(void) const { info.append(QString(", %1: %2").arg(tr("Version"), m_formatAudioVersion)); } + if(m_formatAudioBitrate > 0) + { + switch(m_formatAudioBitrateMode) + { + case BitrateModeConstant: + info.append(U16Str(", %1: %2 kbps (%3)").arg(tr("Bitrate"), QString::number(m_formatAudioBitrate), tr("Constant"))); + break; + case BitrateModeVariable: + info.append(U16Str(", %1: \u2248%2 kbps (%3)").arg(tr("Bitrate"), QString::number(m_formatAudioBitrate), tr("Variable"))); + break; + default: + info.append(U16Str(", %1: %2 kbps").arg(tr("Bitrate"), QString::number(m_formatAudioBitrate))); + break; + } + } return info; } else @@ -402,6 +435,16 @@ void AudioFileModel::setFormatAudioBitdepth(unsigned int bitdepth) m_formatAudioBitdepth = bitdepth; } +void AudioFileModel::setFormatAudioBitrate(unsigned int bitrate) +{ + m_formatAudioBitrate = bitrate; +} + +void AudioFileModel::setFormatAudioBitrateMode(unsigned int bitrateMode) +{ + m_formatAudioBitrateMode = bitrateMode; +} + void AudioFileModel::updateMetaInfo(const AudioFileModel &model) { if(!model.fileArtist().isEmpty()) setFileArtist(model.fileArtist()); diff --git a/src/Model_AudioFile.h b/src/Model_AudioFile.h index 25031b4b..ef6347b8 100644 --- a/src/Model_AudioFile.h +++ b/src/Model_AudioFile.h @@ -38,6 +38,13 @@ public: AudioFileModel &operator=(const AudioFileModel &model); ~AudioFileModel(void); + enum BitrateMode + { + BitrateModeUndefined = 0, + BitrateModeConstant = 1, + BitrateModeVariable = 2, + }; + //----------------------- //Getters //----------------------- @@ -61,7 +68,9 @@ public: unsigned int formatAudioSamplerate(void) const; unsigned int formatAudioChannels(void) const; unsigned int formatAudioBitdepth(void) const; - + unsigned int formatAudioBitrate(void) const; + unsigned int formatAudioBitrateMode(void) const; + const QString fileDurationInfo(void) const; const QString formatContainerInfo(void) const; const QString formatAudioBaseInfo(void) const; @@ -91,6 +100,8 @@ public: void setFormatAudioSamplerate(unsigned int samplerate); void setFormatAudioChannels(unsigned int channels); void setFormatAudioBitdepth(unsigned int bitdepth); + void setFormatAudioBitrate(unsigned int bitrate); + void setFormatAudioBitrateMode(unsigned int bitrateMode); void updateMetaInfo(const AudioFileModel &model); @@ -114,6 +125,8 @@ private: unsigned int m_formatAudioSamplerate; unsigned int m_formatAudioChannels; unsigned int m_formatAudioBitdepth; + unsigned int m_formatAudioBitrate; + unsigned int m_formatAudioBitrateMode; void resetAll(void); }; diff --git a/src/Model_MetaInfo.cpp b/src/Model_MetaInfo.cpp index df0ca9d5..a1d7bc40 100644 --- a/src/Model_MetaInfo.cpp +++ b/src/Model_MetaInfo.cpp @@ -435,31 +435,41 @@ void MetaInfoModel::editArtwork(const QString &imagePath) m_audioFile->setFileCover(imagePath, false); } -void MetaInfoModel::clearData(void) +void MetaInfoModel::clearData(bool clearMetaOnly) { beginResetModel(); m_textUnknown = QString("(%1)").arg(tr("Unknown")); m_textNotSpecified = QString("(%1)").arg(tr("Not Specified")); - m_audioFile->setFilePath(QString()); - m_audioFile->setFileName(QString()); m_audioFile->setFileArtist(QString()); m_audioFile->setFileAlbum(QString()); m_audioFile->setFileGenre(QString()); m_audioFile->setFileComment(tr("Encoded with LameXP")); m_audioFile->setFileCover(QString(), false); m_audioFile->setFileYear(0); - m_audioFile->setFilePosition(UINT_MAX); - m_audioFile->setFileDuration(0); - m_audioFile->setFormatContainerType(QString()); - m_audioFile->setFormatContainerProfile(QString()); - m_audioFile->setFormatAudioType(QString()); - m_audioFile->setFormatAudioProfile(QString()); - m_audioFile->setFormatAudioVersion(QString()); - m_audioFile->setFormatAudioSamplerate(0); - m_audioFile->setFormatAudioChannels(0); - m_audioFile->setFormatAudioBitdepth(0); + m_audioFile->setFilePosition(m_offset ? UINT_MAX : 0); + + if(!clearMetaOnly) + { + m_audioFile->setFilePath(QString()); + m_audioFile->setFileName(QString()); + m_audioFile->setFileDuration(0); + m_audioFile->setFormatContainerType(QString()); + m_audioFile->setFormatContainerProfile(QString()); + m_audioFile->setFormatAudioType(QString()); + m_audioFile->setFormatAudioProfile(QString()); + m_audioFile->setFormatAudioVersion(QString()); + m_audioFile->setFormatAudioSamplerate(0); + m_audioFile->setFormatAudioChannels(0); + m_audioFile->setFormatAudioBitdepth(0); + } + else + { + QString temp = QFileInfo(m_audioFile->filePath()).baseName(); + temp = temp.split("-", QString::SkipEmptyParts).last().trimmed(); + m_audioFile->setFileName(temp); + } endResetModel(); } @@ -467,4 +477,11 @@ void MetaInfoModel::clearData(void) Qt::ItemFlags MetaInfoModel::flags(const QModelIndex &index) const { return QAbstractTableModel::flags(index); -} \ No newline at end of file +} + +void MetaInfoModel::assignInfoFrom(AudioFileModel &file) +{ + beginResetModel(); + m_audioFile->updateMetaInfo(file); + endResetModel(); +} diff --git a/src/Model_MetaInfo.h b/src/Model_MetaInfo.h index 855fa463..0c821744 100644 --- a/src/Model_MetaInfo.h +++ b/src/Model_MetaInfo.h @@ -43,7 +43,8 @@ public: Qt::ItemFlags flags(const QModelIndex &index) const; void editItem(const QModelIndex &index, QWidget *parent); void editArtwork(const QString &imagePath); - void clearData(void); + void assignInfoFrom(AudioFileModel &file); + void clearData(bool clearMetaOnly = false); private: AudioFileModel* m_audioFile; diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp index 58f56828..0bd0fcf8 100644 --- a/src/Thread_FileAnalyzer.cpp +++ b/src/Thread_FileAnalyzer.cpp @@ -380,20 +380,50 @@ void FileAnalyzer::updateInfo(AudioFileModel &audioFile, const QString &key, con } else if(!key.compare("Channel(s)", Qt::CaseInsensitive)) { - if(!audioFile.formatAudioChannels()) audioFile.setFormatAudioChannels(value.split(" ", QString::SkipEmptyParts).first().toInt()); + if(!audioFile.formatAudioChannels()) audioFile.setFormatAudioChannels(value.split(" ", QString::SkipEmptyParts).first().toUInt()); } else if(!key.compare("Sampling rate", Qt::CaseInsensitive)) { - if(!audioFile.formatAudioSamplerate()) audioFile.setFormatAudioSamplerate(ceil(value.split(" ", QString::SkipEmptyParts).first().toFloat() * 1000.0f)); + if(!audioFile.formatAudioSamplerate()) + { + bool ok = false; + float fTemp = abs(value.split(" ", QString::SkipEmptyParts).first().toFloat(&ok)); + if(ok) audioFile.setFormatAudioSamplerate(static_cast(floor(fTemp * 1000.0f + 0.5f))); + } } else if(!key.compare("Bit depth", Qt::CaseInsensitive)) { - if(!audioFile.formatAudioBitdepth()) audioFile.setFormatAudioBitdepth(value.split(" ", QString::SkipEmptyParts).first().toInt()); + if(!audioFile.formatAudioBitdepth()) audioFile.setFormatAudioBitdepth(value.split(" ", QString::SkipEmptyParts).first().toUInt()); } else if(!key.compare("Duration", Qt::CaseInsensitive)) { if(!audioFile.fileDuration()) audioFile.setFileDuration(parseDuration(value)); } + else if(!key.compare("Bit rate", Qt::CaseInsensitive)) + { + if(!audioFile.formatAudioBitrate()) + { + bool ok = false; + unsigned int uiTemp = value.split(" ", QString::SkipEmptyParts).first().toUInt(&ok); + if(ok) + { + audioFile.setFormatAudioBitrate(uiTemp); + } + else + { + float fTemp = abs(value.split(" ", QString::SkipEmptyParts).first().toFloat(&ok)); + if(ok) audioFile.setFormatAudioBitrate(static_cast(floor(fTemp + 0.5f))); + } + } + } + else if(!key.compare("Bit rate mode", Qt::CaseInsensitive)) + { + if(audioFile.formatAudioBitrateMode() == AudioFileModel::BitrateModeUndefined) + { + if(!value.compare("Constant", Qt::CaseInsensitive)) audioFile.setFormatAudioBitrateMode(AudioFileModel::BitrateModeConstant); + if(!value.compare("Variable", Qt::CaseInsensitive)) audioFile.setFormatAudioBitrateMode(AudioFileModel::BitrateModeVariable); + } + } break; } }