aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/wildmidi/wildmidihelper.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-02-07 14:21:23 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-02-07 14:21:23 +0000
commit62f1800c82b5f637e1a6037229e66f1ce36dd8d5 (patch)
treec8eaee05c6df848824b7b578c64ba323c432fc4d /src/plugins/Input/wildmidi/wildmidihelper.cpp
parent5a119002d992a47aeca66af31059d3769848d8c6 (diff)
downloadqmmp-62f1800c82b5f637e1a6037229e66f1ce36dd8d5.tar.gz
qmmp-62f1800c82b5f637e1a6037229e66f1ce36dd8d5.tar.bz2
qmmp-62f1800c82b5f637e1a6037229e66f1ce36dd8d5.zip
removed TagUpdater class
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9696 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/wildmidi/wildmidihelper.cpp')
0 files changed, 0 insertions, 0 deletions
<trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2008-12-14 13:55:02 +0000 committer trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2008-12-14 13:55:02 +0000 mediplayer class, enabled all statusicon actions' href='/qmmp/commit/src/ui/mainwindow.cpp?h=main&id=f47fcc22ac3f91dec7824c011b3f23d1e8279507'>f47fcc22a
2d622fd9b


2d622fd9b

2d622fd9b



2d622fd9b

4b6239e2e
fa0e5a060
86aac72c6
058812044
2d622fd9b
8b0f1481b
080507d3a
058812044
2d622fd9b





f47fcc22a
06d187781
9bc167e62
2077aa362
aa3da95b5
2077aa362
befb2d9f9
2077aa362
2c67ccb37

7e9e91c7a
2d622fd9b
f47fcc22a






f47fcc22a


2d622fd9b


2d622fd9b




2d622fd9b
f47fcc22a
2d622fd9b



2d622fd9b


2d622fd9b

2d622fd9b




49ae26a0d


f47fcc22a

f47fcc22a









2d622fd9b
f47fcc22a

2d622fd9b
f47fcc22a


0e860ae0b
f47fcc22a
0e860ae0b


76095a463
776b66963

2d622fd9b
06d187781


f47fcc22a



8ab140dac

f47fcc22a
400807571
2d622fd9b


400807571
a7fff99a9
54e207710
2d622fd9b




ad1fd928c
2d622fd9b



f47fcc22a
2d622fd9b







0b46e2db0
2d622fd9b
fa0e5a060
080507d3a





0e860ae0b
080507d3a



0e860ae0b
2d622fd9b














0e860ae0b
2d622fd9b

e656da41c
2d622fd9b

fedd13511
2d622fd9b
e656da41c
2d622fd9b

f47fcc22a
2d622fd9b



fbf6df0e2
2d622fd9b





0e860ae0b

f47fcc22a
0e860ae0b



f47fcc22a
0e860ae0b





a9946929b
0e860ae0b



a9946929b
0e860ae0b





76095a463











4e3ff2892
76095a463
76095a463
73817538b
76095a463


43ee25ac7
2d622fd9b








e85b77286


2d622fd9b



50a04bd30


e85b77286

50a04bd30
2d622fd9b
















86aac72c6
2d622fd9b








ae75e5707
2d622fd9b






54e207710
2d622fd9b

54e207710
2d622fd9b
















ad1fd928c


54e207710
2d622fd9b



ae75e5707
2d622fd9b
























da82e9b8e
86aac72c6
2d622fd9b






























2d622fd9b



f47fcc22a
2d622fd9b


ba46e29b7
2d622fd9b
e97a91b9e
fedd13511














2d622fd9b

86aac72c6

903b18a19
86aac72c6
b4a0e5d87
2d622fd9b
b4a0e5d87

2d622fd9b


080507d3a








2d622fd9b














2d622fd9b








a4da0eb5e
2d622fd9b





e85b77286


2d622fd9b
cf021281c
e85b77286


2d622fd9b
2d622fd9b

6f1f9ca43
2d622fd9b
6f1f9ca43
2d622fd9b




a4da0eb5e
2d622fd9b





e85b77286

2d622fd9b
e85b77286
2d622fd9b
e85b77286


2d622fd9b
2d622fd9b






2be01b8b3

cbff7cc47
2be01b8b3
2d622fd9b
7e58dddb0

2d622fd9b
7e58dddb0
2d622fd9b



0e860ae0b
f47fcc22a
2d622fd9b








9dc5748f6
38ba9babb
9dc5748f6












38ba9babb
2d622fd9b
058812044


9dc5748f6
2d622fd9b
058812044
2d622fd9b





9dc5748f6
2d622fd9b


2d622fd9b
9dc5748f6
2d622fd9b

058812044
2d622fd9b












54e207710



2d622fd9b

8cbd1444b



