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