aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Output/alsa/settingsdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* removed trailing whitespacestrialuser022015-07-261-1/+0
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5272 90c681e8-e032-0410-971d-27865f9a5e38
* fixed FSF headerstrialuser022012-07-311-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2845 90c681e8-e032-0410-971d-27865f9a5e38
* fixed FSF address (trunk)trialuser022012-07-311-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2844 90c681e8-e032-0410-971d-27865f9a5e38
* updated copyrightstrialuser022012-01-231-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2563 90c681e8-e032-0410-971d-27865f9a5e38
* fixed alsa plugin settingstrialuser022010-07-211-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1799 90c681e8-e032-0410-971d-27865f9a5e38
* reapplied previous patchtrialuser022010-03-111-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1620 90c681e8-e032-0410-971d-27865f9a5e38
* removed obsolete memberstrialuser022010-03-111-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1619 90c681e8-e032-0410-971d-27865f9a5e38
* fixed problems with alsa < 1.22.00trialuser022010-01-231-4/+6
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1526 90c681e8-e032-0410-971d-27865f9a5e38
* alsa plugin: show more devicestrialuser022009-10-281-0/+33
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1336 90c681e8-e032-0410-971d-27865f9a5e38
* added possibility to disable snd_pcm_pause functiontrialuser022009-09-301-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1275 90c681e8-e032-0410-971d-27865f9a5e38
* fixed buildtrialuser022009-05-141-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@948 90c681e8-e032-0410-971d-27865f9a5e38
* global config file pathtrialuser022008-12-241-3/+4
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@702 90c681e8-e032-0410-971d-27865f9a5e38
* using standard dialog buttonstrialuser022008-12-171-3/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@690 90c681e8-e032-0410-971d-27865f9a5e38
* alsa plugin: mmap access supporttrialuser022008-06-251-0/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@431 90c681e8-e032-0410-971d-27865f9a5e38
* ALSA plugin: fixed crashtrialuser022008-05-191-3/+6
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@376 90c681e8-e032-0410-971d-27865f9a5e38
* new directory structurevovanec2008-02-071-0/+237
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@232 90c681e8-e032-0410-971d-27865f9a5e38
t;trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2010-08-01 10:51:41 +0000 committer trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2010-08-01 10:51:41 +0000 prepare for midi support' href='/qmmp/commit/src/plugins/Input/wildmidi/decoderwildmidifactory.cpp?h=main&id=1688bbd83a15dabf274f1613fc981a964acf6bb8'>1688bbd83
c878d3ca5

1688bbd83


c878d3ca5




1688bbd83

c878d3ca5



7d2e0f57b
c878d3ca5
1688bbd83







b5b647a2e
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
                                                                            
                                                                            














                                                                            
                                                                            





                                                                             
                           

                                   



                                                                  




                                                         
                 





                                                                  
                                  

                                              



                                      
                                   
                                             










                                                                                                   
                          


                                            
                                                                                            



                                                                
                                                         
                                                           

                                                                        
                                     
                                                            







                                                                                                

                     


             




                                                          

                                                       



                                                                                        
                                                                              
 







                                                                      
                                                 
/***************************************************************************
 *   Copyright (C) 2008-2012 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 <QtGui>

#include "wildmidihelper.h"
#include "decoder_wildmidi.h"
#include "settingsdialog.h"
#include "decoderwildmidifactory.h"

// DecoderWildMidiFactory

bool DecoderWildMidiFactory::supports(const QString &source) const
{
    return (source.right(4).toLower() == ".mid");
}

bool DecoderWildMidiFactory::canDecode(QIODevice *) const
{
    return false;
}

const DecoderProperties DecoderWildMidiFactory::properties() const
{
    DecoderProperties properties;
    properties.name = tr("WildMidi Plugin");
    properties.filters << "*.mid";
    properties.description = tr("Midi Files");
    //properties.contentType = ;
    properties.shortName = "wildmidi";
    properties.hasAbout = true;
    properties.hasSettings = true;
    properties.noInput = true;
    properties.protocols << "file";
    WildMidiHelper::instance()->initialize();
    return properties;
}

Decoder *DecoderWildMidiFactory::create(const QString &path, QIODevice *input)
{
    Q_UNUSED(input);
    return new DecoderWildMidi(path);
}

QList<FileInfo *> DecoderWildMidiFactory::createPlayList(const QString &fileName, bool useMetaData)
{
    Q_UNUSED(useMetaData);
    QList <FileInfo*> list;
    FileInfo *info = new FileInfo(fileName);

    if(WildMidiHelper::instance()->initialize() && WildMidiHelper::instance()->sampleRate())
    {
        void *midi_ptr = WildMidi_Open (fileName.toLocal8Bit());
        if(midi_ptr)
        {
            WildMidiHelper::instance()->addPtr(midi_ptr);
            _WM_Info *wm_info = WildMidi_GetInfo(midi_ptr);
            info->setLength((qint64)wm_info->approx_total_samples
                            / WildMidiHelper::instance()->sampleRate());
            WildMidi_Close(midi_ptr);
            WildMidiHelper::instance()->removePtr(midi_ptr);
        }
    }
    list << info;
    return list;
}

MetaDataModel* DecoderWildMidiFactory::createMetaDataModel(const QString &path, QObject *parent)
{
    Q_UNUSED(path);
    Q_UNUSED(parent);
    return 0;
}

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

void DecoderWildMidiFactory::showAbout(QWidget *parent)
{
    QMessageBox::about (parent, tr("About WildMidi Audio Plugin"),
                        tr("Qmmp WildMidi Audio Plugin")+"\n"+
                        tr("This plugin uses WildMidi library to play midi files")+"\n"+
                        tr("Written by: Ilya Kotov <forkotov02@hotmail.ru>"));
}

QTranslator *DecoderWildMidiFactory::createTranslator(QObject *parent)
{
    QTranslator *translator = new QTranslator(parent);
    QString locale = QLocale::system().name();
    translator->load(QString(":/wildmidi_plugin_") + locale);
    return translator;
}
Q_EXPORT_PLUGIN2(wildmidi,DecoderWildMidiFactory)