06d187781
















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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
                                                                            
                                                                            
























                                                                             
                           
                        

                                  

                                  
                                      
                              
                                 
                               


                         

                     



                         

                              
                         
                       
                       
                                     
 
                        
 
                                                                                                          





                             
                                   
                                      
                                             
                          
                                                                                                                
     
                                                                                    
      

                             
                           
 






                                                         


                                                


                                




                                    
                                    
                                          



                                     


                                               

                         




                                    


                                                               

                                     









                                                                     
 

                                                                                                             
 


                                                                   
 
                                                        


                                                                                      
                                                                    

                                                                               
 


                                                                                          



                                

                                               
               
                  


                                                               
      
                                                               
                           




                         
             



                       
                     







                         
                                 
 
                 





                          
                                         



                           
                                                          














                                                         
                          

                   
 

                       
                     
 
 

                           
                         



                           
                 





                                                     

                                             
                                                                          



                        
                                                                                       





                                                                                                
                                                      



                       
                                                       





                                











                                                                        
                                                                   
     
                                                                      
                                 


     
                                           








                          


                                                                             



                          


                                                                                            

                                                                             
                                                                                  
















                             
                                             








                                                  
                                                                 






                                                                
                                                                       

                            
 
















                                                                                       


                                                                                       
                                                                               



                                
                                                                 
























                                                            
                                 
                                   






























                                                               



                                                                   
                                                                       


                                                                           
                                                                                  
                               
                                                                              














                                                                                                                  

                                                                                 

                                     
                                                                                                     
                               
                                                                                     
                               

                                                                  


                                                                          








                                                                               














                                                          








                                   
                                                                          





                                                                                     


                                                                                              
         
                                     


                                                               
         

        
     
                                                                   
     




                               
                                                                          





                                                                                     

                                                                                                
 
                              
         


                                                               
         






                                                                   

                                                                            
                                                
                                                                       
                                         

                                                                              
                  
     



                            
                                         
                        








                                                                                
 
                                                                                                 












                                                                                                                   
                                                         
         


                                                      
                                                            
                
                             





                                                  
                                                                                               


                                                    
             
                                                           

         
                












                                     



                                                               

 



                                              
















                                                                                             
/***************************************************************************
 *   Copyright (C) 2006-2008 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 <QFileDialog>
#include <QDir>
#include <QAction>
#include <QMenu>

#include <math.h>

#include <qmmp/soundcore.h>
#include <qmmp/visual.h>
#include <qmmpui/generalhandler.h>
#include <qmmpui/general.h>
#include <qmmpui/playlistparser.h>
#include <qmmpui/playlistformat.h>
#include <qmmpui/commandlinemanager.h>
#include <qmmpui/filedialog.h>
#include <qmmpui/playlistmodel.h>
#include <qmmpui/mediaplayer.h>

#include "textscroller.h"
#include "mainwindow.h"
#include "skin.h"
#include "playlist.h"
#include "configdialog.h"
#include "dock.h"
#include "eqwidget.h"
#include "mainvisual.h"
#include "jumptotrackdialog.h"
#include "aboutdialog.h"
#include "addurldialog.h"
#include "listwidget.h"
#include "visualmenu.h"
#include "builtincommandlineoption.h"

#define KEY_OFFSET 10000

MainWindow::MainWindow(const QStringList& args, BuiltinCommandLineOption* option_manager, QWidget *parent)
        : QMainWindow(parent)
{
    m_vis = 0;
    seeking = FALSE;
    m_update = FALSE;
    m_paused = FALSE;
    m_playlistName = tr("Default");
    m_option_manager = option_manager;
    setWindowIcon(QIcon(":/32x32/qmmp.png"));
#if QT_VERSION >= 0x040500
    setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint);
#else
    setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
#endif
    //setFixedSize (275,116);
    resize(275,116);
    setWindowTitle("Qmmp");

    //prepare libqmmp and libqmmpui libraries for playing
    m_player = new MediaPlayer(this);
    m_core = new SoundCore(this);
    m_playListModel = new PlayListModel(this);
    m_player->initialize(m_core, m_playListModel);
    //additional featuries
    new PlaylistParser(this);
    m_generalHandler = new GeneralHandler(this);

    //user interface
    m_skin = new Skin(this);
    Dock *dock = new Dock(this);
    dock->setMainWidget(this);
    display = new MainDisplay(this);
    setCentralWidget(display);
    display->show();
    display->setFocus ();

    m_playlist = new PlayList(this);
    m_playlist->setModel(m_playListModel);
    dock->addWidget(m_playlist);

    m_equalizer = new EqWidget(this);
    dock->addWidget(m_equalizer);

    m_jumpDialog = new JumpToTrackDialog(this);
    m_jumpDialog->setModel(m_playListModel);
    m_jumpDialog->hide();

    m_titlebar = new TitleBar(this);
    m_titlebar->move(0,0);
    m_titlebar->show();
    m_titlebar->setActive(TRUE);

    createActions();
    //prepare visulization
    Visual::initialize(this, m_visMenu, SLOT(updateActions()));
    m_vis = MainVisual::getPointer();
    Visual::add(m_vis);
    //connections
    connect (m_playlist,SIGNAL(next()),SLOT(next()));
    connect (m_playlist,SIGNAL(prev()),SLOT(previous()));
    connect (m_playlist,SIGNAL(play()),SLOT(play()));
    connect (m_playlist,SIGNAL(pause()), m_core ,SLOT(pause()));
    connect (m_playlist,SIGNAL(stop()),SLOT(stop()));
    connect (m_playlist,SIGNAL(eject()),SLOT(addFile()));
    connect (m_playlist,SIGNAL(newPlaylist()),SLOT(newPlaylist()));
    connect (m_playlist,SIGNAL(loadPlaylist()),SLOT(loadPlaylist()));
    connect (m_playlist,SIGNAL(savePlaylist()),SLOT(savePlaylist()));

    connect(display,SIGNAL(shuffleToggled(bool)),m_playListModel,SLOT(prepareForShufflePlaying(bool)));
    connect(display,SIGNAL(repeatableToggled(bool)),m_playListModel,SLOT(prepareForRepeatablePlaying(bool)));

    connect(m_equalizer, SIGNAL(valueChanged()), SLOT(updateEQ()));

    connect(m_jumpDialog,SIGNAL(playRequest()),this,SLOT(play()));

    //connect(m_core, SIGNAL(finished()), SLOT(next()));
    connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State)));
    connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64)));
    connect(m_core, SIGNAL(elapsedChanged(qint64)),m_titlebar, SLOT(setTime(qint64)));
    connect(m_core, SIGNAL(metaDataChanged()),SLOT(showMetaData()));
    connect(m_core, SIGNAL(bufferingProgress(int)), TextScroller::getPointer(),
            SLOT(setProgress(int)));

    connect(m_generalHandler, SIGNAL(toggleVisibilityCalled()), SLOT(toggleVisibility()));
    connect(m_generalHandler, SIGNAL(exitCalled()), SLOT(close()));

    readSettings();
    display->setEQ(m_equalizer);
    display->setPL(m_playlist);
    dock->updateDock();
    //m_playListModel->readSettings();
    m_playListModel->doCurrentVisibleRequest();
    updateEQ();
#ifndef Q_OS_WIN32
    char buf[PATH_MAX + 1];
    QString cwd = QString::fromLocal8Bit(getcwd(buf,PATH_MAX));
    processCommandArgs(args,cwd);
#endif
    if (m_startHidden && m_generalHandler->visibilityControl())
        toggleVisibility();
}


MainWindow::~MainWindow()
{
    //stop();
}

void MainWindow::play()
{
    m_player->play();
}

void MainWindow::replay()
{
    stop();
    play();
}

void MainWindow::seek(qint64 pos)
{
    if (!seeking)
        m_core->seek(pos);
}


void MainWindow::forward()
{
    seek(m_core->elapsed() + KEY_OFFSET);
}

void MainWindow::backward()
{
    seek(qMax(qint64(0), m_core->elapsed() - KEY_OFFSET));
}

void MainWindow::setVolume(int volume, int balance)
{
    m_core->setVolume(volume-qMax(balance,0)*volume/100,
                      volume+qMin(balance,0)*volume/100);
}

void MainWindow::pause(void)
{
    m_core->pause();
}

void MainWindow::stop()
{
    //display->setTime(0);
    m_core->stop();
}

void MainWindow::next()
{
    m_player->next();
}

void MainWindow::previous()
{
    m_player->previous();
}

void MainWindow::updateEQ()
{
    double b[10];
    for (int i=0; i<10; ++i)
        b[i] = m_equalizer->gain(i);
    m_core->setEQ(b, m_equalizer->preamp());
    m_core->setEQEnabled(m_equalizer->isEQEnabled());
}

void MainWindow::showState(Qmmp::State state)
{
    disconnect(m_playListModel, SIGNAL(firstAdded()), this, SLOT(play()));
    switch ((int) state)
    {
    case Qmmp::Playing:
    {
        m_equalizer->loadPreset(m_playListModel->currentItem()->url().section("/",-1));
        if (m_playlist->listWidget())
            m_playlist->listWidget()->updateList(); //removes progress message from TextScroller
        break;
    }
    case Qmmp::Paused:
    {
        //m_generalHandler->setState(General::Paused);
        break;
    }
    case Qmmp::Stopped:
    {
        //m_generalHandler->setState(General::Stopped);
        m_playlist->setTime(-1);
        m_titlebar->setTime(-1);
        break;
    }
    }
}
void MainWindow::showMetaData()
{
    qDebug("===== metadata ======");