[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 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 |
|
---|
[176] | 19 | #ifndef MEDIADATA_H
|
---|
| 20 | #define MEDIADATA_H
|
---|
[112] | 21 |
|
---|
| 22 | /* Here we store some volatile info about the file we need to remember */
|
---|
| 23 |
|
---|
| 24 | #include "tracks.h"
|
---|
| 25 | #include "subtracks.h"
|
---|
| 26 | #include "titletracks.h"
|
---|
[128] | 27 | #include "chapters.h"
|
---|
[112] | 28 | #include "config.h"
|
---|
| 29 |
|
---|
| 30 | #include <QString>
|
---|
| 31 | #include <QSettings>
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | // Types of media
|
---|
| 35 |
|
---|
| 36 | #define TYPE_UNKNOWN -1
|
---|
| 37 | #define TYPE_FILE 0
|
---|
| 38 | #define TYPE_DVD 1
|
---|
| 39 | #define TYPE_STREAM 2
|
---|
| 40 | #define TYPE_VCD 3
|
---|
| 41 | #define TYPE_AUDIO_CD 4
|
---|
| 42 | #define TYPE_TV 5
|
---|
| 43 |
|
---|
[165] | 44 | #ifdef BLURAY_SUPPORT
|
---|
| 45 | #define TYPE_BLURAY 6
|
---|
| 46 | #endif
|
---|
| 47 |
|
---|
[112] | 48 | class MediaData {
|
---|
| 49 |
|
---|
| 50 | public:
|
---|
| 51 | MediaData();
|
---|
| 52 | virtual ~MediaData();
|
---|
| 53 |
|
---|
| 54 | virtual void reset();
|
---|
| 55 |
|
---|
| 56 | QString filename;
|
---|
| 57 | double duration;
|
---|
| 58 |
|
---|
[188] | 59 | QStringList extra_params; // For streams
|
---|
| 60 |
|
---|
[112] | 61 | //Resolution of the video
|
---|
| 62 | int video_width;
|
---|
| 63 | int video_height;
|
---|
| 64 | double video_aspect;
|
---|
| 65 |
|
---|
| 66 | int type; // file, dvd...
|
---|
| 67 | QString dvd_id;
|
---|
| 68 |
|
---|
| 69 | bool novideo; // Only audio
|
---|
| 70 |
|
---|
| 71 | bool initialized;
|
---|
| 72 |
|
---|
| 73 | void list();
|
---|
| 74 |
|
---|
| 75 | #if PROGRAM_SWITCH
|
---|
| 76 | Tracks programs;
|
---|
| 77 | #endif
|
---|
| 78 | Tracks videos;
|
---|
| 79 | Tracks audios;
|
---|
| 80 | TitleTracks titles; // for DVDs
|
---|
| 81 |
|
---|
| 82 | SubTracks subs;
|
---|
| 83 |
|
---|
[128] | 84 | Chapters chapters;
|
---|
[112] | 85 |
|
---|
[128] | 86 | int n_chapters;
|
---|
[112] | 87 |
|
---|
| 88 | // Clip info
|
---|
| 89 | QString clip_name;
|
---|
| 90 | QString clip_artist;
|
---|
| 91 | QString clip_author;
|
---|
| 92 | QString clip_album;
|
---|
| 93 | QString clip_genre;
|
---|
| 94 | QString clip_date;
|
---|
| 95 | QString clip_track;
|
---|
| 96 | QString clip_copyright;
|
---|
| 97 | QString clip_comment;
|
---|
| 98 | QString clip_software;
|
---|
| 99 |
|
---|
| 100 | QString stream_title;
|
---|
| 101 | QString stream_url;
|
---|
[188] | 102 | QString stream_path; // From mpv
|
---|
[112] | 103 |
|
---|
| 104 |
|
---|
| 105 | // Other data not really useful for us,
|
---|
| 106 | // just to show info to the user.
|
---|
| 107 | QString demuxer;
|
---|
| 108 | QString video_format;
|
---|
| 109 | QString audio_format;
|
---|
| 110 | int video_bitrate;
|
---|
| 111 | QString video_fps;
|
---|
| 112 | int audio_bitrate;
|
---|
| 113 | int audio_rate;
|
---|
| 114 | int audio_nch; // channels?
|
---|
| 115 | QString video_codec;
|
---|
| 116 | QString audio_codec;
|
---|
| 117 |
|
---|
| 118 | /*QString info();*/
|
---|
[119] | 119 | QString displayName(bool show_tag = true);
|
---|
[112] | 120 | };
|
---|
| 121 |
|
---|
| 122 | #endif
|
---|