author | harlekin <harlekin> | 2002-08-03 12:31:10 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-03 12:31:10 (UTC) |
commit | ed2394a99f071d4779498325476094255607d019 (patch) (unidiff) | |
tree | 62e0a648e7045e2102d22da5872496e76b5d2cf6 | |
parent | 3b1ab71b7bfe42310661764e1089200290c7b817 (diff) | |
download | opie-ed2394a99f071d4779498325476094255607d019.zip opie-ed2394a99f071d4779498325476094255607d019.tar.gz opie-ed2394a99f071d4779498325476094255607d019.tar.bz2 |
better file detection
-rw-r--r-- | noncore/multimedia/opieplayer2/mediadetect.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/mediadetect.cpp b/noncore/multimedia/opieplayer2/mediadetect.cpp index 7deeb2f..5e0da88 100644 --- a/noncore/multimedia/opieplayer2/mediadetect.cpp +++ b/noncore/multimedia/opieplayer2/mediadetect.cpp | |||
@@ -4,35 +4,37 @@ | |||
4 | 4 | ||
5 | MediaDetect::MediaDetect() { | 5 | MediaDetect::MediaDetect() { |
6 | } | 6 | } |
7 | 7 | ||
8 | MediaDetect::~MediaDetect() { | 8 | MediaDetect::~MediaDetect() { |
9 | } | 9 | } |
10 | 10 | ||
11 | char MediaDetect::videoOrAudio( const QString& fileName ) { | 11 | char MediaDetect::videoOrAudio( const QString& fileName ) { |
12 | if( fileName.right(4) == ".avi" || | 12 | if( (fileName.lower()).right(4) == ".avi" || |
13 | fileName.right(4) == ".mpg" || | 13 | (fileName.lower()).right(4) == ".mpg" || |
14 | fileName.right(4) == ".asf" || | 14 | (fileName.lower()).right(4) == ".asf" || |
15 | fileName.right(4) == ".mov" || | 15 | (fileName.lower()).right(4) == ".mov" || |
16 | fileName.right(5) == ".mpeg" ) { | 16 | (fileName.lower()).right(5) == ".mpeg" ) { |
17 | qDebug("Video out taken"); | ||
17 | return 'v'; | 18 | return 'v'; |
18 | } else if ( fileName.right(4) == ".avi" || | 19 | } else if ( (fileName.lower()).right(4) == "·mp1" || |
19 | fileName.right(4) == ".mp3" || | 20 | (fileName.lower()).right(4) == ".mp3" || |
20 | fileName.right(4) == ".ogg" || | 21 | (fileName.lower()).right(4) == ".ogg" || |
21 | fileName.right(4) == ".wav" ) { | 22 | (fileName.lower()).right(4) == ".wav" ) { |
23 | qDebug("AUDIO out taken"); | ||
22 | return 'a'; | 24 | return 'a'; |
23 | } else { | 25 | } else { |
24 | return 'f'; | 26 | return 'f'; |
25 | } | 27 | } |
26 | } | 28 | } |
27 | 29 | ||
28 | bool MediaDetect::isStreaming( const QString& fileName ) { | 30 | bool MediaDetect::isStreaming( const QString& fileName ) { |
29 | // ugly | 31 | // ugly |
30 | if( fileName.left(4) == "http" ) { | 32 | if( (fileName.lower()).left(4) == "http" ) { |
31 | return true; | 33 | return true; |
32 | } else if (fileName.left(3) == "ftp" ) { | 34 | } else if ( (fileName.lower()).left(3) == "ftp" ) { |
33 | return true; | 35 | return true; |
34 | } else { | 36 | } else { |
35 | return false; | 37 | return false; |
36 | } | 38 | } |
37 | } | 39 | } |
38 | 40 | ||