~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/corelib/mediadata.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-03-31 23:05:43 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090331230543-0h2hfwpwlu9opbv2
* New upstream release. (Closes: #523791)
  - Reworked subtitle font preferences. (Closes: #503295)
  - No longer installs qt_fr.qm. (Closes: #486314)
* debian/control:
  - Bumped Standards-Version to 3.8.1.
  - Changed maintainer name (still the same person and GPG key).
  - Changed section to video.
  - Build-depend on zlib1g-dev for findsubtitles.
  - Require Qt >= 4.3 per readme.
  - Added ${misc:Depends}.
  - Make smplayer-translations depend on smplayer and smplayer recommend
    smplayer-translations, not the other way round. (Closes: #489375)
* debian/copyright:
  - Significantly expanded per-file with new upstream authors.
* debian/rules:
  - Make make use correct uic in install.
  - Clean svn_revision.
  - Removed get-orig-source - not needed with uscan --repack.
* debian/patches/01_gl_translation.patch:
  - Added patch to fix lrelease error on smplayer_gl.ts.
* Added debian/README.source for simple-patchsys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  smplayer, GUI front-end for mplayer.
2
 
    Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
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
 
 
24
 
MediaData::MediaData() {
25
 
        reset();
26
 
}
27
 
 
28
 
MediaData::~MediaData() {
29
 
}
30
 
 
31
 
void 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
 
        audios.clear();
44
 
        titles.clear();
45
 
 
46
 
        subs.clear();
47
 
 
48
 
        //chapters=0;
49
 
        //angles=0;
50
 
 
51
 
        mkv_chapters=0;
52
 
 
53
 
        initialized=false;
54
 
 
55
 
        // Clip info;
56
 
        clip_name = "";
57
 
    clip_artist = "";
58
 
    clip_author = "";
59
 
    clip_album = "";
60
 
    clip_genre = "";
61
 
    clip_date = "";
62
 
    clip_track = "";
63
 
    clip_copyright = "";
64
 
    clip_comment = "";
65
 
    clip_software = "";
66
 
 
67
 
        stream_title = "";
68
 
        stream_url = "";
69
 
 
70
 
        // Other data
71
 
        demuxer="";
72
 
        video_format="";
73
 
        audio_format="";
74
 
        video_bitrate=0;
75
 
        video_fps="";
76
 
        audio_bitrate=0;
77
 
        audio_rate=0;
78
 
        audio_nch=0;
79
 
        video_codec="";
80
 
        audio_codec="";
81
 
}
82
 
 
83
 
QString MediaData::displayName() {
84
 
        if (!clip_name.isEmpty()) return clip_name;
85
 
        else
86
 
        if (!stream_title.isEmpty()) return stream_title;
87
 
 
88
 
        QFileInfo fi(filename);
89
 
        if (fi.exists()) 
90
 
                return fi.fileName(); // filename without path
91
 
        else
92
 
                return filename;
93
 
}
94
 
 
95
 
 
96
 
void MediaData::list() {
97
 
        qDebug("MediaData::list");
98
 
 
99
 
        qDebug("  filename: '%s'", filename.toUtf8().data());
100
 
        qDebug("  duration: %f", duration);
101
 
 
102
 
        qDebug("  video_width: %d", video_width); 
103
 
        qDebug("  video_height: %d", video_height); 
104
 
        qDebug("  video_aspect: %f", video_aspect); 
105
 
 
106
 
        qDebug("  type: %d", type);
107
 
        qDebug("  novideo: %d", novideo);
108
 
        qDebug("  dvd_id: '%s'", dvd_id.toUtf8().data());
109
 
 
110
 
        qDebug("  initialized: %d", initialized);
111
 
 
112
 
        qDebug("  mkv_chapters: %d", mkv_chapters);
113
 
 
114
 
        qDebug("  Subs:");
115
 
        subs.list();
116
 
 
117
 
        qDebug("  Audios:");
118
 
        audios.list();
119
 
 
120
 
        qDebug("  Titles:");
121
 
        titles.list();
122
 
 
123
 
        //qDebug("  chapters: %d", chapters);
124
 
        //qDebug("  angles: %d", angles);
125
 
 
126
 
        qDebug("  demuxer: '%s'", demuxer.toUtf8().data() );
127
 
        qDebug("  video_format: '%s'", video_format.toUtf8().data() );
128
 
        qDebug("  audio_format: '%s'", audio_format.toUtf8().data() );
129
 
        qDebug("  video_bitrate: %d", video_bitrate );
130
 
        qDebug("  video_fps: '%s'", video_fps.toUtf8().data() );
131
 
        qDebug("  audio_bitrate: %d", audio_bitrate );
132
 
        qDebug("  audio_rate: %d", audio_rate );
133
 
        qDebug("  audio_nch: %d", audio_nch );
134
 
        qDebug("  video_codec: '%s'", video_codec.toUtf8().data() );
135
 
        qDebug("  audio_codec: '%s'", audio_codec.toUtf8().data() );
136
 
}
137