1
/* smplayer, GUI front-end for mplayer.
2
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
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.
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.
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
19
#include "trackdata.h"
23
TrackData::TrackData() {
33
TrackData::~TrackData() {
36
QString TrackData::displayName() const {
37
//qDebug("TrackData::displayName");
41
if (!_name.isEmpty()) {
43
if (!_lang.isEmpty()) {
44
dname += " ["+ _lang + "]";
48
if (!_lang.isEmpty()) {
52
if (!_filename.isEmpty()) {
53
QFileInfo f(_filename);
57
dname = QString::number(_ID);
60
dname += " ("+ Helper::formatTime( (int) _duration ) +")";
66
#ifndef NO_USE_INI_FILES
67
void TrackData::save(QSettings & set) {
68
//qDebug("TrackData::save");
70
set.setValue( "lang", _lang );
71
set.setValue( "name", _name );
72
set.setValue( "filename", _filename );
73
set.setValue( "duration", _duration );
74
set.setValue( "chapters", _chapters );
75
set.setValue( "angles", _angles );
76
set.setValue( "ID", _ID );
79
void TrackData::load(QSettings & set) {
80
//qDebug("TrackData::load");
82
_lang = set.value( "lang", _lang ).toString();
83
_name = set.value( "name", _name ).toString();
84
_filename = set.value( "filename", _filename ).toString();
85
_duration = set.value( "duration", _duration).toDouble();
86
_chapters = set.value( "chapters", _chapters ).toInt();
87
_angles = set.value( "angles", _angles ).toInt();
88
_ID = set.value( "ID", _ID ).toInt();
91
#endif // NO_USE_INI_FILES
93
void TrackData::list() {
94
//qDebug("TrackData::list");
96
qDebug(" ID: '%d' lang: '%s' name: '%s'", _ID, _lang.toUtf8().data(), _name.toUtf8().data() );
97
qDebug(" filename: '%s' duration: %f chapters: %d angles: %d",
98
_filename.toUtf8().data(), _duration, _chapters, _angles );