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
29
void Tracks::clear() {
33
void Tracks::addLang(int ID, QString lang) {
38
void Tracks::addName(int ID, QString name) {
43
void Tracks::addID(int ID) {
48
int Tracks::numItems() {
52
bool Tracks::existsItemAt(int n) {
53
return ((n > 0) && (n < numItems()));
56
TrackData Tracks::itemAt(int n) {
57
return tm.values()[n];
60
TrackData Tracks::item(int ID) {
64
int Tracks::find(int ID) {
65
for (int n=0; n < numItems(); n++) {
66
if (itemAt(n).ID() == ID) return n;
71
int Tracks::findLang(QString expr) {
72
qDebug( "Tracks::findLang: '%s'", expr.toUtf8().data());
77
for (int n=0; n < numItems(); n++) {
78
qDebug("Tracks::findLang: lang #%d '%s'", n, itemAt(n).lang().toUtf8().data());
79
if (rx.indexIn( itemAt(n).lang() ) > -1) {
80
qDebug("Tracks::findLang: found preferred lang!");
81
res_id = itemAt(n).ID();
90
QMapIterator<int, TrackData> i(tm);
93
TrackData d = i.value();
94
qDebug("Tracks::list: item %d: ID: %d lang: '%s' name: '%s'",
95
i.key(), d.ID(), d.lang().toUtf8().constData(), d.name().toUtf8().constData() );