OSDN Git Service

1682c37b444f38654fec3c69786144061eb29339
[winaudioj/winwrapper.git] / winwrapper / application.h
1 #pragma once\r
2 /*\r
3   ==============================================================================\r
4 \r
5    This file is part of the async\r
6    Copyright 2005-10 by Satoshi Fujiwara.\r
7 \r
8    async can be redistributed and/or modified under the terms of the\r
9    GNU General Public License, as published by the Free Software Foundation;\r
10    either version 2 of the License, or (at your option) any later version.\r
11 \r
12    async is distributed in the hope that it will be useful,\r
13    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15    GNU General Public License for more details.\r
16 \r
17    You should have received a copy of the GNU General Public License\r
18    along with async; if not, visit www.gnu.org/licenses or write to the\r
19    Free Software Foundation, Inc., 59 Temple Place, Suite 330, \r
20    Boston, MA 02111-1307 USA\r
21 \r
22   ==============================================================================\r
23 */\r
24 #include "singleton.h"\r
25 #include "exception.h"\r
26 #include "sf_memory.h"\r
27 #include "test_window.h"\r
28 \r
29 namespace sf {\r
30 class application : public singleton<application>\r
31 {\r
32 public:\r
33   struct exception\r
34     : public sf::win32_error_exception \r
35   {\r
36     exception(uint32_t hr) : win32_error_exception(hr) {};\r
37     exception() : win32_error_exception() {} ;\r
38   };\r
39 \r
40  \r
41   application();\r
42   ~application();\r
43   \r
44   int execute(HINSTANCE hInstance,\r
45                      HINSTANCE hPrevInstance,\r
46                      LPTSTR    lpCmdLine,\r
47                      int       nCmdShow);\r
48   \r
49 \r
50   std::wstring& app_id(){return app_id_;};\r
51   HINSTANCE instance_handle() {return instance_handle_;};\r
52   \r
53   // アプリケーションのカレントディレクトリを返す\r
54   const std::wstring& base_directory() const { return base_directory_; }\r
55 \r
56  \r
57 // ----------------------------------------\r
58 private:\r
59 // ----------------------------------------\r
60 \r
61   //void wasapi_setup();\r
62   HINSTANCE instance_handle_;\r
63   int return_code_;\r
64   \r
65 //---------------------------------------\r
66 // ファイル読取り関係\r
67 //---------------------------------------\r
68 public:\r
69 \r
70 private:\r
71 \r
72   std::wstring base_directory_;\r
73   std::unique_ptr<test_window> window_;\r
74 //--------------------------------\r
75 // シーケンサ\r
76 //--------------------------------\r
77 public:\r
78 private:\r
79   static std::wstring app_id_;\r
80   static const int WAIT_TIMEOUT_DEFAULT = 100; \r
81 };\r
82 }\r
83 \r