Changeset feca357aaa88380d9e9c5c1bd21b2b25d4723acf
- Timestamp:
- 14/06/08 10:09:06
(4 months ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1213430946 +0200
- git-parent:
[e5eae01a3ef40bc9399c7da03958163571355008]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1213107913 +0200
- Message:
Fix building of ActiveX control with 3 functions being unimplemented right now:
- VLCControl::setVariable()
- VLCControl::getVariable()
- VLCControl::get_PlaylistIndex()
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra2ccb9b |
rfeca357 |
|
| 5 | 5 | * |
|---|
| 6 | 6 | * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net> |
|---|
| | 7 | * Jean-Paul Saman <jpsaman@videolan.org> |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * This program is free software; you can redistribute it and/or modify |
|---|
| … | … | |
| 404 | 405 | STDMETHODIMP VLCControl::playFaster(void) |
|---|
| 405 | 406 | { |
|---|
| | 407 | int32_t rate = 2; |
|---|
| | 408 | |
|---|
| 406 | 409 | HRESULT result = E_UNEXPECTED; |
|---|
| 407 | | if( _p_instance->isRunning() ) |
|---|
| 408 | | { |
|---|
| 409 | | libvlc_instance_t *p_libvlc; |
|---|
| 410 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 411 | | if( SUCCEEDED(result) ) |
|---|
| 412 | | { |
|---|
| 413 | | VLC_SpeedFaster(i_vlc); |
|---|
| 414 | | } |
|---|
| | 410 | if( !_p_instance->isRunning() ) |
|---|
| | 411 | return result; |
|---|
| | 412 | |
|---|
| | 413 | libvlc_instance_t* p_libvlc; |
|---|
| | 414 | result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 415 | if( SUCCEEDED(result) ) |
|---|
| | 416 | { |
|---|
| | 417 | libvlc_exception_t ex; |
|---|
| | 418 | libvlc_exception_init(&ex); |
|---|
| | 419 | |
|---|
| | 420 | libvlc_media_player_t *p_md; |
|---|
| | 421 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 422 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 423 | { |
|---|
| | 424 | libvlc_media_player_set_rate(p_md, rate, &ex); |
|---|
| | 425 | libvlc_media_player_release(p_md); |
|---|
| | 426 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 427 | { |
|---|
| | 428 | return NOERROR; |
|---|
| | 429 | } |
|---|
| | 430 | } |
|---|
| | 431 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 432 | libvlc_exception_get_message(&ex)); |
|---|
| | 433 | libvlc_exception_clear(&ex); |
|---|
| | 434 | return E_FAIL; |
|---|
| 415 | 435 | } |
|---|
| 416 | 436 | return result; |
|---|
| … | … | |
| 419 | 439 | STDMETHODIMP VLCControl::playSlower(void) |
|---|
| 420 | 440 | { |
|---|
| | 441 | float rate = 0.5; |
|---|
| | 442 | |
|---|
| 421 | 443 | HRESULT result = E_UNEXPECTED; |
|---|
| 422 | | if( _p_instance->isRunning() ) |
|---|
| 423 | | { |
|---|
| 424 | | libvlc_instance_t *p_libvlc; |
|---|
| 425 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 426 | | if( SUCCEEDED(result) ) |
|---|
| 427 | | { |
|---|
| 428 | | VLC_SpeedSlower(i_vlc); |
|---|
| 429 | | } |
|---|
| | 444 | if( !_p_instance->isRunning() ) |
|---|
| | 445 | return result; |
|---|
| | 446 | |
|---|
| | 447 | libvlc_instance_t* p_libvlc; |
|---|
| | 448 | result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 449 | if( SUCCEEDED(result) ) |
|---|
| | 450 | { |
|---|
| | 451 | libvlc_exception_t ex; |
|---|
| | 452 | libvlc_exception_init(&ex); |
|---|
| | 453 | |
|---|
| | 454 | libvlc_media_player_t *p_md; |
|---|
| | 455 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 456 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 457 | { |
|---|
| | 458 | libvlc_media_player_set_rate(p_md, rate, &ex); |
|---|
| | 459 | libvlc_media_player_release(p_md); |
|---|
| | 460 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 461 | { |
|---|
| | 462 | return NOERROR; |
|---|
| | 463 | } |
|---|
| | 464 | } |
|---|
| | 465 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 466 | libvlc_exception_get_message(&ex)); |
|---|
| | 467 | libvlc_exception_clear(&ex); |
|---|
| | 468 | return E_FAIL; |
|---|
| 430 | 469 | } |
|---|
| 431 | 470 | return result; |
|---|
| … | … | |
| 471 | 510 | STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value) |
|---|
| 472 | 511 | { |
|---|
| | 512 | return E_INVALIDARG; |
|---|
| | 513 | #if 0 |
|---|
| 473 | 514 | if( 0 == SysStringLen(name) ) |
|---|
| 474 | 515 | return E_INVALIDARG; |
|---|
| … | … | |
| 577 | 618 | } |
|---|
| 578 | 619 | return hr; |
|---|
| | 620 | #endif |
|---|
| 579 | 621 | }; |
|---|
| 580 | 622 | |
|---|
| 581 | 623 | STDMETHODIMP VLCControl::getVariable( BSTR name, VARIANT *value) |
|---|
| 582 | 624 | { |
|---|
| | 625 | return E_INVALIDARG; |
|---|
| | 626 | #if 0 |
|---|
| 583 | 627 | if( NULL == value ) |
|---|
| 584 | 628 | return E_POINTER; |
|---|
| … | … | |
| 650 | 694 | } |
|---|
| 651 | 695 | return hr; |
|---|
| | 696 | #endif |
|---|
| 652 | 697 | }; |
|---|
| 653 | 698 | |
|---|
| … | … | |
| 971 | 1016 | */ |
|---|
| 972 | 1017 | |
|---|
| 973 | | STDMETHODIMP VLCControl::addTarget( BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position) |
|---|
| | 1018 | STDMETHODIMP VLCControl::addTarget(BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position) |
|---|
| 974 | 1019 | { |
|---|
| 975 | 1020 | if( 0 == SysStringLen(uri) ) |
|---|
| … | … | |
| 990 | 1035 | return E_INVALIDARG; |
|---|
| 991 | 1036 | |
|---|
| 992 | | if( VLC_SUCCESS <= VLC_AddTarget(i_vlc, cUri, (const char **)cOptions, cOptionsCount, mode, position) ) |
|---|
| 993 | | { |
|---|
| 994 | | hr = NOERROR; |
|---|
| 995 | | if( mode & PLAYLIST_GO ) |
|---|
| 996 | | _p_instance->fireOnPlayEvent(); |
|---|
| 997 | | } |
|---|
| 998 | | else |
|---|
| 999 | | { |
|---|
| 1000 | | hr = E_FAIL; |
|---|
| 1001 | | if( mode & PLAYLIST_GO ) |
|---|
| 1002 | | _p_instance->fireOnStopEvent(); |
|---|
| 1003 | | } |
|---|
| | 1037 | libvlc_exception_t ex; |
|---|
| | 1038 | libvlc_exception_init(&ex); |
|---|
| | 1039 | |
|---|
| | 1040 | position = libvlc_playlist_add_extended(p_libvlc, cUri, cUri, |
|---|
| | 1041 | cOptionsCount, |
|---|
| | 1042 | const_cast<const char**>(cOptions), |
|---|
| | 1043 | &ex); |
|---|
| 1004 | 1044 | |
|---|
| 1005 | 1045 | FreeTargetOptions(cOptions, cOptionsCount); |
|---|
| 1006 | 1046 | CoTaskMemFree(cUri); |
|---|
| | 1047 | |
|---|
| | 1048 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 1049 | { |
|---|
| | 1050 | _p_instance->setErrorInfo(IID_IVLCPlaylist, |
|---|
| | 1051 | libvlc_exception_get_message(&ex)); |
|---|
| | 1052 | libvlc_exception_clear(&ex); |
|---|
| | 1053 | |
|---|
| | 1054 | if( mode & VLCPlayListAppendAndGo ) |
|---|
| | 1055 | _p_instance->fireOnStopEvent(); |
|---|
| | 1056 | return E_FAIL; |
|---|
| | 1057 | } |
|---|
| | 1058 | |
|---|
| | 1059 | if( mode & VLCPlayListAppendAndGo ) |
|---|
| | 1060 | _p_instance->fireOnPlayEvent(); |
|---|
| | 1061 | return NOERROR; |
|---|
| 1007 | 1062 | } |
|---|
| 1008 | 1063 | return hr; |
|---|
| … | … | |
| 1011 | 1066 | STDMETHODIMP VLCControl::get_PlaylistIndex(int *index) |
|---|
| 1012 | 1067 | { |
|---|
| | 1068 | return E_INVALIDARG; |
|---|
| | 1069 | #if 0 |
|---|
| 1013 | 1070 | if( NULL == index ) |
|---|
| 1014 | 1071 | return E_POINTER; |
|---|
| … | … | |
| 1023 | 1080 | *index = 0; |
|---|
| 1024 | 1081 | return result; |
|---|
| | 1082 | #endif |
|---|
| 1025 | 1083 | }; |
|---|
| 1026 | 1084 | |
|---|