The Winamp Remote Control suite
a remote control client and plugin for Winamp 2.x, 5.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rpcthreadDLL.cpp
Go to the documentation of this file.
1 /*
2 winamp remote control suite ŠPatrick Michael Martin 2000, 2001, 2002
3 
4 Copyright (C) 2000,2001,2002 Patrick M. Martin
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 Patrick M. Martin may be reached by email at patrickmmartin@gmail.com.
21 */
22 
23 #include <vcl.h>
24 #pragma hdrstop
25 #include <malloc.h>
26 #include <stdio.h>
27 
28 #include "rpcthreadDLL.h"
29 #pragma package(smart_init)
30 
31 // winamp interface definitions
32 #include "waint.h"
33 
34 // call observer interface
35 #include "ICallObserver.h"
36 
37 // bring in the Winamp interfaces
38 #include "WinampServerImpl.h"
39 
40 #include "RPCExecutor.h"
41 
42 using namespace WinampRemote::Server;
43 
45 
46 using namespace WinampRemote::Remoting;
47 
48 __fastcall TRPCServerDLLThread::TRPCServerDLLThread(bool CreateSuspended, HWND pluginhwnd, const char * protocolSequence)
49  : TThread(CreateSuspended), m_pluginhwnd(pluginhwnd), m_protocolSequence(protocolSequence)
50 {
51 }
52 
54 {
55  // supply the in-process winamp implementation
57  // TODO: implement notification to the UI
58  StubCallObserver observer;
59 
60  observer.notifyStatus("testserver starting");
61 
62  // for this server, no need for another thread, simply block on this
64  executor.setWinampServer(&localWinamp);
65  executor.setCallObserver(&observer);
66  executor.Execute();
67 
68 }