-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWSFSets.cpp
More file actions
197 lines (157 loc) · 4.86 KB
/
Copy pathWSFSets.cpp
File metadata and controls
197 lines (157 loc) · 4.86 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
Whelchel Sound Format
Based on MODs
Josh Whelchel 2003
www.syntesis.ath.cx
*/
/* LICENSE
-=-=-=-=-=-=-=-
This source is released on a do-not-modify-and-call-it-your-own-because-your-selfish
license. If you're going to change ANYTHING about the engine and release it either
open source, or as a major format then it will require my permission first. I ask
that if you use my technology, that I get due respect and credit.
Also, I like to hear when people use my format, give me an email and tell me about
it. joshwhelchel@hotmail.com or siggy2336@hotmail.com will work.
~ Josh Whelchel 2003
wsf.syntesis.ath.cx
*/
/// \file WSFSets.cpp
/// Controls Settings of WSF playing utilities :D
#include <stdio.h>
#include <stdarg.h>
#include "WSFSets.h"
//***************************************************************************** */
// OpenKey()
//
// Purpose: Opens/Creates a key
//
// Author : [Josh Whelchel], Created : [6/30/2002 2:43:57 PM]
// Parameters:
//
// [hP] : Parent
// [*cAdd] : Address
//
// Returns: HKEY
//
//***************************************************************************** */
/// Opens Registry Key
HKEY CWSFSets::OpenKey( HKEY hP, char *cAdd )
{
HKEY hR;
DWORD dT;
RegCreateKeyEx(hP,cAdd,0,"",REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hR,&dT);
return hR;
}
//***************************************************************************** */
// LoadSettings()
//
// Purpose: Loads Settings
//
// Author : [Josh Whelchel], Created : [2/16/2003 6:21:42 PM]
// Parameters:
//
// [void] :
//
// Returns: none
//
//***************************************************************************** */
/// Loads settings from registry
void CWSFSets::LoadSettings( void )
{
DWORD dVal;
DWORD dSize;
DWORD dType;
HKEY hK;
HKEY hKB;
memset(&m_wSets,0,sizeof(WSFSettings));
strcpy(m_wSets.cTitle,"%title% (%artist%)");
// Go to where our settings are found
hK = OpenKey(HKEY_LOCAL_MACHINE,"Software");
hKB = OpenKey(hK,"Syntesis Entertainment");
RegCloseKey(hK);
hK = OpenKey(hKB,"WSFPlay");
RegCloseKey(hKB);
RegQueryValueEx(hK,NULL,0,NULL,(LPBYTE)&dVal,&dSize);
if (dVal != 666)
SaveSettings();
m_wSets.cTitle[0] = NULL;
// RegQueryValueEx(hK,"NoFreePack",0,NULL,(LPBYTE)&dVal,&dSize);
// m_wSets.nNoFreePack = dVal;
RegQueryValueEx(hK,"DisableSEcho",0,NULL,(LPBYTE)&dVal,&dSize);
m_wSets.nDisableSEcho = dVal;
RegQueryValueEx(hK,"LoBit",0,NULL,(LPBYTE)&dVal,&dSize);
m_wSets.nLoBit = dVal;
RegQueryValueEx(hK,"Mono",0,NULL,(LPBYTE)&dVal,&dSize);
m_wSets.nMono = dVal;
RegQueryValueEx(hK,"LoadLen",0,NULL,(LPBYTE)&dVal,&dSize);
m_wSets.nLoadLen = dVal;
dType = REG_SZ;
RegQueryValueEx(hK,"TitleOutput",0,&dType,(LPBYTE)m_wSets.cTitle,&dSize);
RegQueryValueEx(hK,"TitleOutput",0,&dType,(LPBYTE)m_wSets.cTitle,&dSize);
m_wSets.nNoFreePack = 0;
RegCloseKey(hK);
return;
}
//***************************************************************************** */
// SaveSettings()
//
// Purpose: Saves Settings
//
// Author : [Josh Whelchel], Created : [2/16/2003 6:21:51 PM]
// Parameters:
//
// [void] :
//
// Returns: none
//
//***************************************************************************** */
/// Saves settings to registry
void CWSFSets::SaveSettings( void )
{
DWORD dVal;
HKEY hK;
HKEY hKB;
// Go to where our settings are found
hK = OpenKey(HKEY_LOCAL_MACHINE,"Software");
hKB = OpenKey(hK,"Syntesis Entertainment");
RegCloseKey(hK);
hK = OpenKey(hKB,"WSFPlay");
RegCloseKey(hKB);
// dVal = m_wSets.nNoFreePack;
// RegSetValueEx(hK,"NoFreePack",0,REG_DWORD,(LPBYTE)&dVal,sizeof(DWORD));
dVal = m_wSets.nDisableSEcho;
RegSetValueEx(hK,"DisableSEcho",0,REG_DWORD,(LPBYTE)&dVal,sizeof(DWORD));
dVal = m_wSets.nLoBit;
RegSetValueEx(hK,"LoBit",0,REG_DWORD,(LPBYTE)&dVal,sizeof(DWORD));
dVal = m_wSets.nMono;
RegSetValueEx(hK,"Mono",0,REG_DWORD,(LPBYTE)&dVal,sizeof(DWORD));
dVal = m_wSets.nLoadLen;
RegSetValueEx(hK,"LoadLen",0,REG_DWORD,(LPBYTE)&dVal,sizeof(DWORD));
RegSetValueEx(hK,"TitleOutput",0,REG_SZ,(LPBYTE)m_wSets.cTitle,strlen(m_wSets.cTitle)+1);
dVal = 666;
RegSetValueEx(hK,NULL,0,REG_DWORD,(LPBYTE)&dVal,sizeof(DWORD));
RegCloseKey(hK);
return;
}
//***************************************************************************** */
// CWSFSets::CWSFSets()
//
// Purpose: Sets
//
// Author : [Josh Whelchel], Created : [2/17/2003 11:25:38 AM]
// Parameters:
//
//
// Returns: none
//
//***************************************************************************** */
CWSFSets::CWSFSets()
{
memset(&m_wSets,0,sizeof(WSFSettings));
// Already FALSE. :P
// m_wSets.nDisableSEcho = FALSE;
// m_wSets.nMono = FALSE;
// m_wSets.nLoBit = FALSE;
strcpy(m_wSets.cTitle,"%title% (%artist%)");
return;
}