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

0001 /****************************************************************************************
0002  * Copyright (c) 2010 Rick W. Chen <stuffcorpse@archlinux.us>                           *
0003  * Copyright (c) 2010 Stefan Derkits <stefan@derkits.at>                                *
0004  * Copyright (c) 2010 Christian Wagner <christian.wagner86@gmx.at>                      *
0005  *                                                                                      *
0006  * This program is free software; you can redistribute it and/or modify it under        *
0007  * the terms of the GNU General Public License as published by the Free Software        *
0008  * Foundation; either version 2 of the License, or (at your option) any later           *
0009  * version.                                                                             *
0010  *                                                                                      *
0011  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0013  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0014  *                                                                                      *
0015  * You should have received a copy of the GNU General Public License along with         *
0016  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0017  ****************************************************************************************/
0018 
0019 #ifndef SHARED_FILETYPE_H
0020 #define SHARED_FILETYPE_H
0021 
0022 #include "amarokshared_export.h"
0023 
0024 #include <QStringList>
0025 #include <QString>
0026 
0027 namespace Amarok
0028 {
0029     //New FileTypes must also be added to s_fileTypeStrings in FileType.cpp
0030     enum FileType
0031     {
0032         Unknown     =  0,
0033         Mp3         =  1,
0034         Ogg         =  2, // please use just for Ogg Vorbis
0035         Flac        =  3,
0036         Mp4         =  4, // a file in MPEG-4 container that may or may not contain video
0037         Wma         =  5,
0038         Aiff        =  6,
0039         Mpc         =  7,
0040         TrueAudio   =  8,
0041         Wav         =  9,
0042         WavPack     = 10,
0043         M4a         = 11, // a file in MPEG-4 container that contains only audio
0044         M4v         = 12, // a file in MPEG-4 container that for sure contains video
0045         Mod         = 13,
0046         S3M         = 14,
0047         IT          = 15,
0048         XM          = 16,
0049         Speex       = 17,
0050         Opus        = 18
0051     };
0052 
0053     class AMAROKSHARED_EXPORT FileTypeSupport
0054     {
0055         public:
0056             /**
0057              * Return preferred extension of given filetype
0058              *
0059              * TODO: rename to extension()
0060              */
0061             static QString toString( Amarok::FileType ft );
0062 
0063             /**
0064              * Return a list of possible localized filetype strings.
0065              *
0066              * TODO: rename to possibleExtensions()
0067              */
0068             static QStringList possibleFileTypes();
0069 
0070             /**
0071              * Return file type given file extension, which must exclude the leading dot.
0072              *
0073              * @return Amarok::FileType enum, Amarok::Unknown if no other suitable
0074              *         type is in the enum
0075              */
0076             static Amarok::FileType fileType( const QString& extension );
0077     };
0078 }
0079 
0080 #endif /* SHARED_FILETYPE_H */