setupapi: Use SetupGetIntField() in SetupGetSourceFileLocation().
[wine.git] / dlls / wmp / wmp_private.h
blobb5e580d91cac6f16764bfdf9ad4c552c02a5ece9
1 /*
2 * Copyright 2014 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define COBJMACROS
21 #include "windows.h"
22 #include "ole2.h"
23 #include "dshow.h"
24 #include "wmp.h"
26 #define TID_LIST \
27 XIID(NULL) \
28 CTID(WindowsMediaPlayer)
30 typedef enum {
31 #define XIID(iface) iface ## _tid,
32 #define CTID(name) name ## _tid,
33 TID_LIST
34 #undef XIID
35 #undef CTID
36 LAST_tid
37 } typeinfo_id;
39 HRESULT get_typeinfo(typeinfo_id tid, ITypeInfo **typeinfo);
41 typedef struct {
42 IConnectionPoint IConnectionPoint_iface;
44 IConnectionPointContainer *container;
46 IDispatch **sinks;
47 DWORD sinks_size;
49 IID iid;
50 } ConnectionPoint;
52 typedef struct {
53 IWMPMedia IWMPMedia_iface;
55 LONG ref;
57 WCHAR *url;
58 WCHAR *name;
60 DOUBLE duration;
61 } WMPMedia;
63 typedef struct {
64 IWMPPlaylist IWMPPlaylist_iface;
66 LONG ref;
67 LONG count;
69 WCHAR *url;
70 WCHAR *name;
71 } WMPPlaylist;
73 struct WindowsMediaPlayer {
74 IOleObject IOleObject_iface;
75 IProvideClassInfo2 IProvideClassInfo2_iface;
76 IPersistStreamInit IPersistStreamInit_iface;
77 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
78 IConnectionPointContainer IConnectionPointContainer_iface;
79 IOleControl IOleControl_iface;
80 IWMPPlayer4 IWMPPlayer4_iface;
81 IWMPPlayer IWMPPlayer_iface;
82 IWMPSettings IWMPSettings_iface;
83 IWMPControls IWMPControls_iface;
84 IWMPNetwork IWMPNetwork_iface;
86 LONG ref;
88 IOleClientSite *client_site;
89 HWND hwnd;
90 SIZEL extent;
92 /* Settings */
93 VARIANT_BOOL auto_start;
94 VARIANT_BOOL invoke_urls;
95 VARIANT_BOOL enable_error_dialogs;
96 LONG volume;
98 ConnectionPoint *wmpocx;
100 WMPMedia *media;
101 WMPPlaylist *playlist;
103 /* DirectShow stuff */
104 IGraphBuilder* filter_graph;
105 IMediaControl* media_control;
106 IMediaEvent* media_event;
107 IMediaSeeking* media_seeking;
108 IBasicAudio* basic_audio;
110 /* Async event notification */
111 HWND msg_window;
114 BOOL init_player(WindowsMediaPlayer*);
115 void destroy_player(WindowsMediaPlayer*);
116 WMPMedia *unsafe_impl_from_IWMPMedia(IWMPMedia *iface);
117 WMPPlaylist *unsafe_impl_from_IWMPPlaylist(IWMPPlaylist *iface);
118 HRESULT create_media_from_url(BSTR url, double duration, IWMPMedia **ppMedia);
119 HRESULT create_playlist(BSTR name, BSTR url, LONG count, IWMPPlaylist **ppPlaylist);
120 void ConnectionPointContainer_Init(WindowsMediaPlayer *wmp);
121 void ConnectionPointContainer_Destroy(WindowsMediaPlayer *wmp);
122 void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams);
124 HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**);
126 void unregister_wmp_class(void);
127 void unregister_player_msg_class(void);
129 extern HINSTANCE wmp_instance;
131 static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
133 if(!p)
134 return E_POINTER;
136 if(value) {
137 *p = SysAllocString(value);
138 if(!*p)
139 return E_OUTOFMEMORY;
140 }else {
141 *p = NULL;
144 return S_OK;