source: smplayer/trunk/src/mediadata.cpp@ 148

Last change on this file since 148 was 142, checked in by Silvan Scherrer, 12 years ago

SMPlayer: update trunk to 0.8.5

  • Property svn:eol-style set to LF
File size: 3.3 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
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 "mediadata.h"
20#include <QFileInfo>
21#include <cmath>
22
23
24MediaData::MediaData() {
25 reset();
26}
27
28MediaData::~MediaData() {
29}
30
31void MediaData::reset() {
32 filename="";
33 dvd_id="";
34 type = TYPE_UNKNOWN;
35 duration=0;
36
37 novideo = FALSE;
38
39 video_width=0;
40 video_height=0;
41 video_aspect= (double) 4/3;
42
43#if PROGRAM_SWITCH
44 programs.clear();
45#endif
46 videos.clear();
47 audios.clear();
48 titles.clear();
49
50 subs.clear();
51
52 chapters.clear();
53
54 n_chapters = 0;
55
56 initialized=false;
57
58 // Clip info;
59 clip_name = "";
60 clip_artist = "";
61 clip_author = "";
62 clip_album = "";
63 clip_genre = "";
64 clip_date = "";
65 clip_track = "";
66 clip_copyright = "";
67 clip_comment = "";
68 clip_software = "";
69
70 stream_title = "";
71 stream_url = "";
72
73 // Other data
74 demuxer="";
75 video_format="";
76 audio_format="";
77 video_bitrate=0;
78 video_fps="";
79 audio_bitrate=0;
80 audio_rate=0;
81 audio_nch=0;
82 video_codec="";
83 audio_codec="";
84}
85
86QString MediaData::displayName(bool show_tag) {
87 if (show_tag) {
88 if (!clip_name.isEmpty()) return clip_name;
89 else
90 if (!stream_title.isEmpty()) return stream_title;
91 }
92
93 QFileInfo fi(filename);
94 if (fi.exists())
95 return fi.fileName(); // filename without path
96 else
97 return filename;
98}
99
100
101void MediaData::list() {
102 qDebug("MediaData::list");
103
104 qDebug(" filename: '%s'", filename.toUtf8().data());
105 qDebug(" duration: %f", duration);
106
107 qDebug(" video_width: %d", video_width);
108 qDebug(" video_height: %d", video_height);
109 qDebug(" video_aspect: %f", video_aspect);
110
111 qDebug(" type: %d", type);
112 qDebug(" novideo: %d", novideo);
113 qDebug(" dvd_id: '%s'", dvd_id.toUtf8().data());
114
115 qDebug(" initialized: %d", initialized);
116
117 qDebug(" chapters: %d", n_chapters);
118
119 qDebug(" Subs:");
120 subs.list();
121
122#if PROGRAM_SWITCH
123 qDebug(" Programs:");
124 programs.list();
125#endif
126 qDebug(" Videos:");
127 videos.list();
128
129 qDebug(" Audios:");
130 audios.list();
131
132 qDebug(" Titles:");
133 titles.list();
134
135 //qDebug(" chapters: %d", chapters);
136 //qDebug(" angles: %d", angles);
137
138 qDebug(" demuxer: '%s'", demuxer.toUtf8().data() );
139 qDebug(" video_format: '%s'", video_format.toUtf8().data() );
140 qDebug(" audio_format: '%s'", audio_format.toUtf8().data() );
141 qDebug(" video_bitrate: %d", video_bitrate );
142 qDebug(" video_fps: '%s'", video_fps.toUtf8().data() );
143 qDebug(" audio_bitrate: %d", audio_bitrate );
144 qDebug(" audio_rate: %d", audio_rate );
145 qDebug(" audio_nch: %d", audio_nch );
146 qDebug(" video_codec: '%s'", video_codec.toUtf8().data() );
147 qDebug(" audio_codec: '%s'", audio_codec.toUtf8().data() );
148}
149
Note: See TracBrowser for help on using the repository browser.