AeN64DriverMenu.c++
2.29 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include <assert.h>
#include <Vk/VkWindow.h>
#include <Vk/VkSubMenu.h>
#include <Vk/VkFileSelectionDialog.h>
#include "AeN64Driver.h"
#include "AeConfig.h"
#include "AeAssetWindow.h"
void
AeN64Driver::BuildMenu (AeAssetWindow * window)
{
fPlayerMenu = window->addMenuPane("N64");
fClearProfileButton = fPlayerMenu->addAction ("Clear Profile Values",
&AeN64Driver::clearProfileCallback,
this);
fPlayerMenu->addSeparator ();
fConfigureButton = fPlayerMenu->addAction ("Configure Hardware",
&AeN64Driver::configureCallback,
this);
fSaveConfigButton = fPlayerMenu->addAction ("Save Configuration...",
&AeN64Driver::saveConfigCallback,
this);
fLoadConfigButton = fPlayerMenu->addAction ("Load Configuration...",
&AeN64Driver::loadConfigCallback,
this);
fPlayerMenu->addSeparator ();
fResetSystemButton = fPlayerMenu->addAction ("Reset Hardware",
&AeN64Driver::resetSystemCallback,
this);
}
void
AeN64Driver::configureCallback (Widget w, XtPointer clientData, XtPointer callData)
{
AeN64Driver * driver = (AeN64Driver *) clientData;
driver->PoseConfigure();
}
void
AeN64Driver::saveConfigCallback (Widget w, XtPointer clientData, XtPointer callData)
{
AeN64Driver * driver = (AeN64Driver *) clientData;
AeN64Config * config = driver->GetConfig ();
assert (config);
if (theFileSelectionDialog->postAndWait("Save configuration:") == VkDialogManager::OK)
config->WriteToFile (theFileSelectionDialog->fileName ());
}
void
AeN64Driver::loadConfigCallback (Widget w, XtPointer clientData, XtPointer callData)
{
AeN64Driver * driver = (AeN64Driver *) clientData;
AeN64Config * config = driver->GetConfig ();
assert (config);
if (theFileSelectionDialog->postAndWait("Load configuration:") == VkDialogManager::OK)
{
config->ReadFromFile (theFileSelectionDialog->fileName ());
driver->ReconfigureAudio ();
}
}
void
AeN64Driver::clearProfileCallback (Widget w, XtPointer clientData, XtPointer callData)
{
AeN64Driver * driver = (AeN64Driver *) clientData;
driver->ResetMidi ();
}
void
AeN64Driver::resetSystemCallback (Widget w, XtPointer clientData, XtPointer callData)
{
AeN64Driver * driver = (AeN64Driver *) clientData;
driver->ResetDevice ();
}