Changeset 176 for smplayer/trunk/src/inforeader.h
- Timestamp:
- May 3, 2016, 5:25:45 PM (9 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 175
- Property svn:mergeinfo changed
-
smplayer/trunk/src/inforeader.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 18 18 19 19 20 #ifndef _INFOREADER_H_21 #define _INFOREADER_H_20 #ifndef INFOREADER_H 21 #define INFOREADER_H 22 22 23 23 #include <QObject> 24 24 #include <QList> 25 26 #define USE_QPROCESS 1 27 28 #if USE_QPROCESS 29 class QProcess; 30 #else 31 class MyProcess; 32 #endif 25 #include <QStringList> 26 #include "config.h" 33 27 34 28 class InfoData { … … 45 39 void setDesc(QString desc) { _desc = desc; }; 46 40 47 QString name() { return _name; }; 48 QString desc() { return _desc; }; 41 QString name() const { return _name; }; 42 QString desc() const { return _desc; }; 43 44 bool operator<(const InfoData & other) const { 45 return name() < other.name(); 46 } 47 48 bool operator==(const InfoData & other) const { 49 return name() == other.name(); 50 } 49 51 50 52 private: … … 63 65 ~InfoReader(); 64 66 67 void setPlayerBin(const QString & bin); 68 QString playerBin() { return mplayerbin; } 69 65 70 void getInfo(); 66 71 67 72 InfoList voList() { return vo_list; }; 68 73 InfoList aoList() { return ao_list; }; 74 75 #if ALLOW_DEMUXER_CODEC_CHANGE 69 76 InfoList demuxerList() { return demuxer_list; }; 70 77 InfoList vcList() { return vc_list; }; 71 78 InfoList acList() { return ac_list; }; 79 #endif 80 QStringList vfList() { return vf_list; }; 81 QStringList optionList() { return option_list; }; 72 82 73 int mplayerVersion() { return mplayer_svn; }; 83 int mplayerSVN() { return mplayer_svn; }; 84 QString mpvVersion() { return mpv_version; }; 85 QString mplayer2Version() { return mplayer2_version; }; 86 bool isMplayer2() { return is_mplayer2; }; 87 bool isMPV() { return is_mpv; }; 74 88 75 //! Returns an InfoReader objects. If it didn't exist before, one 76 //! is created and getInfo() is called. 77 static InfoReader * obj(); 89 QString playerVersion(); 78 90 79 protected slots: 80 virtual void readLine(QByteArray); 91 //! Returns an InfoReader object. If it didn't exist before, one 92 //! is created. 93 static InfoReader * obj(const QString & mplayer_bin = QString::null); 81 94 82 95 protected: 83 bool run(QString options);84 void list();85 86 protected:87 #if USE_QPROCESS88 QProcess * proc;89 #else90 MyProcess * proc;91 #endif92 96 QString mplayerbin; 93 97 94 98 InfoList vo_list; 95 99 InfoList ao_list; 100 101 #if ALLOW_DEMUXER_CODEC_CHANGE 96 102 InfoList demuxer_list; 97 103 InfoList vc_list; 98 104 InfoList ac_list; 105 #endif 106 QStringList vf_list; 107 QStringList option_list; 99 108 100 109 int mplayer_svn; 110 QString mpv_version; 111 QString mplayer2_version; 112 bool is_mplayer2, is_mpv; 101 113 102 114 private: 103 bool waiting_for_key;104 int reading_type;105 106 115 static InfoReader * static_obj; 116 static QStringList convertInfoListToList(InfoList l); 117 static InfoList convertListToInfoList(QStringList l); 107 118 }; 108 119
Note:
See TracChangeset
for help on using the changeset viewer.