Changeset ef7ff281ab3587a43786529cb67704752c8148b5
- Timestamp:
- 06/14/08 10:09:06
(3 months ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1213430946 +0200
- git-parent:
[5da255df6aa85568a0b8d736701472aeb0222057]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1213366735 +0200
- Message:
Add playlist_CurrentId() to get the playlist item id from the currently playing item.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rec8b0a2 |
ref7ff28 |
|
| 128 | 128 | libvlc_exception_t * ); |
|---|
| 129 | 129 | |
|---|
| | 130 | VLC_DEPRECATED_API int libvlc_playlist_get_current_index( libvlc_instance_t *, |
|---|
| | 131 | libvlc_exception_t *); |
|---|
| 130 | 132 | /** |
|---|
| 131 | 133 | * Lock the playlist. |
|---|
| rfbb8255 |
ref7ff28 |
|
| 421 | 421 | #define playlist_CurrentSize( pl ) pl->current.i_size |
|---|
| 422 | 422 | |
|---|
| | 423 | /** Tell the current item id in current playing context */ |
|---|
| | 424 | #define playlist_CurrentId( pl ) pl->status.p_item->i_id |
|---|
| | 425 | |
|---|
| 423 | 426 | /** Ask the playlist to do some work */ |
|---|
| 424 | 427 | #define playlist_Signal( p_playlist ) vlc_object_signal( p_playlist ) |
|---|
| r21d5bee |
ref7ff28 |
|
| 891 | 891 | STDMETHODIMP VLCControl::get_PlaylistIndex(int *index) |
|---|
| 892 | 892 | { |
|---|
| 893 | | return E_INVALIDARG; |
|---|
| 894 | | #if 0 |
|---|
| 895 | 893 | if( NULL == index ) |
|---|
| 896 | 894 | return E_POINTER; |
|---|
| 897 | 895 | |
|---|
| | 896 | *index = 0; |
|---|
| 898 | 897 | libvlc_instance_t *p_libvlc; |
|---|
| 899 | 898 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 900 | 899 | if( SUCCEEDED(result) ) |
|---|
| 901 | 900 | { |
|---|
| 902 | | *index = VLC_PlaylistIndex(i_vlc); |
|---|
| 903 | | return NOERROR; |
|---|
| 904 | | } |
|---|
| 905 | | *index = 0; |
|---|
| 906 | | return result; |
|---|
| 907 | | #endif |
|---|
| 908 | | }; |
|---|
| 909 | | |
|---|
| 910 | | STDMETHODIMP VLCControl::get_PlaylistCount(int *count) |
|---|
| 911 | | { |
|---|
| 912 | | if( NULL == count ) |
|---|
| 913 | | return E_POINTER; |
|---|
| 914 | | |
|---|
| 915 | | *count = 0; |
|---|
| 916 | | libvlc_instance_t* p_libvlc; |
|---|
| 917 | | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 918 | | if( SUCCEEDED(result) ) |
|---|
| 919 | | { |
|---|
| 920 | | libvlc_exception_t ex; |
|---|
| 921 | | libvlc_exception_init(&ex); |
|---|
| 922 | | |
|---|
| 923 | | *count = libvlc_playlist_items_count(p_libvlc, &ex); |
|---|
| | 901 | libvlc_exception_t ex; |
|---|
| | 902 | libvlc_exception_init(&ex); |
|---|
| | 903 | |
|---|
| | 904 | *index = libvlc_playlist_get_current_index(p_libvlc, &ex); |
|---|
| 924 | 905 | if( libvlc_exception_raised(&ex) ) |
|---|
| 925 | 906 | { |
|---|
| … | … | |
| 934 | 915 | }; |
|---|
| 935 | 916 | |
|---|
| 936 | | STDMETHODIMP VLCControl::playlistNext(void) |
|---|
| 937 | | { |
|---|
| 938 | | libvlc_instance_t* p_libvlc; |
|---|
| 939 | | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 940 | | if( SUCCEEDED(result) ) |
|---|
| 941 | | { |
|---|
| 942 | | libvlc_exception_t ex; |
|---|
| 943 | | libvlc_exception_init(&ex); |
|---|
| 944 | | |
|---|
| 945 | | libvlc_playlist_next(p_libvlc, &ex); |
|---|
| | 917 | STDMETHODIMP VLCControl::get_PlaylistCount(int *count) |
|---|
| | 918 | { |
|---|
| | 919 | if( NULL == count ) |
|---|
| | 920 | return E_POINTER; |
|---|
| | 921 | |
|---|
| | 922 | *count = 0; |
|---|
| | 923 | libvlc_instance_t* p_libvlc; |
|---|
| | 924 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 925 | if( SUCCEEDED(result) ) |
|---|
| | 926 | { |
|---|
| | 927 | libvlc_exception_t ex; |
|---|
| | 928 | libvlc_exception_init(&ex); |
|---|
| | 929 | |
|---|
| | 930 | *count = libvlc_playlist_items_count(p_libvlc, &ex); |
|---|
| 946 | 931 | if( libvlc_exception_raised(&ex) ) |
|---|
| 947 | 932 | { |
|---|
| … | … | |
| 956 | 941 | }; |
|---|
| 957 | 942 | |
|---|
| 958 | | STDMETHODIMP VLCControl::playlistPrev(void) |
|---|
| 959 | | { |
|---|
| 960 | | libvlc_instance_t* p_libvlc; |
|---|
| 961 | | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 962 | | if( SUCCEEDED(result) ) |
|---|
| 963 | | { |
|---|
| 964 | | libvlc_exception_t ex; |
|---|
| 965 | | libvlc_exception_init(&ex); |
|---|
| 966 | | |
|---|
| 967 | | libvlc_playlist_prev(p_libvlc, &ex); |
|---|
| | 943 | STDMETHODIMP VLCControl::playlistNext(void) |
|---|
| | 944 | { |
|---|
| | 945 | libvlc_instance_t* p_libvlc; |
|---|
| | 946 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 947 | if( SUCCEEDED(result) ) |
|---|
| | 948 | { |
|---|
| | 949 | libvlc_exception_t ex; |
|---|
| | 950 | libvlc_exception_init(&ex); |
|---|
| | 951 | |
|---|
| | 952 | libvlc_playlist_next(p_libvlc, &ex); |
|---|
| 968 | 953 | if( libvlc_exception_raised(&ex) ) |
|---|
| 969 | 954 | { |
|---|
| … | … | |
| 978 | 963 | }; |
|---|
| 979 | 964 | |
|---|
| 980 | | STDMETHODIMP VLCControl::playlistClear(void) |
|---|
| 981 | | { |
|---|
| 982 | | libvlc_instance_t* p_libvlc; |
|---|
| 983 | | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 984 | | if( SUCCEEDED(result) ) |
|---|
| 985 | | { |
|---|
| 986 | | libvlc_exception_t ex; |
|---|
| 987 | | libvlc_exception_init(&ex); |
|---|
| 988 | | |
|---|
| 989 | | libvlc_playlist_clear(p_libvlc, &ex); |
|---|
| | 965 | STDMETHODIMP VLCControl::playlistPrev(void) |
|---|
| | 966 | { |
|---|
| | 967 | libvlc_instance_t* p_libvlc; |
|---|
| | 968 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 969 | if( SUCCEEDED(result) ) |
|---|
| | 970 | { |
|---|
| | 971 | libvlc_exception_t ex; |
|---|
| | 972 | libvlc_exception_init(&ex); |
|---|
| | 973 | |
|---|
| | 974 | libvlc_playlist_prev(p_libvlc, &ex); |
|---|
| 990 | 975 | if( libvlc_exception_raised(&ex) ) |
|---|
| 991 | 976 | { |
|---|
| … | … | |
| 1000 | 985 | }; |
|---|
| 1001 | 986 | |
|---|
| | 987 | STDMETHODIMP VLCControl::playlistClear(void) |
|---|
| | 988 | { |
|---|
| | 989 | libvlc_instance_t* p_libvlc; |
|---|
| | 990 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 991 | if( SUCCEEDED(result) ) |
|---|
| | 992 | { |
|---|
| | 993 | libvlc_exception_t ex; |
|---|
| | 994 | libvlc_exception_init(&ex); |
|---|
| | 995 | |
|---|
| | 996 | libvlc_playlist_clear(p_libvlc, &ex); |
|---|
| | 997 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 998 | { |
|---|
| | 999 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 1000 | libvlc_exception_get_message(&ex)); |
|---|
| | 1001 | libvlc_exception_clear(&ex); |
|---|
| | 1002 | return E_FAIL; |
|---|
| | 1003 | } |
|---|
| | 1004 | return NOERROR; |
|---|
| | 1005 | } |
|---|
| | 1006 | return result; |
|---|
| | 1007 | }; |
|---|
| | 1008 | |
|---|
| 1002 | 1009 | STDMETHODIMP VLCControl::get_VersionInfo(BSTR *version) |
|---|
| 1003 | 1010 | { |
|---|
| r82921f3 |
ref7ff28 |
|
| 63 | 63 | libvlc_exception_t *p_e ) |
|---|
| 64 | 64 | { |
|---|
| 65 | | VLC_UNUSED(p_e); |
|---|
| | 65 | VLC_UNUSED(p_e); VLC_UNUSED(i_options); VLC_UNUSED(ppsz_options); |
|---|
| 66 | 66 | |
|---|
| 67 | 67 | int did_lock = 0; |
|---|
| … | … | |
| 209 | 209 | } |
|---|
| 210 | 210 | |
|---|
| | 211 | int libvlc_playlist_get_current_index ( libvlc_instance_t *p_instance, |
|---|
| | 212 | libvlc_exception_t *p_e ) |
|---|
| | 213 | { |
|---|
| | 214 | VLC_UNUSED(p_e); |
|---|
| | 215 | |
|---|
| | 216 | assert( PL ); |
|---|
| | 217 | if( !PL->status.p_item ) |
|---|
| | 218 | return -1; |
|---|
| | 219 | return playlist_CurrentId( PL ); |
|---|
| | 220 | } |
|---|
| | 221 | |
|---|
| 211 | 222 | void libvlc_playlist_lock( libvlc_instance_t *p_instance ) |
|---|
| 212 | 223 | { |
|---|
| r19091cc |
ref7ff28 |
|
| 149 | 149 | libvlc_playlist_isplaying |
|---|
| 150 | 150 | libvlc_playlist_items_count |
|---|
| | 151 | libvlc_playlist_get_current_index |
|---|
| 151 | 152 | libvlc_playlist_lock |
|---|
| 152 | 153 | libvlc_playlist_loop |
|---|