aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Ui/skinned/togglebutton.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-01-11 20:09:53 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-01-11 20:09:53 +0000
commit00f49dcfe65115cbd0e4230bbe3c8eebeb294807 (patch)
treea6d1caef94502a58e1df116245a543ca5bb084b9 /src/plugins/Ui/skinned/togglebutton.cpp
parente4c9b8238e081309a3ce4e6a4f2629ee713d87e1 (diff)
downloadqmmp-00f49dcfe65115cbd0e4230bbe3c8eebeb294807.tar.gz
qmmp-00f49dcfe65115cbd0e4230bbe3c8eebeb294807.tar.bz2
qmmp-00f49dcfe65115cbd0e4230bbe3c8eebeb294807.zip
fixed gme plugin linking (#836)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5991 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/skinned/togglebutton.cpp')
0 files changed, 0 insertions, 0 deletions
trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2008-12-06 16:52:27 +0000 fixed build' href='/qmmp/commit/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp?h=main&id=58317ad312eee14fbdcd56fbab0034b3177584e0'>58317ad31
ea7b63826



2f52fee6a
ea7b63826

58317ad31

ea7b63826



2f52fee6a
ea7b63826
2e50594a7

2d622fd9b
e8d99698c
2d622fd9b
2d622fd9b






ae75e5707
2b4c4d7eb


e8d99698c






2d622fd9b

2e50594a7
2d622fd9b
75719b8c8
2d622fd9b

75719b8c8
c6d40b3e6
ae75e5707
2b4c4d7eb
a56b6aaeb
2b4c4d7eb
a56b6aaeb


2b4c4d7eb
75719b8c8
2b4c4d7eb
e8d99698c
2b4c4d7eb
afd64439f
ecc490d2a
afd64439f
e8d99698c
e48a196c8

afd64439f
c6d40b3e6
2d622fd9b

e48a196c8
2d622fd9b
e48a196c8

2d622fd9b

26724c66d
2d622fd9b
e48a196c8
2e50594a7




e48a196c8
5c583bfdd

e48a196c8
5c583bfdd
e48a196c8
2e50594a7
5c583bfdd
26724c66d









e48a196c8
2e50594a7
e48a196c8

2d622fd9b

f904c0005
2d622fd9b


f904c0005
2d622fd9b

e8d99698c




2d622fd9b



e2ea9649d
2d622fd9b
ae5bd442b
e8d99698c






e2ea9649d
2d622fd9b





f0a1d05ed
2d622fd9b




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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
                                                                            
                                                                            

















                                                                             
                
                    
 

          
                                  



                                         
                     

      

                                 



                                       
                    
      

 
                          
                           
                           






                                                                
                                                                 


                                                                       






                                                                       

 
                                                       
 
                 

 
                                                                
 
                                                                 
                        
                                                    
                                  


                       
                                                                       
                                 
                                          
                                          
                                                  
                                  
                                    
                               
                                  

                                  
                      
 

                                                                        
                                                                          
 

                                                         

 
                                                                                                 
 
                           




                           
                                                                          

                                                            
                    
     
                                            
                            
 









                                                                                   
                                               
                            

                 

 
                                                                                


                                                       
             

 




                                                        



                                                                
 
                                                            
                                                                                                         






                                                                                                    
      





                                                                             
                                              




                                                           
/***************************************************************************
 *   Copyright (C) 2008-2009 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.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include <QtGui>
#include <QSettings>

extern "C"
{
#if defined HAVE_FFMPEG_AVFORMAT_H
#include <ffmpeg/avformat.h>
#elif defined HAVE_LIBAVFORMAT_AVFORMAT_H
#include <libavformat/avformat.h>
#else
#include <avformat.h>
#endif


#if defined HAVE_FFMPEG_AVCODEC_H
#include <ffmpeg/avcodec.h>
#elif defined HAVE_LIBAVCODEC_AVCODEC_H
#include <libavcodec/avcodec.h>
#else
#include <avcodec.h>
#endif
}

#include "detailsdialog.h"
#include "settingsdialog.h"
#include "decoder_ffmpeg.h"
#include "decoderffmpegfactory.h"


// DecoderFFmpegFactory

bool DecoderFFmpegFactory::supports(const QString &source) const
{
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    QStringList filters;
    filters << "*.wma" << "*.ape";
    filters = settings.value("FFMPEG/filters", filters).toStringList();
    foreach(QString filter, filters)
    {
        QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard);
        if (regexp.exactMatch(source))
            return TRUE;
    }
    return FALSE;
}

bool DecoderFFmpegFactory::canDecode(QIODevice *) const
{
    return FALSE;
}

const DecoderProperties DecoderFFmpegFactory::properties() const
{
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    QStringList filters;
#if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(44<<8)+0))
    filters << "*.wma" << "*.ape";
#else
    filters << "*.wma";
#endif
    filters = settings.value("FFMPEG/filters", filters).toStringList();
    DecoderProperties properties;
    properties.name = tr("FFmpeg Plugin");
    properties.filter = filters.join(" ");
    properties.description = tr("FFmpeg Formats");
    //properties.contentType = "";
    properties.shortName = "ffmpeg";
    properties.hasAbout = TRUE;
    properties.hasSettings = TRUE;
    properties.noInput = TRUE;
    properties.protocols = "file";
    return properties;
}

Decoder *DecoderFFmpegFactory::create(QObject *parent, QIODevice *input,
                                      Output *output, const QString &path)
{
    Q_UNUSED(input);
    return new DecoderFFmpeg(parent, this, output, path);
}

QList<FileInfo *> DecoderFFmpegFactory::createPlayList(const QString &fileName, bool useMetaData)
{
    QList <FileInfo*> list;
    avcodec_init();
    avcodec_register_all();
    av_register_all();
    AVFormatContext *in;

    if (av_open_input_file(&in, fileName.toLocal8Bit(), NULL,0, NULL) < 0)
    {
        qDebug("DecoderFFmpegFactory: unable to open file");
        return list;
    }
    FileInfo *info = new FileInfo(fileName);
    av_find_stream_info(in);

    if (useMetaData)
    {
        info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(in->album).trimmed());
        info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(in->author).trimmed());
        info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(in->comment).trimmed());
        info->setMetaData(Qmmp::GENRE, QString::fromUtf8(in->genre).trimmed());
        info->setMetaData(Qmmp::TITLE, QString::fromUtf8(in->title).trimmed());
        info->setMetaData(Qmmp::YEAR, in->year);
        info->setMetaData(Qmmp::TRACK, in->track);
    }
    info->setLength(in->duration/AV_TIME_BASE);
    av_close_input_file(in);
    list << info;
    return list;
}

QObject* DecoderFFmpegFactory::showDetails(QWidget *parent, const QString &path)
{
    DetailsDialog *d = new DetailsDialog(parent, path);
    d -> show();
    return d;
}

void DecoderFFmpegFactory::showSettings(QWidget *parent)
{
    SettingsDialog *s = new SettingsDialog(parent);
    s->show();
}

void DecoderFFmpegFactory::showAbout(QWidget *parent)
{
    QMessageBox::about (parent, tr("About FFmpeg Audio Plugin"),

                        tr("Qmmp FFmpeg Audio Plugin")+"\n"+
#if (LIBAVFORMAT_VERSION_INT >= ((52<<16)+(17<<8)+0)) && (LIBAVCODEC_VERSION_INT >= ((51<<16)+(60<<8)+0))
                        QString(tr("Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6"))
                        .arg(LIBAVFORMAT_VERSION_MAJOR)
                        .arg(LIBAVFORMAT_VERSION_MINOR)
                        .arg(LIBAVFORMAT_VERSION_MICRO)
                        .arg(LIBAVCODEC_VERSION_MAJOR)
                        .arg(LIBAVCODEC_VERSION_MINOR)
                        .arg(LIBAVCODEC_VERSION_MICRO)+"\n"+
#endif
                        tr("Writen by: Ilya Kotov <forkotov02@hotmail.ru>"));
}

QTranslator *DecoderFFmpegFactory::createTranslator(QObject *parent)
{
    QTranslator *translator = new QTranslator(parent);
    QString locale = Qmmp::systemLanguageID();
    translator->load(QString(":/ffmpeg_plugin_") + locale);
    return translator;
}

Q_EXPORT_PLUGIN(DecoderFFmpegFactory)