aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/sndfile
ModeNameSize
-rw-r--r--CMakeLists.txt1532logplainblame
-rw-r--r--decoder_sndfile.cpp3134logplainblame
-rw-r--r--decoder_sndfile.h2069logplainblame
-rw-r--r--decodersndfilefactory.cpp5306logplainblame
-rw-r--r--decodersndfilefactory.h2355logplainblame
-rw-r--r--sndfile.pro1094logplainblame
d---------translations533logplain
ommit/src/titlebar.cpp?id=5e26d3a305b8e2c193ef04681c3c00937505ce53'>5e26d3a30
1abba7732
97adebbb8
2d622fd9b
26da2f9c1
97adebbb8
2d622fd9b
97adebbb8
2d622fd9b
11b7655bb
ecc137abe
1e7a7fdfd
97c98d9d5
11b7655bb
97c98d9d5
5e26d3a30
97c98d9d5

2d622fd9b
26da2f9c1
1e7a7fdfd

26da2f9c1
1e7a7fdfd
26da2f9c1
5e26d3a30
26da2f9c1
2972e8742
11b7655bb
1e7a7fdfd
ae75e5707
fa1e4194b
5e26d3a30
013ee07b5
26da2f9c1
97c98d9d5
97adebbb8
2d622fd9b

2d622fd9b
5e26d3a30
ae75e5707
fa1e4194b
5e26d3a30
2d622fd9b
97c98d9d5
















2d622fd9b

5e26d3a30


5e26d3a30
97c98d9d5
0c29a6aee
5e26d3a30
5e26d3a30
5e26d3a30

2d622fd9b



97c98d9d5
2d622fd9b


97c98d9d5
8a8a45ea2

97c98d9d5
8a8a45ea2
2d622fd9b



5e26d3a30
2d622fd9b
5e26d3a30
5e26d3a30
5e26d3a30
5e26d3a30
2d622fd9b


5e26d3a30
5e26d3a30
5e26d3a30
5e26d3a30
2d622fd9b




11b7655bb
26da2f9c1
97c98d9d5
2d622fd9b
080507d3a


1e7a7fdfd
080507d3a
5e26d3a30



97c98d9d5
5e26d3a30

5e26d3a30

26da2f9c1
5e26d3a30


5e26d3a30
97adebbb8
5e26d3a30
5e26d3a30
97c98d9d5




1484a13bf
5e26d3a30
3ffc8b54a
5e26d3a30
5e26d3a30


5e26d3a30
b5833f942


3ffc8b54a
b5833f942
5e26d3a30

97c98d9d5

5e26d3a30

97c98d9d5
4ccbc35ad
97c98d9d5
97adebbb8
97c98d9d5
5e26d3a30

390f66a39
c4c36008b



2702b572b
5e26d3a30
97adebbb8




5e26d3a30


2702b572b

5e26d3a30
2702b572b

5e26d3a30
97adebbb8
5e26d3a30

97adebbb8
5e26d3a30


97adebbb8






5e26d3a30
97adebbb8
0e860ae0b
97adebbb8


5e26d3a30
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
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
                                                                            
                                                                            














                                                                            
                                                                            





                                                                             
                    
 
                          


                   

                            
                    
                     
                       
                          
 
                                   
                                                              
                              
                        
 
                    
                              
                                                     
                                                       
                     
                 
                      

                  
             
                                                                                  

                                                                
                                                                                         
                                                                        
                                                                                     
                                                       
                                                                                  
                                                             
                     
                                                                     
                                                                 
                                                              
                
                   
                                                     
                      
                                                                      

 
                     
 
                                                                 
                                                       
 
 
















                                        

                                                  


                                   
                             
                                               
                                       
              
                         

                                               



                                              
                                   


                                                 
                                                   

                                                 
                                           
     



                                
          
     
                     
                                                                    
            
                                                             


        
                     
                                                                    
            
                                                             




                           
                     
                                                     
                      
 


                             
                                                           
 



                         
                            

                 

                                                                
                                                                                             


                                                            
                              
                                                                                          
                                              
                          




                                                                                 
                                                                               
                                          
                              
                         


        
                                                         


                                     
                                 
                                

                          

                      

                        
                                                                     
                
                                                               
                     
                      

 
                                                    



                         
                                      
 




                      


                           

                                                    
 

                                                
 
                                                               

 
                               


                       






                                        
                                        
     
        


                                                                   
 
