MuseScore/fluid/fluidgui.h

85 lines
2.3 KiB
C
Raw Normal View History

//=============================================================================
// Zerberus
// Zample player
//
// Copyright (C) 2013 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __FLUIDGUI_H__
#define __FLUIDGUI_H__
#include "synthesizer/synthesizergui.h"
#include "ui_fluid_gui.h"
#include "fluid.h"
//---------------------------------------------------------
// ListDialog
//---------------------------------------------------------
struct SfNamePath {
QString name;
QString path;
};
2013-04-17 15:42:21 +02:00
class SfListDialog : public QDialog {
Q_OBJECT
int _idx = -1;
std::vector<struct SfNamePath> _namePaths;
QListWidget* list;
QDialogButtonBox* buttonBox;
QPushButton* okButton;
QPushButton* cancelButton;
private slots:
void okClicked();
void cancelClicked();
public:
SfListDialog(QWidget* parent = 0);
QString name();
QString path();
std::vector<struct SfNamePath> getNamePaths() { return _namePaths; }
void add(const QString& name, const QString& path);
};
//---------------------------------------------------------
// FluidGui
//---------------------------------------------------------
2013-05-13 18:49:17 +02:00
class FluidGui : public Ms::SynthesizerGui, Ui::FluidGui {
Q_OBJECT
QFutureWatcher<bool> _futureWatcher;
QString _loadedSfPath;
QString _loadedSfName;
QProgressDialog* _progressDialog;
QTimer * _progressTimer;
std::list<struct SfNamePath> _sfToLoad;
void loadSf();
private slots:
void soundFontUpClicked();
void soundFontDownClicked();
void soundFontAddClicked();
void soundFontDeleteClicked();
void onSoundFontLoaded();
void updateProgress();
void cancelLoadClicked();
void updateUpDownButtons();
2013-04-03 12:13:23 +02:00
public slots:
virtual void synthesizerChanged();
public:
2013-05-13 18:49:17 +02:00
FluidGui(Ms::Synthesizer*);
FluidS::Fluid* fluid() { return static_cast<FluidS::Fluid*>(synthesizer()); }
};
#endif