MuseScore  3.4
Music composition and notation
zerberusgui.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 __ZERBERUSGUI_H__
14 #define __ZERBERUSGUI_H__
15 
17 #include "ui_zerberus_gui.h"
18 #include "zerberus.h"
19 #include <QDialogButtonBox>
20 
21 class QProgressDialog;
22 
23 struct SfNamePath {
24  QString name;
25  QString path;
26  };
27 
28 //---------------------------------------------------------
29 // SfzListDialog
30 //---------------------------------------------------------
31 
32 class SfzListDialog : public QDialog {
33  Q_OBJECT
34  int _idx = -1;
35  std::vector<struct SfNamePath> _namePaths;
36  QListWidget* list;
37  QDialogButtonBox* buttonBox;
38  QPushButton* okButton;
39  QPushButton* cancelButton;
40 
41  private slots:
42  void okClicked();
43  void cancelClicked();
44 
45  public:
46  SfzListDialog(QWidget* parent = 0);
47  std::vector<struct SfNamePath> getNamePaths() { return _namePaths; }
48  void add(const QString& name, const QString& path);
49  };
50 
51 //---------------------------------------------------------
52 // ZerberusGui
53 //---------------------------------------------------------
54 
55 class ZerberusGui : public Ms::SynthesizerGui, Ui::ZerberusGui {
56  Q_OBJECT
57 
58  QFutureWatcher<bool> _futureWatcher;
59  QString _loadedSfPath;
60  QString _loadedSfName;
61  QProgressDialog* _progressDialog;
62  QTimer * _progressTimer;
63  std::list<struct SfNamePath> _sfzToLoad;
64 
65  void loadSfz();
66  void loadSoundFontsAsync(QStringList sfonts);
67  void moveSoundfontInTheList(int currentIdx, int targetIdx);
68 
69  private slots:
70  void soundFontTopClicked();
71  void soundFontUpClicked();
72  void soundFontDownClicked();
73  void soundFontAddClicked();
74  void cancelLoadClicked();
75  void soundFontDeleteClicked();
76  void onSoundFontLoaded();
77  void updateProgress();
78  void updateButtons();
79 
80  public slots:
81  virtual void synthesizerChanged();
82 
83  public:
85  Zerberus* zerberus() { return static_cast<Zerberus*>(synthesizer()); }
86  };
87 
88 #endif
89 
Zerberus * zerberus()
Definition: zerberusgui.h:85
std::vector< struct SfNamePath > getNamePaths()
Definition: zerberusgui.h:47
Definition: zerberusgui.h:32
Definition: synthesizer.h:41
std::list< struct SfNamePath > _sfzToLoad
Definition: zerberusgui.h:63
Definition: zerberus.h:75
QPushButton * okButton
Definition: zerberusgui.h:38
QFutureWatcher< bool > _futureWatcher
Definition: zerberusgui.h:58
QPushButton * cancelButton
Definition: zerberusgui.h:39
Definition: synthesizergui.h:24
QString _loadedSfPath
Definition: zerberusgui.h:59
Definition: zerberusgui.h:55
QString name
Definition: fluidgui.h:25
QListWidget * list
Definition: zerberusgui.h:36
QString path
Definition: fluidgui.h:26
Definition: fluidgui.h:24
QProgressDialog * _progressDialog
Definition: zerberusgui.h:61
QString _loadedSfName
Definition: zerberusgui.h:60
QTimer * _progressTimer
Definition: zerberusgui.h:62
QDialogButtonBox * buttonBox
Definition: zerberusgui.h:37
std::vector< struct SfNamePath > _namePaths
Definition: zerberusgui.h:35