aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Output/null/translations/null_plugin_he.ts
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-03-01 11:15:57 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-03-01 11:15:57 +0000
commit50aa40ece52716e14363fc094701b7a167c50f44 (patch)
tree2194454606bf3234249d0b426c59e2bc19015971 /src/plugins/Output/null/translations/null_plugin_he.ts
parent377b65cc75cf9116ecd665bca905cb828be3d727 (diff)
downloadqmmp-50aa40ece52716e14363fc094701b7a167c50f44.tar.gz
qmmp-50aa40ece52716e14363fc094701b7a167c50f44.tar.bz2
qmmp-50aa40ece52716e14363fc094701b7a167c50f44.zip
removed useless code
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6142 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Output/null/translations/null_plugin_he.ts')
0 files changed, 0 insertions, 0 deletions
id='n136' href='#n136'>136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
/***************************************************************************
 *   Copyright (C) 2008-2015 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/

#include <QApplication>
#include <qmmp/metadatamanager.h>
#include "qmmpuisettings.h"
#include "playlisttrack.h"

PlayListTrack::PlayListTrack() : QMap<Qmmp::MetaData, QString>(), PlayListItem()
{
    m_settings = QmmpUiSettings::instance();
    m_columnManager = m_settings->headerModel();
    m_length = 0;
    m_refCount = 0;
    m_sheduledForDeletion = false;
}

PlayListTrack::PlayListTrack(const PlayListTrack &other) : QMap<Qmmp::MetaData, QString>(other),
    PlayListItem()
{
    m_settings = QmmpUiSettings::instance();
    m_columnManager = m_settings->headerModel();
    m_refCount = 0;
    m_sheduledForDeletion = false;

    m_formattedTitles = other.m_formattedTitles;
    m_group = other.m_group;
    m_formattedLength = other.m_formattedLength;
    m_titleFormats = other.m_titleFormats;
    m_groupFormat = other.m_groupFormat;
    setSelected(other.isSelected());
    m_length = other.m_length;
    m_formattedLength = other.m_formattedLength;
}

PlayListTrack::PlayListTrack(FileInfo *info) :  QMap<Qmmp::MetaData, QString>(info->metaData()),
    PlayListItem()
{
    m_settings = QmmpUiSettings::instance();
    m_columnManager = m_settings->headerModel();
    setLength(m_length = info->length());
    insert(Qmmp::URL, info->path());
    m_refCount = 0;
    m_sheduledForDeletion = false;
}

PlayListTrack::~PlayListTrack()
{
    if(m_refCount != 0)
        qWarning("PlayListTrack: deleting busy track");
}

void PlayListTrack::updateMetaData(const QMap <Qmmp::MetaData, QString> &metaData)
{
    QMap <Qmmp::MetaData, QString>::operator =(metaData);
    m_formattedTitles.clear();
    formatGroup();
}

void PlayListTrack::updateMetaData()
{
    QList <FileInfo *> list =  MetaDataManager::instance()->createPlayList(value(Qmmp::URL));
    if(!list.isEmpty() && !list.at(0)->path().contains("://"))
    {
        FileInfo *info = list.at(0);
        m_length = info->length();
        QMap <Qmmp::MetaData, QString>::operator =(info->metaData());
        insert(Qmmp::URL, info->path());
        m_formattedTitles.clear();
        formatGroup();
    }
    qDeleteAll(list);
}

const QString PlayListTrack::groupName()
{
    if(m_group.isEmpty() || m_groupFormat != m_settings->groupFormat())
    {
        m_groupFormat = m_settings->groupFormat();
        formatGroup();
    }
    return m_group;
}

bool PlayListTrack::isGroup() const
{
    return false;
}

void PlayListTrack::beginUsage()
{
    m_refCount++;
}

void PlayListTrack::endUsage()
{
    m_refCount--;
}

void PlayListTrack::deleteLater()
{
    m_sheduledForDeletion = true;
}

bool PlayListTrack::isSheduledForDeletion() const
{
    return m_sheduledForDeletion;
}

bool PlayListTrack::isUsed() const
{
    return (m_refCount != 0);
}

const QString PlayListTrack::formattedTitle(int column)
{
    if(m_formattedTitles.count() != m_settings->headerModel()->count())
    {
        while(m_formattedTitles.count() > m_columnManager->count())
            m_formattedTitles.takeLast();

        while(m_formattedTitles.count() < m_columnManager->count())
            m_formattedTitles.append(QString());

        while(m_titleFormats.count() > m_columnManager->count())
            m_titleFormats.takeLast();

        while(m_titleFormats.count() < m_columnManager->count())
            m_titleFormats.append(QString());
    }

    if(column < 0 || column >= m_formattedTitles.size())
    {
        qWarning("PlayListTrack: column number is out of range");
        return QString();
    }

    if(m_formattedTitles[column].isEmpty() || m_titleFormats[column] != m_columnManager->pattern(column))
    {
        m_titleFormats[column] = m_settings->headerModel()->pattern(column);
        formatTitle(column);
    }
    return m_formattedTitles[column];
}

const QStringList PlayListTrack::formattedTitles()
{
    if(m_formattedTitles.count() != m_settings->headerModel()->count())
    {
        while(m_formattedTitles.count() > m_columnManager->count())
            m_formattedTitles.takeLast();

        while(m_formattedTitles.count() < m_columnManager->count())
            m_formattedTitles.append(QString());

        while(m_titleFormats.count() > m_columnManager->count())
            m_titleFormats.takeLast();

        while(m_titleFormats.count() < m_columnManager->count())
            m_titleFormats.append(QString());
    }

    for(int column = 0; column < m_columnManager->count(); column++)
    {