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
22 #include "wine/heap.h"
29 CTID(WindowsMediaPlayer)
32 #define XIID(iface) iface ## _tid,
33 #define CTID(name) name ## _tid,
40 HRESULT
get_typeinfo(typeinfo_id tid
, ITypeInfo
**typeinfo
) DECLSPEC_HIDDEN
;
43 IConnectionPoint IConnectionPoint_iface
;
45 IConnectionPointContainer
*container
;
54 IWMPMedia IWMPMedia_iface
;
65 IWMPPlaylist IWMPPlaylist_iface
;
74 struct WindowsMediaPlayer
{
75 IOleObject IOleObject_iface
;
76 IProvideClassInfo2 IProvideClassInfo2_iface
;
77 IPersistStreamInit IPersistStreamInit_iface
;
78 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface
;
79 IConnectionPointContainer IConnectionPointContainer_iface
;
80 IOleControl IOleControl_iface
;
81 IWMPPlayer4 IWMPPlayer4_iface
;
82 IWMPPlayer IWMPPlayer_iface
;
83 IWMPSettings IWMPSettings_iface
;
84 IWMPControls IWMPControls_iface
;
85 IWMPNetwork IWMPNetwork_iface
;
89 IOleClientSite
*client_site
;
94 VARIANT_BOOL auto_start
;
95 VARIANT_BOOL invoke_urls
;
96 VARIANT_BOOL enable_error_dialogs
;
99 ConnectionPoint
*wmpocx
;
102 WMPPlaylist
*playlist
;
104 /* DirectShow stuff */
105 IGraphBuilder
* filter_graph
;
106 IMediaControl
* media_control
;
107 IMediaEvent
* media_event
;
108 IMediaSeeking
* media_seeking
;
109 IBasicAudio
* basic_audio
;
111 /* Async event notification */
115 BOOL
init_player(WindowsMediaPlayer
*) DECLSPEC_HIDDEN
;
116 void destroy_player(WindowsMediaPlayer
*) DECLSPEC_HIDDEN
;
117 WMPMedia
*unsafe_impl_from_IWMPMedia(IWMPMedia
*iface
) DECLSPEC_HIDDEN
;
118 WMPPlaylist
*unsafe_impl_from_IWMPPlaylist(IWMPPlaylist
*iface
) DECLSPEC_HIDDEN
;
119 HRESULT
create_media_from_url(BSTR url
, double duration
, IWMPMedia
**ppMedia
) DECLSPEC_HIDDEN
;
120 HRESULT
create_playlist(BSTR name
, BSTR url
, LONG count
, IWMPPlaylist
**ppPlaylist
) DECLSPEC_HIDDEN
;
121 void ConnectionPointContainer_Init(WindowsMediaPlayer
*wmp
) DECLSPEC_HIDDEN
;
122 void ConnectionPointContainer_Destroy(WindowsMediaPlayer
*wmp
) DECLSPEC_HIDDEN
;
123 void call_sink(ConnectionPoint
*This
, DISPID dispid
, DISPPARAMS
*dispparams
) DECLSPEC_HIDDEN
;
125 HRESULT WINAPI
WMPFactory_CreateInstance(IClassFactory
*,IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
127 void unregister_wmp_class(void) DECLSPEC_HIDDEN
;
128 void unregister_player_msg_class(void) DECLSPEC_HIDDEN
;
130 extern HINSTANCE wmp_instance DECLSPEC_HIDDEN
;
132 static inline WCHAR
*heap_strdupW(const WCHAR
*str
)
137 size_t size
= lstrlenW(str
)+1;
138 ret
= heap_alloc(size
*sizeof(WCHAR
));
140 memcpy(ret
, str
, size
*sizeof(WCHAR
));
148 static inline HRESULT
return_bstr(const WCHAR
*value
, BSTR
*p
)
154 *p
= SysAllocString(value
);
156 return E_OUTOFMEMORY
;