wmp: Add seeking and duration.
[wine.git] / dlls / wmp / wmp_private.h
blobe8d534803fcda81518ea0b26a97d5a8b990d49aa
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 "wine/heap.h"
23 #include "wine/unicode.h"
24 #include "ole2.h"
25 #include "dshow.h"
26 #include "wmp.h"
28 typedef struct {
29 IConnectionPoint IConnectionPoint_iface;
31 IConnectionPointContainer *container;
33 IDispatch **sinks;
34 DWORD sinks_size;
36 IID iid;
37 } ConnectionPoint;
39 typedef struct {
40 IWMPMedia IWMPMedia_iface;
42 LONG ref;
44 WCHAR *url;
46 DOUBLE duration;
47 } WMPMedia;
49 struct WindowsMediaPlayer {
50 IOleObject IOleObject_iface;
51 IProvideClassInfo2 IProvideClassInfo2_iface;
52 IPersistStreamInit IPersistStreamInit_iface;
53 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
54 IConnectionPointContainer IConnectionPointContainer_iface;
55 IOleControl IOleControl_iface;
56 IWMPPlayer4 IWMPPlayer4_iface;
57 IWMPPlayer IWMPPlayer_iface;
58 IWMPSettings IWMPSettings_iface;
59 IWMPControls IWMPControls_iface;
60 IWMPNetwork IWMPNetwork_iface;
62 LONG ref;
64 IOleClientSite *client_site;
65 HWND hwnd;
66 SIZEL extent;
68 /* Settings */
69 VARIANT_BOOL auto_start;
70 VARIANT_BOOL invoke_urls;
71 VARIANT_BOOL enable_error_dialogs;
73 ConnectionPoint *wmpocx;
75 IWMPMedia *wmpmedia;
77 /* DirectShow stuff */
78 IGraphBuilder* filter_graph;
79 IMediaControl* media_control;
80 IMediaEvent* media_event;
81 IMediaSeeking* media_seeking;
83 /* Async event notification */
84 HWND msg_window;
87 BOOL init_player(WindowsMediaPlayer*) DECLSPEC_HIDDEN;
88 void destroy_player(WindowsMediaPlayer*) DECLSPEC_HIDDEN;
89 WMPMedia *unsafe_impl_from_IWMPMedia(IWMPMedia *iface) DECLSPEC_HIDDEN;
90 HRESULT create_media_from_url(BSTR url, IWMPMedia **ppMedia) DECLSPEC_HIDDEN;
91 void ConnectionPointContainer_Init(WindowsMediaPlayer *wmp) DECLSPEC_HIDDEN;
92 void ConnectionPointContainer_Destroy(WindowsMediaPlayer *wmp) DECLSPEC_HIDDEN;
93 void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams) DECLSPEC_HIDDEN;
95 HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
97 void unregister_wmp_class(void) DECLSPEC_HIDDEN;
98 void unregister_player_msg_class(void) DECLSPEC_HIDDEN;
100 extern HINSTANCE wmp_instance DECLSPEC_HIDDEN;
102 static inline WCHAR *heap_strdupW(const WCHAR *str)
104 WCHAR *ret;
106 if(str) {
107 size_t size = strlenW(str)+1;
108 ret = heap_alloc(size*sizeof(WCHAR));
109 if(ret)
110 memcpy(ret, str, size*sizeof(WCHAR));
111 }else {
112 ret = NULL;
115 return ret;