-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathN64AnalyzerSettings.cpp
executable file
·61 lines (44 loc) · 1.45 KB
/
N64AnalyzerSettings.cpp
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
#include "N64AnalyzerSettings.h"
#include <AnalyzerHelpers.h>
N64AnalyzerSettings::N64AnalyzerSettings()
: mInputChannel( UNDEFINED_CHANNEL )
{
mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
mInputChannelInterface->SetTitleAndTooltip( "Serial", "Standard N64 Controller" );
mInputChannelInterface->SetChannel( mInputChannel );
AddInterface( mInputChannelInterface.get() );
AddExportOption( 0, "Export as text/csv file" );
AddExportExtension( 0, "text", "txt" );
AddExportExtension( 0, "csv", "csv" );
ClearChannels();
AddChannel( mInputChannel, "N64 Controller", false );
}
N64AnalyzerSettings::~N64AnalyzerSettings()
{
}
bool N64AnalyzerSettings::SetSettingsFromInterfaces()
{
mInputChannel = mInputChannelInterface->GetChannel();
ClearChannels();
AddChannel( mInputChannel, "N64 Controller", true );
return true;
}
void N64AnalyzerSettings::UpdateInterfacesFromSettings()
{
mInputChannelInterface->SetChannel( mInputChannel );
}
void N64AnalyzerSettings::LoadSettings( const char* settings )
{
SimpleArchive text_archive;
text_archive.SetString( settings );
text_archive >> mInputChannel;
ClearChannels();
AddChannel( mInputChannel, "N64 Controller", true );
UpdateInterfacesFromSettings();
}
const char* N64AnalyzerSettings::SaveSettings()
{
SimpleArchive text_archive;
text_archive << mInputChannel;
return SetReturnString( text_archive.GetString() );
}