aboutsummaryrefslogblamecommitdiff
path: root/src/plugins/Input/cdaudio/decodercdaudiofactory.h
blob: 1227dfb377a5ff8741dc2cf93d0f7d7decb5477b (plain) (tree)
1
2
                                                                            
                                                                            














                                                                            
                                                                            







                                                                             




                                


                                                            
                                



                                               
                                                  
                                                                                          
                                                                                 





                                                   
/***************************************************************************
 *   Copyright (C) 2009-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.         *
 ***************************************************************************/
#ifndef DECODERCDAUDIOFACTORY_H
#define DECODERCDAUDIOFACTORY_H

#include <QObject>
#include <QString>
#include <QIODevice>
#include <QWidget>
#include <qmmp/decoder.h>
#include <qmmp/output.h>
#include <qmmp/decoderfactory.h>
#include <qmmp/fileinfo.h>

class DecoderCDAudioFactory : public QObject, DecoderFactory
{
    Q_OBJECT
    Q_INTERFACES(DecoderFactory)
public:
    bool supports(const QString &source) const;
    bool canDecode(QIODevice *input) const;
    const DecoderProperties properties() const;
    Decoder *create(const QString &, QIODevice *);
    QList<FileInfo *> createPlayList(const QString &url, bool useMetaData, QStringList *);
    MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0);
    void showSettings(QWidget *parent);
    void showAbout(QWidget *parent);
    QTranslator *createTranslator(QObject *parent);
};

#endif
="hl kwc">QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) { pItem->setFlags(0); } } else { pItem->setCheckState(Qt::Unchecked); } } } } int WinFileAssocPage::ProcessAssociations(QStringList& current, QStringList& old) { WinFileAssoc RegAssoc; QStringList toRestore; //Restore unselected associations foreach(const QString& ext, old) { if (!current.contains(ext)) toRestore.append(ext); } RegAssoc.RestoreFileAssociations(toRestore); return RegAssoc.CreateFileAssociations(current); } void WinFileAssocPage::saveAssociations() { QStringList extensions; for (int k = 0; k < m_ui->listWidget->count(); k++) { QListWidgetItem* pItem = m_ui->listWidget->item(k); if (pItem && pItem->checkState() == Qt::Checked) extensions.append(pItem->text()); } if(extensions == m_regExtensions) return; int processed = ProcessAssociations(extensions, m_regExtensions); if (processed != extensions.count()) { QMessageBox::warning(this, tr("Warning"), tr("Not all files could be associated. Please check your " "security permissions and retry."), QMessageBox::Ok); } } void WinFileAssocPage::createHelp() { m_ui->selectAll->setToolTip(tr("Check all file types in the list")); m_ui->selectNone->setToolTip(tr("Uncheck all file types in the list")); m_ui->listWidget->setToolTip(tr("Check the media file extensions you would like Qmmp to handle. " "When you click Apply, the checked files will be associated with " "Qmmp. If you uncheck a media type, the file association will " "be restored.") + "<br>" + tr("<b>Note:</b> Restoration doesn't work on Windows Vista/7.")); }