Fixed bug #3 and some other bugs
[qallinone.git] / main.cpp
blobe00963ae13fabe06692a51b967ec4dd4e5c11a12
1 /*qAllInOne is a free open-source software built using Qt to provide users an All-In-One media player, so it can view images, play videos and audio.
2 qAllInOne Copyright (C) 2013 Mahmoud Jaoune
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 3 of the License, or any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.*/
16 #include "mainwindow.h"
17 #include <QApplication>
19 int main(int argc, char *argv[])
21 QApplication a(argc, argv);
22 MainWindow w;
23 w.show();
25 //Arguments
26 //Intializing Arguments
27 QString ArgumentStr = argv[1];
30 /*QFile MediaFile;
31 MediaFile.setFileName(ArgumentStr);
32 MediaFile.open(QFile::ReadOnly);
33 MediaFile.close();*/
35 QString Fname = ArgumentStr;
38 //Extension Check and MultiMedia processing
40 if(Fname.endsWith(".jpg",Qt::CaseInsensitive) || Fname.endsWith(".jpeg",Qt::CaseInsensitive))
42 w.AIO_ProcessMedia(Fname,w.JPG);
44 else if(Fname.endsWith(".png",Qt::CaseInsensitive))
46 w.AIO_ProcessMedia(Fname,w.PNG);
48 else if(Fname.endsWith(".bmp",Qt::CaseInsensitive))
50 w.AIO_ProcessMedia(Fname,w.BMP);
52 else if(Fname.endsWith(".gif",Qt::CaseInsensitive))
54 w.AIO_ProcessMedia(Fname,w.GIF);
56 else if(Fname.endsWith(".wmv",Qt::CaseInsensitive))
58 w.AIO_ProcessMedia(Fname,w.WMV);
60 else if(Fname.endsWith(".mp4",Qt::CaseInsensitive))
62 w.AIO_ProcessMedia(Fname,w.MP4);
64 else if(Fname.endsWith(".avi",Qt::CaseInsensitive))
66 w.AIO_ProcessMedia(Fname,w.AVI);
68 else if(Fname.endsWith(".mp3",Qt::CaseInsensitive))
70 w.AIO_ProcessMedia(Fname,w.MP3);
74 return a.exec();