aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/modplug/settingsdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* reapplied previous patchtrialuser022010-03-111-5/+5
| | | | 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-23/+23
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1619 90c681e8-e032-0410-971d-27865f9a5e38
* enabled modplug supporttrialuser022009-09-291-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1268 90c681e8-e032-0410-971d-27865f9a5e38
* global config file pathtrialuser022008-12-241-2/+2
| | | | 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-9/+17
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@690 90c681e8-e032-0410-971d-27865f9a5e38
* added modplug plugintrialuser022008-04-211-0/+186
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@348 90c681e8-e032-0410-971d-27865f9a5e38
ocumentation, fixed other documentation' href='/qmmp/commit/src/qmmp/statehandler.h?id=683a9a9f7fabd23ed9caf7ab18cb90dacb51da2d'>683a9a9f7
683a9a9f7




e6c43e75f
683a9a9f7


e6c43e75f




683a9a9f7


e6c43e75f
b89c60239

196ec0a9a
b89c60239
e6c43e75f
683a9a9f7


0e860ae0b
683a9a9f7


0e860ae0b
683a9a9f7


0e860ae0b
683a9a9f7


c04f69b6a
683a9a9f7


0e860ae0b
683a9a9f7




e6c43e75f
1da8e3fad

e6c43e75f


cd09ad84c
1da8e3fad
683a9a9f7
0e860ae0b



683a9a9f7



0e860ae0b
683a9a9f7



0e860ae0b
683a9a9f7



a915b21a9
683a9a9f7

c04f69b6a
683a9a9f7
c04f69b6a
683a9a9f7



0e860ae0b
b89c60239




0e860ae0b
cd09ad84c
0e860ae0b
76095a463
a915b21a9
40ee4f96d
a915b21a9
0e860ae0b
76095a463
e6c43e75f
0e860ae0b

0e860ae0b


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
                                                                            
                                                                            














                                                                            
                                                                            





                                                                             
                
                 
                           

                 


                                                                                      



                                   



                                   
                                      


                  
                    


                                                     




                                                   
                                                                                               


                                 




                                                                 


                            
                                     

                                
                                                                              
       
                                     


                                                  
                     


                                        
                  


                                           
                    


                                     
                     


                               
                   




                                 
                                

                                


                                     
                        
       
                                                                    



                                    



                                                      
                                     



                                           
                                     



                                               
                                             

                                            
                                            
       
                                     



                                                
                                       




                                                                                        
 
 
        
                     
                        
                             
                                           
                                    
                                              
                                          

                        


      
/***************************************************************************
 *   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.         *
 ***************************************************************************/
#ifndef STATEHANDLER_H
#define STATEHANDLER_H

#include <QObject>
#include <QMap>
#include <QHash>
#include <QMutex>
#include "abstractengine.h"
#include "qmmp.h"

/*! @brief The StateHandler class allows to track information about playback progress.
 * @author Ilya Kotov <forkotov02@hotmail.ru>
 */
class StateHandler : public QObject
{
    Q_OBJECT
public:
    /*!
     * Object constructor.
     * @param parent Parent object.
     */
    StateHandler(QObject *parent = 0);
    /*!
     * Destructor.
     */
    ~StateHandler();
    /*!
     * Sends information about playback progress.
     * @param elapsed Current time (in milliseconds).
     * @param bitrate Current bitrate (in kbps).
     * @param frequency Current samplerate (in Hz).
     * @param precision Sample size (in bits).
     * @param channels Number of channels.
     */
    void dispatch(qint64 elapsed, int bitrate, quint32 frequency, int precision, int channels);
    /*!
     * Sends metadata \b metaData
     */
    void dispatch(const QMap<Qmmp::MetaData, QString> &metaData);
    /*!
     * Sends stream information \b info
     */
    void dispatch(const QHash<QString, QString> &info);
    /*!
     * Sends playback state.
     */
    void dispatch(Qmmp::State state);
    /*!
     * Sends buffering progress.
     * @param percent Indicates the current percentage of buffering completed.
     */
    void dispatchBuffer(int percent);
    /*!
     * Returns the current time (in milliseconds).
     */
    qint64 elapsed();
    /*!
     * Returns current bitrate (in kbps)
     */
    int bitrate();
    /*!
     * Returns current sample rate (in Hz).
     */
    int frequency();
    /*!
     * Returns sample size (in bits).
     */
    int sampleSize();
    /*!
     * Returns channels number.
     */
    int channels();
    /*!
     * Returns the current state.
     */
    Qmmp::State state() const;
    /*!
     * Sends next track request.
     */
    void sendNextTrackRequest();
    /*!
     * Sends playback finished event.
     */
    void sendFinished();
    /*!
     * Returns a pointer to the first created StateHandler instance.
     */
    static StateHandler* instance();

signals:
    /*!
     * Tracks elapesed time.
     * @param time New track position in milliseconds.
     */
    void elapsedChanged(qint64 time);
    /*!
     * Emitted when bitrate has changed.
     * @param bitrate New bitrate (in kbps)
     */
    void bitrateChanged(int bitrate);
    /*!
     * Emitted when samplerate has changed.
     * @param frequency New sample rate (in Hz)
     */
    void frequencyChanged(quint32 frequency);
    /*!
     * Emitted when sample size has changed.
     * @param size New sample size (in bits)
     */
    void sampleSizeChanged(int size);
    /*!
     * Emitted when channels number has changed.
     * @param channels New channels number.
     */
    void channelsChanged(int channels);
     /*!
     * This signal is emitted when the stream reader fills it's buffer.
     * The argument \b progress indicates the current percentage of buffering completed.
     */
    void bufferingProgress(int progress);


private:
    qint64 m_elapsed;
    quint32 m_frequency;
    bool m_sendAboutToFinish;
    int m_bitrate, m_precision, m_channels;
    static StateHandler* m_instance;
    QMap <Qmmp::MetaData, QString> m_metaData;
    QHash <QString, QString> m_streamInfo;
    Qmmp::State m_state;
    QMutex m_mutex;
};

#endif