/
SoundChooser.h
55 lines (39 loc) · 1.2 KB
/
SoundChooser.h
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
#pragma once
#include "ui/iresourcechooser.h"
#include "wxutil/dialog/DialogBase.h"
#include "wxutil/WindowPosition.h"
#include "ui/common/SoundShaderSelector.h"
#include "SoundShaderPreview.h"
#include <string>
#include <sigc++/connection.h>
namespace ui
{
/**
* Dialog for listing and selection of sound shaders.
*/
class SoundChooser :
public wxutil::DialogBase,
public IResourceChooser
{
private:
SoundShaderSelector* _selector;
sigc::connection _shadersReloaded;
wxutil::WindowPosition _windowPosition;
private:
void loadSoundShaders();
// callbacks
void _onItemActivated(wxDataViewEvent& ev);
void _onReloadSounds(wxCommandEvent& ev);
void onShadersReloaded();
public:
SoundChooser(wxWindow* parent = nullptr);
// Retrieve the selected sound shader
std::string getSelectedShader() const;
// Set the selected sound shader, and focuses the treeview to the new selection
void setSelectedShader(const std::string& shader);
int ShowModal() override;
// Run the dialog and return the selected shader - this will be empty if the user clicks cancel
std::string chooseResource(const std::string& preselected = std::string()) override;
void destroyDialog() override;
};
} // namespace