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

0001 /****************************************************************************************
0002  * Copyright (c) 2010 Sergey Ivanov <123kash@gmail.com>                                 *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 
0018 #ifndef TAGSFROMFILENAMEGUESSER_H
0019 #define TAGSFROMFILENAMEGUESSER_H
0020 
0021 #include "amarokshared_export.h"
0022 #include "MetaValues.h"
0023 
0024 namespace Meta
0025 {
0026     namespace Tag
0027     {
0028         namespace TagGuesser
0029         {
0030             /**
0031             * Try to guess metadata from file name, using common filename
0032             * templates, can't work with full file path.
0033             * @arg fileName file name, if fileName contains full path, It will be
0034             * truncated.
0035             * @returns guessed metadata.
0036             */
0037             AMAROKSHARED_EXPORT Meta::FieldHash guessTags( const QString &fileName );
0038 
0039             /**
0040             * Try to guess metadata from file name,using specified scheme.
0041             * @arg fileName file path
0042             * @arg scheme is a regular expression with tokens
0043             * @arg cutTrailingSpaces - if true - force guesser to cut trailing spaces
0044             * @arg convertUnderscores - if true - force guesser too replace all underscores with spaces
0045             * @arg isRegExp - if true - prevents guesser from screening special symbols
0046             * Available Tokens: %album%, %albumartist%, %artist%, %title%, %track%.
0047             */
0048             AMAROKSHARED_EXPORT Meta::FieldHash guessTagsByScheme( const QString &fileName,
0049                                                              const QString &scheme,
0050                                                              bool cutTrailingSpaces = true,
0051                                                              bool convertUnderscores = true,
0052                                                              bool isRegExp = false );
0053         }
0054     }
0055 }
0056 
0057 #endif // TAGSFROMFILENAMEGUESSER_H