/***************************************************************************
 *   Copyright (C) 2007-2016 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 <QMainWindow>
#include <QApplication>
#include <QMouseEvent>
#include <QMenu>
#include <QSettings>

#include "symboldisplay.h"
#include "skin.h"
#include "button.h"
#include "dock.h"
#include "titlebarcontrol.h"
#include "shadedvisual.h"
#include "display.h"
#include "titlebar.h"
#include "mainwindow.h"
#include "timeindicator.h"

// TODO skin cursor with shade mode
TitleBar::TitleBar(TimeIndicatorModel *model, QWidget *parent)
        : PixmapWidget(parent)
        , m_model(model)
{
    m_align = false;
    m_skin = Skin::instance();
    setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A));
    m_mw = qobject_cast<MainWindow*>(parent->parent());
    m_shaded = false;
    m_shade2 = 0;
    m_currentTime = 0;
    m_control = 0;
    m_visual = 0;
    //buttons
    m_menu = new Button(this,Skin::BT_MENU_N,Skin::BT_MENU_P, Skin::CUR_MAINMENU);
    connect(m_menu,SIGNAL(clicked()),this,SLOT(showMainMenu()));
    m_menu->move(6,3);
    m_minimize = new Button(this,Skin::BT_MINIMIZE_N,Skin::BT_MINIMIZE_P, Skin::CUR_MIN);
    connect(m_minimize, SIGNAL(clicked()), m_mw, SLOT(showMinimized()));
    m_shade = new Button(this,Skin::BT_SHADE1_N,Skin::BT_SHADE1_P, Skin::CUR_WINBUT);
    connect(m_shade, SIGNAL(clicked()), SLOT(shade()));
    m_close = new Button(this,Skin::BT_CLOSE_N,Skin::BT_CLOSE_P, Skin::CUR_CLOSE);
    connect(m_close, SIGNAL(clicked()), m_mw, SLOT(close()));
    setActive(false);
    connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin()));
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    if (settings.value("Skinned/disp_shaded", false).toBool())
        shade();
    m_align = true;
    setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR));
    updatePositions();
    connect(m_model, SIGNAL(changed()), this, SLOT(onModelChanged()));
}

TitleBar::~TitleBar()
{
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    settings.setValue("Skinned/disp_shaded", m_shaded);
}

void TitleBar::updatePositions()
{
    int r = m_skin->ratio();
    m_menu->move(r*6, r*3);
    m_minimize->move(r*244, r*3);
    m_shade->move(r*254, r*3);
    m_close->move(r*264, r*3);
    if(m_shade2)
        m_shade2->move(r*254, r*3);
    if(m_currentTime)
        m_currentTime->move(r*127, r*4);
    if(m_control)
        m_control->move(r*168, r*2);
    if(m_visual)
        m_visual->move(r*79,r*5);
}

void TitleBar::mousePressEvent(QMouseEvent* event)
{
    switch ((int) event->button ())
    {
    case Qt::LeftButton:
        m_pos = event->pos();
        Dock::instance()->calculateDistances();
        Dock::instance()->updateDock();
        break;
    case Qt::RightButton:
        m_mw->menu()->exec(event->globalPos());
    }
}

void TitleBar::mouseReleaseEvent(QMouseEvent*)
{
    Dock::instance()->updateDock();
}
void TitleBar::mouseMoveEvent(QMouseEvent* event)
{
    if (m_pos.x() < width() - m_skin->ratio() * 37)
    {
        QPoint npos = (event->globalPos()-m_pos);
        Dock::instance()->move(m_mw, npos);
    }
}

void TitleBar::setActive(bool a)
{
    if (a)
    {
        if (m_shaded)
            setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A));
        else
            setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A));
    }
    else
    {
        if (m_shaded)
            setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_I));
        else
            setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_I));
    }
}

void TitleBar::updateSkin()
{
    setActive(false);
    setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR));
    updatePositions();
}

void TitleBar::showMainMenu()
{
    m_mw->menu()->exec(m_menu->mapToGlobal(m_menu->pos()));
}

void TitleBar::shade()
{
    m_shaded = !m_shaded;
    int r = m_skin->ratio();
    if (m_shaded)
    {
        setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A));
        m_shade->hide();
        m_shade2 = new Button(this,Skin::BT_SHADE2_N, Skin::BT_SHADE2_P, Skin::CUR_WSNORMAL);
        connect(m_shade2, SIGNAL(clicked()), SLOT(shade()));
        m_shade2->show();
        m_currentTime = new SymbolDisplay(this, 6);
        m_currentTime->show();
        connect (m_currentTime, SIGNAL (mouseClicked()), m_model, SLOT (toggleElapsed()));
        m_control = new TitleBarControl(this);