Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Steve Lhomme
VLC
Commits
3d831e04
Commit
3d831e04
authored
Mar 02, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid \r\n problems between platforms
parent
cb1f0667
Changes
105
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
105 changed files
with
10417 additions
and
10417 deletions
+10417
-10417
activex/axvlc_idl.c
activex/axvlc_idl.c
+53
-53
activex/axvlc_idl.h
activex/axvlc_idl.h
+926
-926
activex/connectioncontainer.cpp
activex/connectioncontainer.cpp
+287
-287
activex/connectioncontainer.h
activex/connectioncontainer.h
+116
-116
activex/main.cpp
activex/main.cpp
+403
-403
activex/objectsafety.cpp
activex/objectsafety.cpp
+92
-92
activex/objectsafety.h
activex/objectsafety.h
+99
-99
activex/olecontrol.cpp
activex/olecontrol.cpp
+133
-133
activex/olecontrol.h
activex/olecontrol.h
+65
-65
activex/oleinplaceactiveobject.cpp
activex/oleinplaceactiveobject.cpp
+74
-74
activex/oleinplaceactiveobject.h
activex/oleinplaceactiveobject.h
+71
-71
activex/oleinplaceobject.cpp
activex/oleinplaceobject.cpp
+126
-126
activex/oleinplaceobject.h
activex/oleinplaceobject.h
+68
-68
activex/oleobject.cpp
activex/oleobject.cpp
+339
-339
activex/oleobject.h
activex/oleobject.h
+86
-86
activex/persistpropbag.cpp
activex/persistpropbag.cpp
+125
-125
activex/persistpropbag.h
activex/persistpropbag.h
+67
-67
activex/persiststorage.cpp
activex/persiststorage.cpp
+79
-79
activex/persiststorage.h
activex/persiststorage.h
+70
-70
activex/persiststreaminit.cpp
activex/persiststreaminit.cpp
+70
-70
activex/persiststreaminit.h
activex/persiststreaminit.h
+69
-69
activex/plugin.cpp
activex/plugin.cpp
+774
-774
activex/plugin.h
activex/plugin.h
+167
-167
activex/provideclassinfo.cpp
activex/provideclassinfo.cpp
+60
-60
activex/provideclassinfo.h
activex/provideclassinfo.h
+65
-65
activex/utils.cpp
activex/utils.cpp
+101
-101
activex/utils.h
activex/utils.h
+181
-181
activex/vlccontrol.cpp
activex/vlccontrol.cpp
+662
-662
activex/vlccontrol.h
activex/vlccontrol.h
+100
-100
include/beos_specific.h
include/beos_specific.h
+1
-1
include/charset.h
include/charset.h
+1
-1
include/intf_eject.h
include/intf_eject.h
+1
-1
include/iso_lang.h
include/iso_lang.h
+1
-1
include/os_specific.h
include/os_specific.h
+1
-1
include/vlc/aout.h
include/vlc/aout.h
+1
-1
include/vlc/sout.h
include/vlc/sout.h
+1
-1
include/vlc_bits.h
include/vlc_bits.h
+1
-1
include/vlc_cpu.h
include/vlc_cpu.h
+1
-1
include/vlc_error.h
include/vlc_error.h
+1
-1
include/vlc_messages.h
include/vlc_messages.h
+1
-1
include/win32_specific.h
include/win32_specific.h
+1
-1
modules/access/screen/beos.cpp
modules/access/screen/beos.cpp
+1
-1
modules/access/v4l/videodev_mjpeg.h
modules/access/v4l/videodev_mjpeg.h
+1
-1
modules/access/vcd/cdrom.c
modules/access/vcd/cdrom.c
+1
-1
modules/access/vcd/cdrom.h
modules/access/vcd/cdrom.h
+1
-1
modules/access/vcd/cdrom_internals.h
modules/access/vcd/cdrom_internals.h
+1
-1
modules/audio_filter/equalizer_presets.h
modules/audio_filter/equalizer_presets.h
+1
-1
modules/audio_filter/resampler/bandlimited.h
modules/audio_filter/resampler/bandlimited.h
+1
-1
modules/codec/ffmpeg/video.c
modules/codec/ffmpeg/video.c
+881
-881
modules/demux/avi/libavi.c
modules/demux/avi/libavi.c
+1
-1
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/AudioOutput.cpp
+1
-1
modules/gui/beos/Bitmaps.h
modules/gui/beos/Bitmaps.h
+1
-1
modules/gui/beos/DrawingTidbits.cpp
modules/gui/beos/DrawingTidbits.cpp
+1
-1
modules/gui/beos/DrawingTidbits.h
modules/gui/beos/DrawingTidbits.h
+1
-1
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/PreferencesWindow.cpp
+1
-1
modules/gui/beos/PreferencesWindow.h
modules/gui/beos/PreferencesWindow.h
+1
-1
modules/gui/beos/TransportButton.cpp
modules/gui/beos/TransportButton.cpp
+1
-1
modules/gui/beos/TransportButton.h
modules/gui/beos/TransportButton.h
+1
-1
modules/gui/gtk/common.h
modules/gui/gtk/common.h
+1
-1
modules/gui/gtk/control.h
modules/gui/gtk/control.h
+1
-1
modules/gui/gtk/display.h
modules/gui/gtk/display.h
+1
-1
modules/gui/gtk/gtk_callbacks.h
modules/gui/gtk/gtk_callbacks.h
+1
-1
modules/gui/gtk/menu.h
modules/gui/gtk/menu.h
+1
-1
modules/gui/gtk/modules.c
modules/gui/gtk/modules.c
+1
-1
modules/gui/gtk/modules.h
modules/gui/gtk/modules.h
+1
-1
modules/gui/gtk/open.h
modules/gui/gtk/open.h
+1
-1
modules/gui/gtk/playlist.h
modules/gui/gtk/playlist.h
+1
-1
modules/gui/gtk/preferences.c
modules/gui/gtk/preferences.c
+1
-1
modules/gui/gtk/preferences.h
modules/gui/gtk/preferences.h
+1
-1
modules/gui/gtk/sout.c
modules/gui/gtk/sout.c
+1
-1
modules/gui/kde/QConfigItem.cpp
modules/gui/kde/QConfigItem.cpp
+1
-1
modules/gui/kde/QConfigItem.h
modules/gui/kde/QConfigItem.h
+1
-1
modules/gui/kde/info.h
modules/gui/kde/info.h
+1
-1
modules/gui/kde/languagemenu.cpp
modules/gui/kde/languagemenu.cpp
+1
-1
modules/gui/kde/languagemenu.h
modules/gui/kde/languagemenu.h
+1
-1
modules/gui/kde/messages.cpp
modules/gui/kde/messages.cpp
+1
-1
modules/gui/kde/messages.h
modules/gui/kde/messages.h
+1
-1
modules/gui/kde/pluginsbox.cpp
modules/gui/kde/pluginsbox.cpp
+1
-1
modules/gui/kde/pluginsbox.h
modules/gui/kde/pluginsbox.h
+1
-1
modules/gui/kde/preferences.cpp
modules/gui/kde/preferences.cpp
+1
-1
modules/gui/kde/preferences.h
modules/gui/kde/preferences.h
+1
-1
modules/gui/pda/pda.h
modules/gui/pda/pda.h
+1
-1
modules/gui/pda/pda_callbacks.h
modules/gui/pda/pda_callbacks.h
+1
-1
modules/gui/qt/intf.h
modules/gui/qt/intf.h
+1
-1
modules/gui/wxwindows/wizard.cpp
modules/gui/wxwindows/wizard.cpp
+1661
-1661
modules/misc/dummy/aout.c
modules/misc/dummy/aout.c
+1
-1
modules/misc/dummy/dummy.h
modules/misc/dummy/dummy.h
+1
-1
modules/misc/dummy/encoder.c
modules/misc/dummy/encoder.c
+1
-1
modules/misc/dummy/interface.c
modules/misc/dummy/interface.c
+1
-1
modules/misc/gtk_main.c
modules/misc/gtk_main.c
+1
-1
modules/misc/memcpy/fastmemcpy.h
modules/misc/memcpy/fastmemcpy.h
+1
-1
modules/misc/testsuite/test1.c
modules/misc/testsuite/test1.c
+1
-1
modules/misc/testsuite/test2.cpp
modules/misc/testsuite/test2.cpp
+1
-1
modules/misc/testsuite/test4.c
modules/misc/testsuite/test4.c
+1
-1
modules/mux/mpeg/bits.h
modules/mux/mpeg/bits.h
+1
-1
modules/mux/mpeg/csa.h
modules/mux/mpeg/csa.h
+1
-1
modules/stream_out/transrate/block.c
modules/stream_out/transrate/block.c
+1
-1
modules/video_chroma/i420_rgb_c.h
modules/video_chroma/i420_rgb_c.h
+1
-1
modules/video_filter/marq.c
modules/video_filter/marq.c
+329
-329
modules/video_output/directx/glwin32.c
modules/video_output/directx/glwin32.c
+473
-473
modules/video_output/qte/qte.h
modules/video_output/qte/qte.h
+1
-1
modules/video_output/svgalib.c
modules/video_output/svgalib.c
+1
-1
share/newres.h
share/newres.h
+39
-39
share/resource.h
share/resource.h
+31
-31
src/input/es_out.c
src/input/es_out.c
+1406
-1406
No files found.
activex/axvlc_idl.c
View file @
3d831e04
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Thu Feb 17 09:25:54 2005
*/
/* Compiler settings for axvlc.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef
struct
_IID
{
unsigned
long
x
;
unsigned
short
s1
;
unsigned
short
s2
;
unsigned
char
c
[
8
];
}
IID
;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef
IID
CLSID
;
#endif // CLSID_DEFINED
const
IID
LIBID_AXVLC
=
{
0xDF2BBE39
,
0x40A8
,
0x433b
,{
0xA2
,
0x79
,
0x07
,
0x3F
,
0x48
,
0xDA
,
0x94
,
0xB6
}};
const
IID
IID_IVLCControl
=
{
0xC2FA41D0
,
0xB113
,
0x476e
,{
0xAC
,
0x8C
,
0x9B
,
0xD1
,
0x49
,
0x99
,
0xC1
,
0xC1
}};
const
IID
DIID_DVLCEvents
=
{
0xDF48072F
,
0x5EF8
,
0x434e
,{
0x9B
,
0x40
,
0xE2
,
0xF3
,
0xAE
,
0x75
,
0x9B
,
0x5F
}};
const
CLSID
CLSID_VLCPlugin
=
{
0xE23FE9C6
,
0x778E
,
0x49D4
,{
0xB5
,
0x37
,
0x38
,
0xFC
,
0xDE
,
0x48
,
0x87
,
0xD8
}};
#ifdef __cplusplus
}
#endif
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Thu Feb 17 09:25:54 2005
*/
/* Compiler settings for axvlc.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef
struct
_IID
{
unsigned
long
x
;
unsigned
short
s1
;
unsigned
short
s2
;
unsigned
char
c
[
8
];
}
IID
;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef
IID
CLSID
;
#endif // CLSID_DEFINED
const
IID
LIBID_AXVLC
=
{
0xDF2BBE39
,
0x40A8
,
0x433b
,{
0xA2
,
0x79
,
0x07
,
0x3F
,
0x48
,
0xDA
,
0x94
,
0xB6
}};
const
IID
IID_IVLCControl
=
{
0xC2FA41D0
,
0xB113
,
0x476e
,{
0xAC
,
0x8C
,
0x9B
,
0xD1
,
0x49
,
0x99
,
0xC1
,
0xC1
}};
const
IID
DIID_DVLCEvents
=
{
0xDF48072F
,
0x5EF8
,
0x434e
,{
0x9B
,
0x40
,
0xE2
,
0xF3
,
0xAE
,
0x75
,
0x9B
,
0x5F
}};
const
CLSID
CLSID_VLCPlugin
=
{
0xE23FE9C6
,
0x778E
,
0x49D4
,{
0xB5
,
0x37
,
0x38
,
0xFC
,
0xDE
,
0x48
,
0x87
,
0xD8
}};
#ifdef __cplusplus
}
#endif
activex/axvlc_idl.h
View file @
3d831e04
This diff is collapsed.
Click to expand it.
activex/connectioncontainer.cpp
View file @
3d831e04
/*****************************************************************************
* connectioncontainer.cpp: ActiveX control for VLC
*****************************************************************************
* Copyright (C) 2005 VideoLAN
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "plugin.h"
#include "connectioncontainer.h"
#include "utils.h"
using
namespace
std
;
////////////////////////////////////////////////////////////////////////////////////////////////
class
VLCEnumConnections
:
public
IEnumConnections
{
public:
VLCEnumConnections
(
vector
<
CONNECTDATA
>
&
v
)
:
e
(
VLCEnum
<
CONNECTDATA
>
(
IID_IEnumConnections
,
v
))
{
e
.
setRetainOperation
((
VLCEnum
<
CONNECTDATA
>::
retainer
)
&
retain
);
};
VLCEnumConnections
(
const
VLCEnumConnections
&
vlcEnum
)
:
e
(
vlcEnum
.
e
)
{};
virtual
~
VLCEnumConnections
()
{};
// IUnknown methods
STDMETHODIMP
QueryInterface
(
REFIID
riid
,
void
**
ppv
)
{
return
e
.
QueryInterface
(
riid
,
ppv
);
};
STDMETHODIMP_
(
ULONG
)
AddRef
(
void
)
{
return
e
.
AddRef
();
};
STDMETHODIMP_
(
ULONG
)
Release
(
void
)
{
return
e
.
Release
();
};
//IEnumConnectionPoints
STDMETHODIMP
Next
(
ULONG
celt
,
LPCONNECTDATA
rgelt
,
ULONG
*
pceltFetched
)
{
return
e
.
Next
(
celt
,
rgelt
,
pceltFetched
);
};
STDMETHODIMP
Skip
(
ULONG
celt
)
{
return
e
.
Skip
(
celt
);};
STDMETHODIMP
Reset
(
void
)
{
return
e
.
Reset
();};
STDMETHODIMP
Clone
(
LPENUMCONNECTIONS
*
ppenum
)
{
if
(
NULL
==
ppenum
)
return
E_POINTER
;
*
ppenum
=
dynamic_cast
<
LPENUMCONNECTIONS
>
(
new
VLCEnumConnections
(
*
this
));
return
(
NULL
!=
*
ppenum
)
?
S_OK
:
E_OUTOFMEMORY
;
};
private:
static
void
retain
(
CONNECTDATA
cd
)
{
cd
.
pUnk
->
AddRef
();
};
VLCEnum
<
CONNECTDATA
>
e
;
};
////////////////////////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
VLCConnectionPoint
::
GetConnectionInterface
(
IID
*
iid
)
{
if
(
NULL
==
iid
)
return
E_POINTER
;
*
iid
=
_iid
;
return
S_OK
;
};
STDMETHODIMP
VLCConnectionPoint
::
GetConnectionPointContainer
(
LPCONNECTIONPOINTCONTAINER
*
ppCPC
)
{
if
(
NULL
==
ppCPC
)
return
E_POINTER
;
_p_cpc
->
AddRef
();
*
ppCPC
=
_p_cpc
;
return
S_OK
;
};
STDMETHODIMP
VLCConnectionPoint
::
Advise
(
IUnknown
*
pUnk
,
DWORD
*
pdwCookie
)
{
if
(
(
NULL
==
pUnk
)
||
(
NULL
==
pdwCookie
)
)
return
E_POINTER
;
CONNECTDATA
cd
;
pUnk
->
AddRef
();
cd
.
pUnk
=
pUnk
;
*
pdwCookie
=
cd
.
dwCookie
=
_connections
.
size
();
_connections
.
push_back
(
cd
);
return
S_OK
;
};
STDMETHODIMP
VLCConnectionPoint
::
Unadvise
(
DWORD
pdwCookie
)
{
if
(
pdwCookie
<
_connections
.
size
()
)
{
CONNECTDATA
cd
=
_connections
[
pdwCookie
];
if
(
NULL
!=
cd
.
pUnk
)
{
cd
.
pUnk
->
Release
();
cd
.
pUnk
=
NULL
;
return
S_OK
;
}
}
return
CONNECT_E_NOCONNECTION
;
};
STDMETHODIMP
VLCConnectionPoint
::
EnumConnections
(
IEnumConnections
**
ppEnum
)
{
if
(
NULL
==
ppEnum
)
return
E_POINTER
;
*
ppEnum
=
dynamic_cast
<
LPENUMCONNECTIONS
>
(
new
VLCEnumConnections
(
_connections
));
return
(
NULL
!=
*
ppEnum
)
?
S_OK
:
E_OUTOFMEMORY
;
};
void
VLCConnectionPoint
::
fireEvent
(
DISPID
dispId
,
DISPPARAMS
*
pDispParams
)
{
vector
<
CONNECTDATA
>::
iterator
end
=
_connections
.
end
();
vector
<
CONNECTDATA
>::
iterator
iter
=
_connections
.
begin
();
while
(
iter
!=
end
)
{
CONNECTDATA
cd
=
*
iter
;
if
(
NULL
!=
cd
.
pUnk
)
{
IDispatch
*
pDisp
;
if
(
SUCCEEDED
(
cd
.
pUnk
->
QueryInterface
(
IID_IDispatch
,
(
LPVOID
*
)
&
pDisp
))
)
{
pDisp
->
Invoke
(
dispId
,
IID_NULL
,
LOCALE_USER_DEFAULT
,
DISPATCH_METHOD
,
pDispParams
,
NULL
,
NULL
,
NULL
);
pDisp
->
Release
();
}
}
++
iter
;
}
};
void
VLCConnectionPoint
::
firePropChangedEvent
(
DISPID
dispId
)
{
vector
<
CONNECTDATA
>::
iterator
end
=
_connections
.
end
();
vector
<
CONNECTDATA
>::
iterator
iter
=
_connections
.
begin
();
while
(
iter
!=
end
)
{
CONNECTDATA
cd
=
*
iter
;
if
(
NULL
!=
cd
.
pUnk
)
{
IPropertyNotifySink
*
pPropSink
;
if
(
SUCCEEDED
(
cd
.
pUnk
->
QueryInterface
(
IID_IPropertyNotifySink
,
(
LPVOID
*
)
&
pPropSink
))
)
{
pPropSink
->
OnChanged
(
dispId
);
pPropSink
->
Release
();
}
}
++
iter
;
}
};
////////////////////////////////////////////////////////////////////////////////////////////////
class
VLCEnumConnectionPoints
:
public
IEnumConnectionPoints
{
public:
VLCEnumConnectionPoints
(
vector
<
LPCONNECTIONPOINT
>
&
v
)
:
e
(
VLCEnum
<
LPCONNECTIONPOINT
>
(
IID_IEnumConnectionPoints
,
v
))
{
e
.
setRetainOperation
((
VLCEnum
<
LPCONNECTIONPOINT
>::
retainer
)
&
retain
);
};
VLCEnumConnectionPoints
(
const
VLCEnumConnectionPoints
&
vlcEnum
)
:
e
(
vlcEnum
.
e
)
{};
virtual
~
VLCEnumConnectionPoints
()
{};
// IUnknown methods
STDMETHODIMP
QueryInterface
(
REFIID
riid
,
void
**
ppv
)
{
return
e
.
QueryInterface
(
riid
,
ppv
);
};
STDMETHODIMP_
(
ULONG
)
AddRef
(
void
)
{
return
e
.
AddRef
();
};
STDMETHODIMP_
(
ULONG
)
Release
(
void
)
{
return
e
.
Release
();
};
//IEnumConnectionPoints
STDMETHODIMP
Next
(
ULONG
celt
,
LPCONNECTIONPOINT
*
rgelt
,
ULONG
*
pceltFetched
)
{
return
e
.
Next
(
celt
,
rgelt
,
pceltFetched
);
};
STDMETHODIMP
Skip
(
ULONG
celt
)
{
return
e
.
Skip
(
celt
);};
STDMETHODIMP
Reset
(
void
)
{
return
e
.
Reset
();};
STDMETHODIMP
Clone
(
LPENUMCONNECTIONPOINTS
*
ppenum
)
{
if
(
NULL
==
ppenum
)
return
E_POINTER
;
*
ppenum
=
dynamic_cast
<
LPENUMCONNECTIONPOINTS
>
(
new
VLCEnumConnectionPoints
(
*
this
));
return
(
NULL
!=
*
ppenum
)
?
S_OK
:
E_OUTOFMEMORY
;
};
private:
static
void
retain
(
LPCONNECTIONPOINT
cp
)
{
cp
->
AddRef
();
};
VLCEnum
<
LPCONNECTIONPOINT
>
e
;
};
////////////////////////////////////////////////////////////////////////////////////////////////
VLCConnectionPointContainer
::
VLCConnectionPointContainer
(
VLCPlugin
*
p_instance
)
:
_p_instance
(
p_instance
)
{
_p_events
=
new
VLCConnectionPoint
(
dynamic_cast
<
LPCONNECTIONPOINTCONTAINER
>
(
this
),
_p_instance
->
getDispEventID
());
_v_cps
.
push_back
(
dynamic_cast
<
LPCONNECTIONPOINT
>
(
_p_events
));
_p_props
=
new
VLCConnectionPoint
(
dynamic_cast
<
LPCONNECTIONPOINTCONTAINER
>
(
this
),
IID_IPropertyNotifySink
);
_v_cps
.
push_back
(
dynamic_cast
<
LPCONNECTIONPOINT
>
(
_p_props
));
};
VLCConnectionPointContainer
::~
VLCConnectionPointContainer
()
{
_v_cps
.
clear
();
delete
_p_props
;
delete
_p_events
;
};
STDMETHODIMP
VLCConnectionPointContainer
::
EnumConnectionPoints
(
LPENUMCONNECTIONPOINTS
*
ppEnum
)
{
if
(
NULL
==
ppEnum
)
return
E_POINTER
;
*
ppEnum
=
dynamic_cast
<
LPENUMCONNECTIONPOINTS
>
(
new
VLCEnumConnectionPoints
(
_v_cps
));
return
(
NULL
!=
*
ppEnum
)
?
S_OK
:
E_OUTOFMEMORY
;
};
STDMETHODIMP
VLCConnectionPointContainer
::
FindConnectionPoint
(
REFIID
riid
,
IConnectionPoint
**
ppCP
)
{
if
(
NULL
==
ppCP
)
return
E_POINTER
;
*
ppCP
=
NULL
;
if
(
IID_IPropertyNotifySink
==
riid
)
{
_p_props
->
AddRef
();
*
ppCP
=
dynamic_cast
<
LPCONNECTIONPOINT
>
(
_p_props
);
}
else
if
(
_p_instance
->
getDispEventID
()
==
riid
)
{
_p_events
->
AddRef
();
*
ppCP
=
dynamic_cast
<
LPCONNECTIONPOINT
>
(
_p_events
);
}
else
return
CONNECT_E_NOCONNECTION
;
return
NOERROR
;
};
void
VLCConnectionPointContainer
::
fireEvent
(
DISPID
dispId
,
DISPPARAMS
*
pDispParams
)
{
_p_events
->
fireEvent
(
dispId
,
pDispParams
);
};
void
VLCConnectionPointContainer
::
firePropChangedEvent
(
DISPID
dispId
)
{
_p_props
->
firePropChangedEvent
(
dispId
);
};
/*****************************************************************************
* connectioncontainer.cpp: ActiveX control for VLC
*****************************************************************************
* Copyright (C) 2005 VideoLAN
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "plugin.h"
#include "connectioncontainer.h"
#include "utils.h"
using
namespace
std
;
////////////////////////////////////////////////////////////////////////////////////////////////
class
VLCEnumConnections
:
public
IEnumConnections
{
public:
VLCEnumConnections
(
vector
<
CONNECTDATA
>
&
v
)
:
e
(
VLCEnum
<
CONNECTDATA
>
(
IID_IEnumConnections
,
v
))
{
e
.
setRetainOperation
((
VLCEnum
<
CONNECTDATA
>::
retainer
)
&
retain
);
};
VLCEnumConnections
(
const
VLCEnumConnections
&
vlcEnum
)
:
e
(
vlcEnum
.
e
)
{};
virtual
~
VLCEnumConnections
()
{};
// IUnknown methods
STDMETHODIMP
QueryInterface
(
REFIID
riid
,
void
**
ppv
)
{
return
e
.
QueryInterface
(
riid
,
ppv
);
};
STDMETHODIMP_
(
ULONG
)
AddRef
(
void
)
{
return
e
.
AddRef
();
};
STDMETHODIMP_
(
ULONG
)
Release
(
void
)
{
return
e
.
Release
();
};
//IEnumConnectionPoints
STDMETHODIMP
Next
(
ULONG
celt
,
LPCONNECTDATA
rgelt
,
ULONG
*
pceltFetched
)
{
return
e
.
Next
(
celt
,
rgelt
,
pceltFetched
);
};
STDMETHODIMP
Skip
(
ULONG
celt
)
{
return
e
.
Skip
(
celt
);};
STDMETHODIMP
Reset
(
void
)
{
return
e
.
Reset
();};
STDMETHODIMP
Clone
(
LPENUMCONNECTIONS
*
ppenum
)
{
if
(
NULL
==
ppenum
)
return
E_POINTER
;
*
ppenum
=
dynamic_cast
<
LPENUMCONNECTIONS
>
(
new
VLCEnumConnections
(
*
this
));
return
(
NULL
!=
*
ppenum
)
?
S_OK
:
E_OUTOFMEMORY
;
};
private:
static
void
retain
(
CONNECTDATA
cd
)
{
cd
.
pUnk
->
AddRef
();
};
VLCEnum
<
CONNECTDATA
>
e
;
};
////////////////////////////////////////////////////////////////////////////////////////////////
STDMETHODIMP
VLCConnectionPoint
::
GetConnectionInterface
(
IID
*
iid
)
{
if
(
NULL
==
iid
)
return
E_POINTER
;
*
iid
=
_iid
;
return
S_OK
;
};
STDMETHODIMP
VLCConnectionPoint
::
GetConnectionPointContainer
(
LPCONNECTIONPOINTCONTAINER
*
ppCPC
)
{
if
(
NULL
==
ppCPC
)
return
E_POINTER
;
_p_cpc
->
AddRef
();
*
ppCPC
=
_p_cpc
;
return
S_OK
;
};
STDMETHODIMP
VLCConnectionPoint
::
Advise
(
IUnknown
*
pUnk
,
DWORD
*
pdwCookie
)
{
if
(
(
NULL
==
pUnk
)
||
(
NULL
==
pdwCookie
)
)
return
E_POINTER
;
CONNECTDATA
cd
;
pUnk
->
AddRef
();
cd
.
pUnk
=
pUnk
;
*
pdwCookie
=
cd
.
dwCookie
=
_connections
.
size
();
_connections
.
push_back
(
cd
);
return
S_OK
;
};
STDMETHODIMP
VLCConnectionPoint
::
Unadvise
(
DWORD
pdwCookie
)
{
if
(
pdwCookie
<
_connections
.
size
()
)
{
CONNECTDATA
cd
=
_connections
[
pdwCookie
];
if
(
NULL
!=
cd
.
pUnk
)
{
cd
.
pUnk
->
Release
();
cd
.
pUnk
=
NULL
;
return
S_OK
;
}
}
return
CONNECT_E_NOCONNECTION
;
};
STDMETHODIMP
VLCConnectionPoint
::
EnumConnections
(
IEnumConnections
**
ppEnum
)
{
if
(
NULL
==
ppEnum
)
return
E_POINTER
;
*
ppEnum
=
dynamic_cast
<
LPENUMCONNECTIONS
>
(
new
VLCEnumConnections
(
_connections
));
return
(
NULL
!=
*
ppEnum
)
?
S_OK
:
E_OUTOFMEMORY
;
};
void
VLCConnectionPoint
::
fireEvent
(
DISPID
dispId
,
DISPPARAMS
*
pDispParams
)
{
vector
<
CONNECTDATA
>::
iterator
end
=
_connections
.
end
();
vector
<
CONNECTDATA
>::
iterator
iter
=
_connections
.
begin
();
while
(
iter
!=
end
)
{
CONNECTDATA
cd
=
*
iter
;
if
(
NULL
!=
cd
.
pUnk
)
{
IDispatch
*
pDisp
;
if
(
SUCCEEDED
(
cd
.
pUnk
->
QueryInterface
(
IID_IDispatch
,
(
LPVOID
*
)
&
pDisp
))
)
{
pDisp
->
Invoke
(
dispId
,
IID_NULL
,
LOCALE_USER_DEFAULT
,
DISPATCH_METHOD
,
pDispParams
,
NULL
,
NULL
,
NULL
);
pDisp
->
Release
();
}
}
++
iter
;
}
};
void
VLCConnectionPoint
::
firePropChangedEvent
(
DISPID
dispId
)
{
vector
<
CONNECTDATA
>::
iterator
end
=
_connections
.
end
();
vector
<
CONNECTDATA
>::
iterator
iter
=
_connections
.
begin
();
while
(
iter
!=
end
)
{
CONNECTDATA
cd
=
*
iter
;
if
(
NULL
!=
cd
.
pUnk
)
{
IPropertyNotifySink
*
pPropSink
;
if
(
SUCCEEDED
(
cd
.
pUnk
->
QueryInterface
(
IID_IPropertyNotifySink
,
(
LPVOID
*
)
&
pPropSink
))
)
{
pPropSink
->
OnChanged
(
dispId
);
pPropSink
->
Release
();
}
}
++
iter
;
}
};
////////////////////////////////////////////////////////////////////////////////////////////////
class
VLCEnumConnectionPoints
:
public
IEnumConnectionPoints
{
public:
VLCEnumConnectionPoints
(
vector
<
LPCONNECTIONPOINT
>
&
v
)
:
e
(
VLCEnum
<
LPCONNECTIONPOINT
>
(
IID_IEnumConnectionPoints
,
v
))
{
e
.
setRetainOperation
((
VLCEnum
<
LPCONNECTIONPOINT
>::
retainer
)
&
retain
);
};
VLCEnumConnectionPoints
(
const
VLCEnumConnectionPoints
&
vlcEnum
)
:
e
(
vlcEnum
.
e
)
{};
virtual
~
VLCEnumConnectionPoints
()
{};
// IUnknown methods
STDMETHODIMP
QueryInterface
(
REFIID
riid
,
void
**
ppv
)
{
return
e
.
QueryInterface
(
riid
,
ppv
);
};
STDMETHODIMP_
(
ULONG
)
AddRef
(
void
)
{
return
e
.
AddRef
();
};
STDMETHODIMP_
(
ULONG
)
Release
(
void
)
{
return
e
.
Release
();
};