1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | #include "extensions.h"
|
---|
20 |
|
---|
21 | ExtensionList::ExtensionList() : QStringList()
|
---|
22 | {
|
---|
23 | }
|
---|
24 |
|
---|
25 | QString ExtensionList::forFilter() {
|
---|
26 | QString s;
|
---|
27 | for (int n=0; n < count(); n++) {
|
---|
28 | s = s + "*." + at(n) + " ";
|
---|
29 | }
|
---|
30 | if (!s.isEmpty()) s = " (" + s + ")";
|
---|
31 | return s;
|
---|
32 | }
|
---|
33 |
|
---|
34 | QStringList ExtensionList::forDirFilter() {
|
---|
35 | QStringList l;
|
---|
36 | for (int n=0; n < count(); n++) {
|
---|
37 | QString s = "*." + at(n);
|
---|
38 | l << s;
|
---|
39 | }
|
---|
40 | return l;
|
---|
41 | }
|
---|
42 |
|
---|
43 | QString ExtensionList::forRegExp() {
|
---|
44 | QString s;
|
---|
45 | for (int n=0; n < count(); n++) {
|
---|
46 | if (!s.isEmpty()) s = s + "|";
|
---|
47 | s = s + "^" + at(n) + "$";
|
---|
48 | }
|
---|
49 | return s;
|
---|
50 | }
|
---|
51 |
|
---|
52 | Extensions::Extensions()
|
---|
53 | {
|
---|
54 | _video << "avi" << "vfw" << "divx"
|
---|
55 | << "mpg" << "mpeg" << "m1v" << "m2v" << "mpv" << "dv" << "3gp"
|
---|
56 | << "mov" << "mp4" << "m4v" << "mqv"
|
---|
57 | << "dat" << "vcd"
|
---|
58 | << "ogg" << "ogm" << "ogv" << "ogx"
|
---|
59 | << "asf" << "wmv"
|
---|
60 | << "bin" << "iso" << "vob"
|
---|
61 | << "mkv" << "nsv" << "ram" << "flv"
|
---|
62 | << "rm" << "swf"
|
---|
63 | << "ts" << "rmvb" << "dvr-ms" << "m2t" << "m2ts" << "mts" << "rec" << "wtv"
|
---|
64 | << "f4v" << "hdmov" << "webm" << "vp8"
|
---|
65 | << "bik" << "smk" << "m4b";
|
---|
66 |
|
---|
67 | _audio << "mp3" << "ogg" << "oga" << "wav" << "wma" << "aac" << "ac3" << "dts" << "ra" << "ape" << "flac" << "thd" << "mka" << "m4a";
|
---|
68 |
|
---|
69 | _subtitles << "srt" << "sub" << "ssa" << "ass" << "idx" << "txt" << "smi"
|
---|
70 | << "rt" << "utf" << "aqt";
|
---|
71 |
|
---|
72 | _playlist << "m3u" << "m3u8" << "pls";
|
---|
73 |
|
---|
74 | _multimedia = _video;
|
---|
75 | for (int n = 0; n < _audio.count(); n++) {
|
---|
76 | if (!_multimedia.contains(_audio[n])) _multimedia << _audio[n];
|
---|
77 | }
|
---|
78 |
|
---|
79 | _all_playable << _multimedia << _playlist;
|
---|
80 | }
|
---|
81 |
|
---|
82 | Extensions::~Extensions() {
|
---|
83 | }
|
---|
84 |
|
---|