| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "ieclass.h" |
| 4 |
#include <wx/panel.h> |
| 5 |
|
| 6 |
class wxStaticText; |
| 7 |
class wxButton; |
| 8 |
|
| 9 |
namespace ui |
| 10 |
{ |
| 11 |
|
| 12 |
/** |
| 13 |
* greebo: This class provides the UI elements to listen |
| 14 |
* to a a given AI vocal set. On clicking the playback button |
| 15 |
* a random sound is chosen from the vocal set. |
| 16 |
* |
| 17 |
* Use the getWidget() method to pack this into a |
| 18 |
* parent container. |
| 19 |
*/ |
| 20 |
class AIVocalSetPreview : |
| 21 |
public wxPanel |
| 22 |
{ |
| 23 |
private: |
| 24 |
wxButton* _playButton; |
| 25 |
wxButton* _stopButton; |
| 26 |
wxStaticText* _statusLabel; |
| 27 |
|
| 28 |
// The currently "previewed" vocal set |
| 29 |
IEntityClassPtr _vocalSetDef; |
| 30 |
|
| 31 |
typedef std::vector<std::string> SoundShaderList; |
| 32 |
SoundShaderList _setShaders; |
| 33 |
|
| 34 |
public: |
| 35 |
AIVocalSetPreview(wxWindow* parent); |
| 36 |
|
| 37 |
/** |
| 38 |
* greebo: Sets the vocal set to preview. Set NULL to disable this panel. |
| 39 |
*/ |
| 40 |
void setVocalSetEclass(const IEntityClassPtr& vocalSetDef); |
| 41 |
|
| 42 |
private: |
| 43 |
/** |
| 44 |
* greebo: Returns a random file from the selected vocal set. |
| 45 |
* @returns: the filename as defined in one of the shaders or "". |
| 46 |
*/ |
| 47 |
std::string getRandomSoundFile(); |
| 48 |
|
| 49 |
/** greebo: Creates the control widgets (play button) and such. |
| 50 |
*/ |
| 51 |
void createControlPanel(); |
| 52 |
|
| 53 |
/** greebo: Updates the list according to the active soundshader |
| 54 |
*/ |
| 55 |
void update(); |
| 56 |
|
| 57 |
// Callbacks |
| 58 |
void onPlay(wxCommandEvent& ev); |
| 59 |
void onStop(wxCommandEvent& ev); |
| 60 |
}; |
| 61 |
|
| 62 |
} // namespace ui |