aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro
Commit message (Collapse)AuthorAgeFilesLines
* optimized qmake filestrialuser022017-02-111-6/+0
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7030 90c681e8-e032-0410-971d-27865f9a5e38
* renaming experimental branchtrialuser022015-01-091-16/+0
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4675 90c681e8-e032-0410-971d-27865f9a5e38
* added Serbian translations (author: Mladen Pejaković)trialuser022014-01-061-1/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4004 90c681e8-e032-0410-971d-27865f9a5e38
* qmake: removed release option from configtrialuser022013-04-271-2/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3406 90c681e8-e032-0410-971d-27865f9a5e38
* prepare for Spanish translationtrialuser022010-08-201-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1839 90c681e8-e032-0410-971d-27865f9a5e38
* prepare for Japanese translationtrialuser022010-08-201-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1837 90c681e8-e032-0410-971d-27865f9a5e38
* added Dutch translation (author: Ronald ronald645 AT gmail.com)trialuser022010-05-281-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1751 90c681e8-e032-0410-971d-27865f9a5e38
* added Lithuanian translation (author: Algirdas Butkus)trialuser022009-07-271-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1076 90c681e8-e032-0410-971d-27865f9a5e38
* updated Turkish translation (author: Bilgesu Güngör)trialuser022009-07-231-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1070 90c681e8-e032-0410-971d-27865f9a5e38
* added Italian translation (author: Gian Paolo)trialuser022009-05-121-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@945 90c681e8-e032-0410-971d-27865f9a5e38
* updated Polish translation (Grzegorz Gibas)trialuser022009-04-031-0/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@887 90c681e8-e032-0410-971d-27865f9a5e38
* fixed command line plugintrialuser022008-11-261-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@640 90c681e8-e032-0410-971d-27865f9a5e38
* updated Chinese Traditional Translation (author: lon)trialuser022008-06-171-1/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@425 90c681e8-e032-0410-971d-27865f9a5e38
* updated Ukrainian translation (author: Gennadi Motsyo)trialuser022008-06-151-2/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@417 90c681e8-e032-0410-971d-27865f9a5e38
* updated Russian translationtrialuser022008-06-141-2/+4
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@414 90c681e8-e032-0410-971d-27865f9a5e38
* updated translationtrialuser022008-06-111-0/+4
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@402 90c681e8-e032-0410-971d-27865f9a5e38
* enabled command line plugins supporttrialuser022008-06-111-0/+26
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@401 90c681e8-e032-0410-971d-27865f9a5e38
pan>::FLAC::Properties *taglib_ap = 0; qint64 size = 0; if(m_path.endsWith(".flac")) { flacFile = new TagLib::FLAC::File(m_path.toLocal8Bit().constData()); taglib_ap = flacFile->audioProperties(); size = flacFile->length(); } else if(m_path.endsWith(".oga")) { oggFlacFile = new TagLib::Ogg::FLAC::File(m_path.toLocal8Bit().constData()); taglib_ap = oggFlacFile->audioProperties(); size = oggFlacFile->length(); } else return ap; if(taglib_ap) { QString text = QString("%1").arg(taglib_ap->length()/60); text +=":"+QString("%1").arg(taglib_ap->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(taglib_ap->sampleRate())); ap.insert(tr("Channels"), QString("%1").arg(taglib_ap->channels())); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(taglib_ap->bitrate())); } ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(size/1024)); if(flacFile) delete flacFile; if(oggFlacFile) delete oggFlacFile; return ap; } QList<TagModel* > FLACMetaDataModel::tags() { return m_tags; } QPixmap FLACMetaDataModel::cover() { //embedded cover FLAC__StreamMetadata *metadata; FLAC__metadata_get_picture (qPrintable(m_path), &metadata, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER, 0,0, -1,-1,-1,-1); if(metadata) { FLAC__StreamMetadata_Picture *pict = &metadata->data.picture; QPixmap cover; cover.loadFromData(QByteArray((char *)pict->data, (int) pict->data_length)); FLAC__metadata_object_delete(metadata); return cover; } QString cPath = coverPath(); return cPath.isEmpty() ? QPixmap() : QPixmap(cPath); } QString FLACMetaDataModel::coverPath() { return MetaDataManager::instance()->getCoverPath(m_path); } VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) { m_file = 0; m_ogg_file = 0; m_tag = 0; if(path.endsWith(".flac")) { m_file = new TagLib::FLAC::File (path.toLocal8Bit().constData()); m_tag = m_file->xiphComment(); } else if (path.endsWith(".oga")) { m_ogg_file = new TagLib::Ogg::FLAC::File(path.toLocal8Bit().constData()); m_tag = m_ogg_file->tag(); } } VorbisCommentModel::~VorbisCommentModel() { if(m_file) delete m_file; if(m_ogg_file) delete m_ogg_file; } const QString VorbisCommentModel::name() { return "Vorbis Comment"; } const QString VorbisCommentModel::value(Qmmp::MetaData key) { if(!m_tag) return QString(); switch((int) key) { case Qmmp::TITLE: return TStringToQString_qt4(m_tag->title()); case Qmmp::ARTIST: return TStringToQString_qt4(m_tag->artist()); case Qmmp::ALBUM: return TStringToQString_qt4(m_tag->album()); case Qmmp::COMMENT: return TStringToQString_qt4(m_tag->comment()); case Qmmp::GENRE: return TStringToQString_qt4(m_tag->genre()); case Qmmp::COMPOSER: if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: return QString::number(m_tag->track()); case Qmmp::DISCNUMBER: if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value) { if(!m_tag) return; TagLib::String str = QStringToTString_qt4(value); switch((int) key) { case Qmmp::TITLE: m_tag->setTitle(str); return; case Qmmp::ARTIST: m_tag->setArtist(str); return; case Qmmp::ALBUM: m_tag->setAlbum(str); return; case Qmmp::COMMENT: m_tag->setComment(str); return; case Qmmp::GENRE: m_tag->setGenre(str); return; case Qmmp::COMPOSER: value.isEmpty() ? m_tag->removeField("COMPOSER"): m_tag->addField("COMPOSER", str, true); return; case Qmmp::TRACK: m_tag->setTrack(value.toInt()); return; case Qmmp::YEAR: m_tag->setYear(value.toInt()); return; case Qmmp::DISCNUMBER: value == "0" ? m_tag->removeField("DISCNUMBER"): m_tag->addField("DISCNUMBER", str, true); } } void VorbisCommentModel::save() { if(m_file) m_file->save(); else if(m_ogg_file) m_ogg_file->save(); }