MuseScore  3.4
Music composition and notation
fluidgui.h
Go to the documentation of this file.
1 //=============================================================================
2 // Zerberus
3 // Zample player
4 //
5 // Copyright (C) 2013 Werner Schweer
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __FLUIDGUI_H__
14 #define __FLUIDGUI_H__
15 
17 #include "ui_fluid_gui.h"
18 #include "fluid.h"
19 
20 //---------------------------------------------------------
21 // ListDialog
22 //---------------------------------------------------------
23 
24 struct SfNamePath {
25  QString name;
26  QString path;
27  };
28 
29 class SfListDialog : public QDialog {
30  Q_OBJECT
31  int _idx = -1;
32  std::vector<struct SfNamePath> _namePaths;
33  QListWidget* list;
34  QDialogButtonBox* buttonBox;
35  QPushButton* okButton;
36  QPushButton* cancelButton;
37 
38  private slots:
39  void okClicked();
40  void cancelClicked();
41 
42  public:
43  SfListDialog(QWidget* parent = 0);
44  QString name();
45  QString path();
46  std::vector<struct SfNamePath> getNamePaths() { return _namePaths; }
47  void add(const QString& name, const QString& path);
48  };
49 
50 //---------------------------------------------------------
51 // FluidGui
52 //---------------------------------------------------------
53 
54 class FluidGui : public Ms::SynthesizerGui, Ui::FluidGui {
55  Q_OBJECT
56 
57  QFutureWatcher<bool> _futureWatcher;
58  QString _loadedSfPath;
59  QString _loadedSfName;
60  QProgressDialog* _progressDialog;
61  QTimer * _progressTimer;
62  std::list<struct SfNamePath> _sfToLoad;
63  void loadSf();
64  void moveSoundfontInTheList(int currentIdx, int targetIdx);
65 
66  private slots:
67  void soundFontTopClicked();
68  void soundFontUpClicked();
69  void soundFontDownClicked();
70  void soundFontAddClicked();
71  void soundFontDeleteClicked();
72  void onSoundFontLoaded();
73  void updateProgress();
74  void cancelLoadClicked();
75  void updateUpDownButtons();
76 
77  public slots:
78  virtual void synthesizerChanged();
79 
80  public:
82  FluidS::Fluid* fluid() { return static_cast<FluidS::Fluid*>(synthesizer()); }
83  };
84 
85 #endif
86 
QDialogButtonBox * buttonBox
Definition: fluidgui.h:34
QListWidget * list
Definition: fluidgui.h:33
Definition: synthesizer.h:41
QPushButton * okButton
Definition: fluidgui.h:35
Definition: fluidgui.h:29
QFutureWatcher< bool > _futureWatcher
Definition: fluidgui.h:57
std::list< struct SfNamePath > _sfToLoad
Definition: fluidgui.h:62
Definition: fluid.h:297
Definition: synthesizergui.h:24
FluidS::Fluid * fluid()
Definition: fluidgui.h:82
std::vector< struct SfNamePath > _namePaths
Definition: fluidgui.h:32
Definition: fluidgui.h:54
std::vector< struct SfNamePath > getNamePaths()
Definition: fluidgui.h:46
QString _loadedSfPath
Definition: fluidgui.h:58
QPushButton * cancelButton
Definition: fluidgui.h:36
QProgressDialog * _progressDialog
Definition: fluidgui.h:60
QString name
Definition: fluidgui.h:25
QString _loadedSfName
Definition: fluidgui.h:59
QTimer * _progressTimer
Definition: fluidgui.h:61
QString path
Definition: fluidgui.h:26
Definition: fluidgui.h:24