CLAM-Development
1.1
|
00001 /* 00002 * Copyright (c) 2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 #ifndef __WIN32CONSOLEAPP__ 00023 #define __WIN32CONSOLEAPP__ 00024 00025 #ifndef WIN32 00026 #error "Hey you, Linux User! You shouldn't be including this thing" 00027 #endif 00028 00029 #include "BaseAudioApplication.hxx" 00030 #include "CLAM_windows.h" 00031 #undef GetClassName 00032 #undef CreateWindow 00033 00034 namespace CLAM 00035 { 00036 00037 #ifdef WIN32 00038 00039 // :MRJ:TODO: I don't know why DirectXAudioDevice class hasn't the static pointer already defined 00040 // instead of relying that responsability to such a concrete class as DXFullDuplex. While I haven't 00041 // got some time to rework the thing we will need the following ugly kludge... 00042 00043 class DXFullDuplex; 00044 00045 template <typename DXDeviceType> 00046 void DXHook( DXDeviceType* homemade_tmpl_func_overload, void* wndhndler ) 00047 { 00048 DXDeviceType::shMainWnd = (HWND)wndhndler; 00049 } 00050 00051 #define DXFullDuplexHook( handler ) DXHook( (DXFullDuplex*)NULL, handler ) 00052 00053 #endif 00054 00055 00056 class Win32ConsoleApp 00057 : public BaseAudioApplication 00058 { 00059 public: 00060 00061 Win32ConsoleApp() 00062 { 00063 } 00064 00065 virtual ~Win32ConsoleApp() 00066 { 00067 } 00068 00069 00070 void Run( int argc = 0, char** argv = 0 ); 00071 virtual void UserMain(void); 00072 virtual void AudioMain(void) = 0; 00073 static HWND GetHandle( void ); 00074 00075 private: 00076 00077 virtual void AppCleanup(void) 00078 { 00079 } 00080 00081 }; 00082 00083 00084 00085 00086 } 00087 00088 #endif // Win32ConsoleApp.hxx 00089