File indexing completed on 2024-04-21 04:45:42

0001 /****************************************************************************************
0002  * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>            *
0003  * Copyright (c) 2010 Ralf Engels <ralf-engels@gmx.de>                                  *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #ifndef AMAROK_METAVALUES_H
0019 #define AMAROK_METAVALUES_H
0020 
0021 #include <QHash>
0022 #include <QVariant>
0023 
0024 /* This file exists because we need to share the implementation between
0025  * amaroklib and amarokcollectionscanner (which doesn't link to amaroklib).
0026  */
0027 namespace Meta
0028 {
0029     /** This type can be used when a number of fields need to
0030      *  be given to some functions.
0031      */
0032     typedef QHash<qint64, QVariant> FieldHash;
0033 
0034     // the following constants are used at a number of places,
0035     // Most importantly the QueryMaker
0036     // it's also used when reading and writing taglib tags
0037 
0038     // if something is added here: also updsate MetaConstants.cpp
0039 
0040     //track metadata
0041     static const qint64 valUrl          = 1LL << 0;
0042     static const qint64 valTitle        = 1LL << 1;
0043     static const qint64 valArtist       = 1LL << 2;
0044     static const qint64 valAlbum        = 1LL << 3;
0045     static const qint64 valGenre        = 1LL << 4;
0046     static const qint64 valComposer     = 1LL << 5;
0047     static const qint64 valYear         = 1LL << 6;
0048     static const qint64 valComment      = 1LL << 7;
0049     static const qint64 valTrackNr      = 1LL << 8;
0050     static const qint64 valDiscNr       = 1LL << 9;
0051     static const qint64 valBpm          = 1LL << 10;
0052     //track data
0053     static const qint64 valLength       = 1LL << 11;
0054     static const qint64 valBitrate      = 1LL << 12;
0055     static const qint64 valSamplerate   = 1LL << 13;
0056     static const qint64 valFilesize     = 1LL << 14;
0057     static const qint64 valFormat       = 1LL << 15; // the file type a numeric value
0058     static const qint64 valCreateDate   = 1LL << 16;
0059     //statistics
0060     static const qint64 valScore        = 1LL << 17; // value 0 to 100
0061     static const qint64 valRating       = 1LL << 18; // value 0 to 10 (inclusive)
0062     static const qint64 valFirstPlayed  = 1LL << 19;
0063     static const qint64 valLastPlayed   = 1LL << 20;
0064     static const qint64 valPlaycount    = 1LL << 21;
0065     static const qint64 valUniqueId     = 1LL << 22;
0066     //replay gain
0067     static const qint64 valTrackGain    = 1LL << 23;
0068     static const qint64 valTrackGainPeak= 1LL << 24;
0069     static const qint64 valAlbumGain    = 1LL << 25;
0070     static const qint64 valAlbumGainPeak= 1LL << 26;
0071 
0072     static const qint64 valAlbumArtist  = 1LL << 27;
0073     static const qint64 valLabel        = 1LL << 28;
0074     static const qint64 valModified     = 1LL << 29;
0075 
0076     // currently only used for reading and writing tags. Not supported for queryMaker
0077     // TODO: support for queryMaker
0078     static const qint64 valCompilation  = 1LL << 40;
0079     static const qint64 valHasCover     = (1LL << 40) + 1;
0080     static const qint64 valImage        = (1LL << 40) + 2;
0081     static const qint64 valLyrics       = (1LL << 40) + 3;
0082 
0083     // start for custom numbers
0084     static const qint64 valCustom       = 1LL << 60;
0085 }
0086 
0087 #endif