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
28 CTID(WindowsMediaPlayer)
31 #define XIID(iface) iface ## _tid,
32 #define CTID(name) name ## _tid,
39 HRESULT
get_typeinfo(typeinfo_id tid
, ITypeInfo
**typeinfo
);
42 IConnectionPoint IConnectionPoint_iface
;
44 IConnectionPointContainer
*container
;
53 IWMPMedia IWMPMedia_iface
;
64 IWMPPlaylist IWMPPlaylist_iface
;
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
;
88 IOleClientSite
*client_site
;
93 VARIANT_BOOL auto_start
;
94 VARIANT_BOOL invoke_urls
;
95 VARIANT_BOOL enable_error_dialogs
;
98 ConnectionPoint
*wmpocx
;
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 */
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
)
137 *p
= SysAllocString(value
);
139 return E_OUTOFMEMORY
;