(empty log message)
@@ -0,0 +1,11 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
2 | +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | |
3 | + <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | |
4 | + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | |
5 | + <security> | |
6 | + <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | |
7 | + <requestedExecutionLevel level="asInvoker" uiAccess="false"/> | |
8 | + </requestedPrivileges> | |
9 | + </security> | |
10 | + </trustInfo> | |
11 | +</assembly> |
@@ -1,9 +1,25 @@ | ||
1 | 1 | // ////////////////////////////////////////////////////////////////////////// |
2 | 2 | // |
3 | 3 | // ComboDeviceOut.cs |
4 | -// CopyRight CACTUS SOFTWARE (2009) | |
5 | -// Sarbo Project Sample Program | |
4 | +// Sarbo Project | |
5 | +// Powerd by CACTUS SOFTWARE <http://www.cactussoft.co.jp/> | |
6 | +// | |
6 | 7 | // ver 1.0 2009/08/13 |
8 | +// This file is part of Sarbo. | |
9 | +// | |
10 | +// Sarbo is free software: you can redistribute it and/or modify | |
11 | +// it under the terms of the GNU General Public License as published by | |
12 | +// the Free Software Foundation, either version 2 of the License, or | |
13 | +// (at your option) any later version. | |
14 | +// | |
15 | +// Sarbo is distributed in the hope that it will be useful, | |
16 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | +// GNU General Public License for more details. | |
19 | +// | |
20 | +// You should have received a copy of the GNU General Public License | |
21 | +// along with Sarbo. If not, see <http://www.gnu.org/licenses/>. | |
22 | +// | |
7 | 23 | // ////////////////////////////////////////////////////////////////////////// |
8 | 24 | using System; |
9 | 25 | using System.Collections.Generic; |
@@ -16,8 +32,8 @@ | ||
16 | 32 | { |
17 | 33 | public partial class ComboDeviceOut : UserControl |
18 | 34 | { |
19 | - private List<IMoniker> m_iMonikerList = new List<IMoniker>(); | |
20 | - private List<string> m_deviceList = new List<string>(); | |
35 | + private List<IMoniker> _iMonikerList = new List<IMoniker>(); | |
36 | + private List<string> _deviceList = new List<string>(); | |
21 | 37 | |
22 | 38 | public ComboDeviceOut() |
23 | 39 | { |
@@ -29,12 +45,12 @@ | ||
29 | 45 | |
30 | 46 | public List<IMoniker> IMonikerList |
31 | 47 | { |
32 | - get { return m_iMonikerList; } | |
48 | + get { return _iMonikerList; } | |
33 | 49 | } |
34 | 50 | |
35 | 51 | public List<string> DeviceList |
36 | 52 | { |
37 | - get { return m_deviceList; } | |
53 | + get { return _deviceList; } | |
38 | 54 | } |
39 | 55 | |
40 | 56 | public int NumDevs |
@@ -1,9 +1,25 @@ | ||
1 | 1 | // ////////////////////////////////////////////////////////////////////////// |
2 | 2 | // |
3 | 3 | // MainForm.cs |
4 | -// CopyRight CACTUS SOFTWARE (2009) | |
5 | -// Sarbo Project Sample Program | |
4 | +// Sarbo Project | |
5 | +// Powerd by CACTUS SOFTWARE <http://www.cactussoft.co.jp/> | |
6 | +// | |
6 | 7 | // ver 1.0 2009/08/13 |
8 | +// This file is part of Sarbo. | |
9 | +// | |
10 | +// Sarbo is free software: you can redistribute it and/or modify | |
11 | +// it under the terms of the GNU General Public License as published by | |
12 | +// the Free Software Foundation, either version 2 of the License, or | |
13 | +// (at your option) any later version. | |
14 | +// | |
15 | +// Sarbo is distributed in the hope that it will be useful, | |
16 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | +// GNU General Public License for more details. | |
19 | +// | |
20 | +// You should have received a copy of the GNU General Public License | |
21 | +// along with Sarbo. If not, see <http://www.gnu.org/licenses/>. | |
22 | +// | |
7 | 23 | // ////////////////////////////////////////////////////////////////////////// |
8 | 24 | using System; |
9 | 25 | using System.Windows.Forms; |
@@ -13,7 +29,7 @@ | ||
13 | 29 | { |
14 | 30 | public partial class MainForm : Form |
15 | 31 | { |
16 | - private SoundGraph m_soundGraph = null; | |
32 | + private SoundGraph _soundGraph = null; | |
17 | 33 | |
18 | 34 | public MainForm() |
19 | 35 | { |
@@ -28,7 +44,7 @@ | ||
28 | 44 | if (this.DesignMode) return; |
29 | 45 | |
30 | 46 | comboDeviceOut.InitComboBox(); |
31 | - m_soundGraph = new SoundGraph(); | |
47 | + _soundGraph = new SoundGraph(); | |
32 | 48 | } |
33 | 49 | |
34 | 50 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) |
@@ -36,7 +52,7 @@ | ||
36 | 52 | if (this.DesignMode) return; |
37 | 53 | |
38 | 54 | comboDeviceOut.ExitComboBox(); |
39 | - m_soundGraph.StopAndExit(); | |
55 | + _soundGraph.StopAndExit(); | |
40 | 56 | } |
41 | 57 | |
42 | 58 | // ////////////////////////////////////////////////////////////////// |
@@ -79,7 +95,7 @@ | ||
79 | 95 | if (DialogResult.OK == openFileDialog.ShowDialog()) |
80 | 96 | { |
81 | 97 | textFilePath.Text = openFileDialog.FileName; |
82 | - m_soundGraph.StopAndExit(); | |
98 | + _soundGraph.StopAndExit(); | |
83 | 99 | RenderSongFile(openFileDialog.FileName); |
84 | 100 | } |
85 | 101 | } |
@@ -89,7 +105,7 @@ | ||
89 | 105 | |
90 | 106 | private void btnRewind_Click(object sender, EventArgs e) |
91 | 107 | { |
92 | - m_soundGraph.SeekPosition(0); | |
108 | + _soundGraph.SeekPosition(0); | |
93 | 109 | } |
94 | 110 | |
95 | 111 | private void btnPlay_Click(object sender, EventArgs e) |
@@ -122,20 +138,20 @@ | ||
122 | 138 | |
123 | 139 | private void RenderSongFile(string strFilePath) |
124 | 140 | { |
125 | - if (m_soundGraph.IsRenderFile()) return; | |
141 | + if (_soundGraph.IsRenderFile()) return; | |
126 | 142 | |
127 | - FilterState fs = m_soundGraph.GetState(); | |
143 | + FilterState fs = _soundGraph.GetState(); | |
128 | 144 | if (fs != FilterState.Stopped) return; |
129 | 145 | |
130 | 146 | try |
131 | 147 | { |
132 | - m_soundGraph.InitInstance(); | |
133 | - m_soundGraph.RenderSongFile(strFilePath); | |
134 | - m_soundGraph.SetNotifyWindow(this.Handle); | |
148 | + _soundGraph.InitInstance(); | |
149 | + _soundGraph.RenderSongFile(strFilePath); | |
150 | + _soundGraph.SetNotifyWindow(this.Handle); | |
135 | 151 | } |
136 | 152 | catch (Exception) |
137 | 153 | { |
138 | - m_soundGraph.StopAndExit(); | |
154 | + _soundGraph.StopAndExit(); | |
139 | 155 | } |
140 | 156 | } |
141 | 157 |
@@ -146,7 +162,7 @@ | ||
146 | 162 | IntPtr wparam, |
147 | 163 | IntPtr lparam) |
148 | 164 | { |
149 | - if (m_soundGraph.IsComplete()) | |
165 | + if (_soundGraph.IsComplete()) | |
150 | 166 | { |
151 | 167 | StopProc(); |
152 | 168 | } |
@@ -160,12 +176,12 @@ | ||
160 | 176 | { |
161 | 177 | EnablePlayUI(false); |
162 | 178 | |
163 | - FilterState fs = m_soundGraph.GetState(); | |
179 | + FilterState fs = _soundGraph.GetState(); | |
164 | 180 | if (fs != FilterState.Stopped) return; |
165 | 181 | |
166 | 182 | try |
167 | 183 | { |
168 | - m_soundGraph.StartPlay(); | |
184 | + _soundGraph.StartPlay(); | |
169 | 185 | } |
170 | 186 | catch (Exception) |
171 | 187 | { |
@@ -175,14 +191,14 @@ | ||
175 | 191 | |
176 | 192 | private void StopProc() |
177 | 193 | { |
178 | - FilterState fs = m_soundGraph.GetState(); | |
194 | + FilterState fs = _soundGraph.GetState(); | |
179 | 195 | |
180 | 196 | try |
181 | 197 | { |
182 | 198 | if (fs == FilterState.Running) |
183 | 199 | { |
184 | - m_soundGraph.StopPlay(); | |
185 | - m_soundGraph.WaitForStop(); | |
200 | + _soundGraph.StopPlay(); | |
201 | + _soundGraph.WaitForStop(); | |
186 | 202 | } |
187 | 203 | } |
188 | 204 | catch (Exception) |
@@ -1,9 +1,25 @@ | ||
1 | 1 | // ////////////////////////////////////////////////////////////////////////// |
2 | 2 | // |
3 | 3 | // SoundGraph.cs |
4 | -// CopyRight CACTUS SOFTWARE (2009) | |
5 | -// Sarbo Project Sample Program | |
4 | +// Sarbo Project | |
5 | +// Powerd by CACTUS SOFTWARE <http://www.cactussoft.co.jp/> | |
6 | +// | |
6 | 7 | // ver 1.0 2009/08/28 |
8 | +// This file is part of Sarbo. | |
9 | +// | |
10 | +// Sarbo is free software: you can redistribute it and/or modify | |
11 | +// it under the terms of the GNU General Public License as published by | |
12 | +// the Free Software Foundation, either version 2 of the License, or | |
13 | +// (at your option) any later version. | |
14 | +// | |
15 | +// Sarbo is distributed in the hope that it will be useful, | |
16 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | +// GNU General Public License for more details. | |
19 | +// | |
20 | +// You should have received a copy of the GNU General Public License | |
21 | +// along with Sarbo. If not, see <http://www.gnu.org/licenses/>. | |
22 | +// | |
7 | 23 | // ////////////////////////////////////////////////////////////////////////// |
8 | 24 | using System; |
9 | 25 | using System.IO; |
@@ -14,15 +30,15 @@ | ||
14 | 30 | { |
15 | 31 | public class SoundGraph |
16 | 32 | { |
17 | - private IGraphBuilder m_iGraphBuilder = null; | |
18 | - private IMediaControl m_iMediaControl = null; | |
19 | - private IMediaSeeking m_iMediaSeeking = null; | |
20 | - private IMediaEventEx m_iMediaEventEx = null; | |
21 | - private IBasicAudio m_iBasicAudio = null; | |
33 | + private IGraphBuilder _iGraphBuilder = null; | |
34 | + private IMediaControl _iMediaControl = null; | |
35 | + private IMediaSeeking _iMediaSeeking = null; | |
36 | + private IMediaEventEx _iMediaEventEx = null; | |
37 | + private IBasicAudio _iBasicAudio = null; | |
22 | 38 | |
23 | - private FilterState m_filterState = FilterState.Stopped; | |
24 | - private bool m_renderFile = false; | |
25 | - private int m_register = 0; | |
39 | + private FilterState _filterState = FilterState.Stopped; | |
40 | + private bool _renderFile = false; | |
41 | + private int _register = 0; | |
26 | 42 | |
27 | 43 | // ////////////////////////////////////////////////////////////////// |
28 | 44 | // Init |
@@ -31,14 +47,14 @@ | ||
31 | 47 | { |
32 | 48 | Type comType = Type.GetTypeFromCLSID(CLSID.FilterGraph); |
33 | 49 | object comObj = Activator.CreateInstance(comType); |
34 | - m_iGraphBuilder = (IGraphBuilder)comObj; comObj = null; | |
50 | + _iGraphBuilder = (IGraphBuilder)comObj; comObj = null; | |
35 | 51 | |
36 | - m_iMediaControl = (IMediaControl)m_iGraphBuilder; | |
37 | - m_iMediaSeeking = (IMediaSeeking)m_iGraphBuilder; | |
38 | - m_iMediaEventEx = (IMediaEventEx)m_iGraphBuilder; | |
39 | - m_iBasicAudio = (IBasicAudio)m_iGraphBuilder; | |
52 | + _iMediaControl = (IMediaControl)_iGraphBuilder; | |
53 | + _iMediaSeeking = (IMediaSeeking)_iGraphBuilder; | |
54 | + _iMediaEventEx = (IMediaEventEx)_iGraphBuilder; | |
55 | + _iBasicAudio = (IBasicAudio)_iGraphBuilder; | |
40 | 56 | #if DEBUG |
41 | - int result = ROT.AddToRot(m_iGraphBuilder, out m_register); | |
57 | + int result = ROT.AddToRot(_iGraphBuilder, out _register); | |
42 | 58 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
43 | 59 | #endif |
44 | 60 | } |
@@ -49,20 +65,20 @@ | ||
49 | 65 | public void ExitInstance() |
50 | 66 | { |
51 | 67 | #if DEBUG |
52 | - ROT.RemoveFromRot(ref m_register); | |
68 | + ROT.RemoveFromRot(ref _register); | |
53 | 69 | #endif |
54 | - if (m_iGraphBuilder != null) | |
55 | - Marshal.ReleaseComObject(m_iGraphBuilder); m_iGraphBuilder = null; | |
56 | - if (m_iMediaControl != null) | |
57 | - Marshal.ReleaseComObject(m_iMediaControl); m_iMediaControl = null; | |
58 | - if (m_iMediaSeeking != null) | |
59 | - Marshal.ReleaseComObject(m_iMediaSeeking); m_iMediaSeeking = null; | |
60 | - if (m_iMediaEventEx != null) | |
61 | - Marshal.ReleaseComObject(m_iMediaEventEx); m_iMediaEventEx = null; | |
62 | - if (m_iBasicAudio != null) | |
63 | - Marshal.ReleaseComObject(m_iBasicAudio); m_iBasicAudio = null; | |
70 | + if (_iGraphBuilder != null) | |
71 | + Marshal.ReleaseComObject(_iGraphBuilder); _iGraphBuilder = null; | |
72 | + if (_iMediaControl != null) | |
73 | + Marshal.ReleaseComObject(_iMediaControl); _iMediaControl = null; | |
74 | + if (_iMediaSeeking != null) | |
75 | + Marshal.ReleaseComObject(_iMediaSeeking); _iMediaSeeking = null; | |
76 | + if (_iMediaEventEx != null) | |
77 | + Marshal.ReleaseComObject(_iMediaEventEx); _iMediaEventEx = null; | |
78 | + if (_iBasicAudio != null) | |
79 | + Marshal.ReleaseComObject(_iBasicAudio); _iBasicAudio = null; | |
64 | 80 | |
65 | - m_renderFile = false; | |
81 | + _renderFile = false; | |
66 | 82 | } |
67 | 83 | |
68 | 84 | // ////////////////////////////////////////////////////////////////// |
@@ -72,7 +88,7 @@ | ||
72 | 88 | { |
73 | 89 | int result = HResult.OK; |
74 | 90 | |
75 | - if (m_iGraphBuilder == null) | |
91 | + if (_iGraphBuilder == null) | |
76 | 92 | Marshal.ThrowExceptionForHR(HResult.NoInterface); |
77 | 93 | |
78 | 94 | if (IsWindowsMediaFile(strFilePath)) |
@@ -82,10 +98,10 @@ | ||
82 | 98 | } |
83 | 99 | else |
84 | 100 | { |
85 | - result = m_iGraphBuilder.RenderFile(strFilePath, null); | |
101 | + result = _iGraphBuilder.RenderFile(strFilePath, null); | |
86 | 102 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
87 | 103 | } |
88 | - m_renderFile = true; | |
104 | + _renderFile = true; | |
89 | 105 | } |
90 | 106 | |
91 | 107 | // ////////////////////////////////////////////////////////////////// |
@@ -102,7 +118,7 @@ | ||
102 | 118 | result = CreateFilter(CLSID.WMAsfReader, out iReader); |
103 | 119 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
104 | 120 | |
105 | - result = m_iGraphBuilder.AddFilter(iReader, "ASF Reader"); | |
121 | + result = _iGraphBuilder.AddFilter(iReader, "ASF Reader"); | |
106 | 122 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
107 | 123 | |
108 | 124 | iFS = (IFileSourceFilter)iReader; |
@@ -110,7 +126,7 @@ | ||
110 | 126 | result = iFS.Load(strFilePath, null); |
111 | 127 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
112 | 128 | |
113 | - result = RenderOutputPins(m_iGraphBuilder, iReader); | |
129 | + result = RenderOutputPins(_iGraphBuilder, iReader); | |
114 | 130 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
115 | 131 | } |
116 | 132 | catch (Exception) |
@@ -193,18 +209,18 @@ | ||
193 | 209 | |
194 | 210 | public void SetNotifyWindow(IntPtr hWnd) |
195 | 211 | { |
196 | - if (m_iMediaEventEx == null) | |
212 | + if (_iMediaEventEx == null) | |
197 | 213 | Marshal.ThrowExceptionForHR(HResult.NoInterface); |
198 | 214 | |
199 | - int result = m_iMediaEventEx.SetNotifyWindow(hWnd, WM.GraphNotify, 0); | |
215 | + int result = _iMediaEventEx.SetNotifyWindow(hWnd, WM.GraphNotify, 0); | |
200 | 216 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
201 | 217 | } |
202 | 218 | |
203 | 219 | public void ClearNotifyWindow() |
204 | 220 | { |
205 | - if (m_iMediaEventEx == null) return; | |
221 | + if (_iMediaEventEx == null) return; | |
206 | 222 | |
207 | - int result = m_iMediaEventEx.SetNotifyWindow(IntPtr.Zero, 0, 0); | |
223 | + int result = _iMediaEventEx.SetNotifyWindow(IntPtr.Zero, 0, 0); | |
208 | 224 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
209 | 225 | } |
210 | 226 |
@@ -213,29 +229,29 @@ | ||
213 | 229 | |
214 | 230 | public void StartPlay() |
215 | 231 | { |
216 | - if (m_filterState == FilterState.Running) return; | |
232 | + if (_filterState == FilterState.Running) return; | |
217 | 233 | |
218 | - if (m_iMediaControl == null) | |
234 | + if (_iMediaControl == null) | |
219 | 235 | Marshal.ThrowExceptionForHR(HResult.NoInterface); |
220 | 236 | |
221 | - int result = m_iMediaControl.Run(); | |
237 | + int result = _iMediaControl.Run(); | |
222 | 238 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
223 | 239 | |
224 | - m_filterState = FilterState.Running; | |
240 | + _filterState = FilterState.Running; | |
225 | 241 | } |
226 | 242 | |
227 | 243 | // ////////////////////////////////////////////////////////////////// |
228 | 244 | public void StopPlay() |
229 | 245 | { |
230 | - if (m_filterState == FilterState.Stopped) return; | |
246 | + if (_filterState == FilterState.Stopped) return; | |
231 | 247 | |
232 | - if (m_iMediaControl == null) | |
248 | + if (_iMediaControl == null) | |
233 | 249 | Marshal.ThrowExceptionForHR(HResult.NoInterface); |
234 | 250 | |
235 | - int result = m_iMediaControl.Stop(); | |
251 | + int result = _iMediaControl.Stop(); | |
236 | 252 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
237 | 253 | |
238 | - m_filterState = FilterState.Stopped; | |
254 | + _filterState = FilterState.Stopped; | |
239 | 255 | } |
240 | 256 | |
241 | 257 | // ////////////////////////////////////////////////////////////////// |
@@ -243,10 +259,10 @@ | ||
243 | 259 | |
244 | 260 | public void WaitForStop() |
245 | 261 | { |
246 | - if (m_iMediaControl == null) return; | |
262 | + if (_iMediaControl == null) return; | |
247 | 263 | |
248 | 264 | FilterState fs; |
249 | - int result = m_iMediaControl.GetState(500, out fs); | |
265 | + int result = _iMediaControl.GetState(500, out fs); | |
250 | 266 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
251 | 267 | } |
252 | 268 |
@@ -255,7 +271,7 @@ | ||
255 | 271 | |
256 | 272 | public int SeekPosition(int position) |
257 | 273 | { |
258 | - if (m_iMediaSeeking == null) return HResult.OK; | |
274 | + if (_iMediaSeeking == null) return HResult.OK; | |
259 | 275 | |
260 | 276 | int result = HResult.OK; |
261 | 277 |
@@ -262,7 +278,7 @@ | ||
262 | 278 | try |
263 | 279 | { |
264 | 280 | ReferenceTime current = new ReferenceTime(position * TimeSpan.TicksPerSecond); |
265 | - result = m_iMediaSeeking.SetPositions(current, SeekingFlags.AbsolutePositioning, null, 0); | |
281 | + result = _iMediaSeeking.SetPositions(current, SeekingFlags.AbsolutePositioning, null, 0); | |
266 | 282 | if (HResult.Failed(result)) Marshal.ThrowExceptionForHR(result); |
267 | 283 | } |
268 | 284 | catch (Exception) |
@@ -279,11 +295,11 @@ | ||
279 | 295 | EvCode lEventCode; |
280 | 296 | int lParam1, lParam2; |
281 | 297 | |
282 | - if (m_iMediaEventEx == null) return false; | |
298 | + if (_iMediaEventEx == null) return false; | |
283 | 299 | |
284 | - while (HResult.Succeeded(m_iMediaEventEx.GetEvent(out lEventCode, out lParam1, out lParam2, 0))) | |
300 | + while (HResult.Succeeded(_iMediaEventEx.GetEvent(out lEventCode, out lParam1, out lParam2, 0))) | |
285 | 301 | { |
286 | - m_iMediaEventEx.FreeEventParams(lEventCode, lParam1, lParam2); | |
302 | + _iMediaEventEx.FreeEventParams(lEventCode, lParam1, lParam2); | |
287 | 303 | |
288 | 304 | switch (lEventCode) |
289 | 305 | { |
@@ -301,7 +317,7 @@ | ||
301 | 317 | |
302 | 318 | public bool IsRenderFile() |
303 | 319 | { |
304 | - return m_renderFile; | |
320 | + return _renderFile; | |
305 | 321 | } |
306 | 322 | |
307 | 323 | // ////////////////////////////////////////////////////////////////// |
@@ -309,7 +325,7 @@ | ||
309 | 325 | |
310 | 326 | public FilterState GetState() |
311 | 327 | { |
312 | - return m_filterState; | |
328 | + return _filterState; | |
313 | 329 | } |
314 | 330 | |
315 | 331 | // ////////////////////////////////////////////////////////////////// |