source: smplayer/trunk/src/mplayerversion.cpp@ 181

Last change on this file since 181 was 181, checked in by Silvan Scherrer, 9 years ago

smplayer: update trunk to version 16.8.0

  • Property svn:eol-style set to LF
File size: 7.7 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2016 Ricardo Villalba <[email protected]>
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 "mplayerversion.h"
20#include "global.h"
21#include "preferences.h"
22
23#include <QRegExp>
24#include <QDebug>
25
26using namespace Global;
27
28QString MplayerVersion::mpv_version;
29bool MplayerVersion::is_mpv = false;
30
31#ifdef MPLAYER2_SUPPORT
32QString MplayerVersion::mplayer2_version;
33bool MplayerVersion::is_mplayer2 = false;
34#endif
35
36int MplayerVersion::mplayerVersion(QString string) {
37 //static QRegExp rx_mplayer_revision("^MPlayer (\\S+)-SVN-r(\\d+)-(.*)");
38 static QRegExp rx_mplayer_revision("^MPlayer (.*)[-\\.]r(\\d+)(.*)");
39 static QRegExp rx_mplayer_version("^MPlayer ([a-z0-9.]+)[-(.*)| (.*)]");
40 static QRegExp rx_mplayer_git("^MPlayer GIT(.*)", Qt::CaseInsensitive);
41 static QRegExp rx_mplayer_version_final("1.0rc([0-9])");
42#ifdef MPLAYER2_SUPPORT
43 static QRegExp rx_mplayer2_version("^MPlayer2 (.*) \\(C\\).*", Qt::CaseInsensitive);
44#endif
45 static QRegExp rx_mpv_version("^mpv (.*) \\(C\\).*", Qt::CaseInsensitive);
46#ifndef Q_OS_WIN
47 static QRegExp rx_mplayer_version_ubuntu("^MPlayer (\\d):(\\d)\\.(\\d)~(.*)");
48 static QRegExp rx_mplayer_revision_ubuntu("^MPlayer svn r(\\d+) (.*)");