Changeset a2ccb9b4e1210d29a9578074636e6969e0bf8795
- 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:
[6a0f2d4686439e3691462abfd602172b023e9272]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1213088227 +0200
- Message:
Use the same internal libvlc API as vlccontrol2.cpp does.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r763b673 |
ra2ccb9b |
|
| 124 | 124 | STDMETHODIMP VLCControl::play(void) |
|---|
| 125 | 125 | { |
|---|
| 126 | | libvlc_instance_t *p_libvlc; |
|---|
| | 126 | libvlc_instance_t* p_libvlc; |
|---|
| 127 | 127 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 128 | 128 | if( SUCCEEDED(result) ) |
|---|
| 129 | 129 | { |
|---|
| 130 | | VLC_Play(i_vlc); |
|---|
| | 130 | libvlc_exception_t ex; |
|---|
| | 131 | libvlc_exception_init(&ex); |
|---|
| | 132 | |
|---|
| | 133 | libvlc_playlist_play(p_libvlc, -1, 0, NULL, &ex); |
|---|
| | 134 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 135 | { |
|---|
| | 136 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 137 | libvlc_exception_get_message(&ex)); |
|---|
| | 138 | libvlc_exception_clear(&ex); |
|---|
| | 139 | return E_FAIL; |
|---|
| | 140 | } |
|---|
| 131 | 141 | _p_instance->fireOnPlayEvent(); |
|---|
| | 142 | return NOERROR; |
|---|
| 132 | 143 | } |
|---|
| 133 | 144 | return result; |
|---|
| … | … | |
| 136 | 147 | STDMETHODIMP VLCControl::pause(void) |
|---|
| 137 | 148 | { |
|---|
| 138 | | libvlc_instance_t *p_libvlc; |
|---|
| | 149 | libvlc_instance_t* p_libvlc; |
|---|
| 139 | 150 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 140 | 151 | if( SUCCEEDED(result) ) |
|---|
| 141 | 152 | { |
|---|
| 142 | | VLC_Pause(i_vlc); |
|---|
| | 153 | libvlc_exception_t ex; |
|---|
| | 154 | libvlc_exception_init(&ex); |
|---|
| | 155 | |
|---|
| | 156 | libvlc_playlist_pause(p_libvlc, &ex); |
|---|
| | 157 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 158 | { |
|---|
| | 159 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 160 | libvlc_exception_get_message(&ex)); |
|---|
| | 161 | libvlc_exception_clear(&ex); |
|---|
| | 162 | return E_FAIL; |
|---|
| | 163 | } |
|---|
| 143 | 164 | _p_instance->fireOnPauseEvent(); |
|---|
| | 165 | return NOERROR; |
|---|
| 144 | 166 | } |
|---|
| 145 | 167 | return result; |
|---|
| … | … | |
| 148 | 170 | STDMETHODIMP VLCControl::stop(void) |
|---|
| 149 | 171 | { |
|---|
| 150 | | libvlc_instance_t *p_libvlc; |
|---|
| | 172 | libvlc_instance_t* p_libvlc; |
|---|
| 151 | 173 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 152 | 174 | if( SUCCEEDED(result) ) |
|---|
| 153 | 175 | { |
|---|
| 154 | | VLC_Stop(i_vlc); |
|---|
| 155 | | _p_instance->fireOnStopEvent(); |
|---|
| 156 | | } |
|---|
| | 176 | libvlc_exception_t ex; |
|---|
| | 177 | libvlc_exception_init(&ex); |
|---|
| | 178 | |
|---|
| | 179 | libvlc_playlist_stop(p_libvlc, &ex); |
|---|
| | 180 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 181 | { |
|---|
| | 182 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 183 | libvlc_exception_get_message(&ex)); |
|---|
| | 184 | libvlc_exception_clear(&ex); |
|---|
| | 185 | return E_FAIL; |
|---|
| | 186 | } |
|---|
| | 187 | return NOERROR; |
|---|
| | 188 | } |
|---|
| | 189 | _p_instance->fireOnStopEvent(); |
|---|
| 157 | 190 | return result; |
|---|
| 158 | 191 | }; |
|---|
| … | … | |
| 185 | 218 | if( NULL == position ) |
|---|
| 186 | 219 | return E_POINTER; |
|---|
| 187 | | |
|---|
| | 220 | *position = 0.0f; |
|---|
| | 221 | |
|---|
| | 222 | libvlc_instance_t* p_libvlc; |
|---|
| 188 | 223 | HRESULT result = E_UNEXPECTED; |
|---|
| 189 | | if( _p_instance->isRunning() ) |
|---|
| 190 | | { |
|---|
| 191 | | libvlc_instance_t *p_libvlc; |
|---|
| 192 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 193 | | if( SUCCEEDED(result) ) |
|---|
| 194 | | { |
|---|
| 195 | | *position = VLC_PositionGet(i_vlc); |
|---|
| 196 | | return NOERROR; |
|---|
| 197 | | } |
|---|
| 198 | | } |
|---|
| 199 | | *position = 0.0f; |
|---|
| | 224 | result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 225 | if( SUCCEEDED(result) ) |
|---|
| | 226 | { |
|---|
| | 227 | libvlc_exception_t ex; |
|---|
| | 228 | libvlc_exception_init(&ex); |
|---|
| | 229 | |
|---|
| | 230 | libvlc_media_player_t *p_md; |
|---|
| | 231 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 232 | if( !libvlc_exception_raised(&ex) ) |
|---|
| | 233 | { |
|---|
| | 234 | *position = libvlc_media_player_get_position(p_md, &ex); |
|---|
| | 235 | libvlc_media_player_release(p_md); |
|---|
| | 236 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 237 | { |
|---|
| | 238 | return NOERROR; |
|---|
| | 239 | } |
|---|
| | 240 | } |
|---|
| | 241 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 242 | libvlc_exception_get_message(&ex)); |
|---|
| | 243 | libvlc_exception_clear(&ex); |
|---|
| | 244 | return E_FAIL; |
|---|
| | 245 | } |
|---|
| 200 | 246 | return result; |
|---|
| 201 | 247 | }; |
|---|
| … | … | |
| 204 | 250 | { |
|---|
| 205 | 251 | HRESULT result = E_UNEXPECTED; |
|---|
| 206 | | if( _p_instance->isRunning() ) |
|---|
| 207 | | { |
|---|
| 208 | | libvlc_instance_t *p_libvlc; |
|---|
| 209 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 210 | | if( SUCCEEDED(result) ) |
|---|
| 211 | | { |
|---|
| 212 | | VLC_PositionSet(i_vlc, position); |
|---|
| 213 | | } |
|---|
| | 252 | libvlc_instance_t* p_libvlc; |
|---|
| | 253 | result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 254 | if( SUCCEEDED(result) ) |
|---|
| | 255 | { |
|---|
| | 256 | libvlc_exception_t ex; |
|---|
| | 257 | libvlc_exception_init(&ex); |
|---|
| | 258 | |
|---|
| | 259 | libvlc_media_player_t *p_md; |
|---|
| | 260 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 261 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 262 | { |
|---|
| | 263 | libvlc_media_player_set_position(p_md, position, &ex); |
|---|
| | 264 | libvlc_media_player_release(p_md); |
|---|
| | 265 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 266 | { |
|---|
| | 267 | return NOERROR; |
|---|
| | 268 | } |
|---|
| | 269 | } |
|---|
| | 270 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 271 | libvlc_exception_get_message(&ex)); |
|---|
| | 272 | libvlc_exception_clear(&ex); |
|---|
| | 273 | return E_FAIL; |
|---|
| 214 | 274 | } |
|---|
| 215 | 275 | return result; |
|---|
| … | … | |
| 221 | 281 | return E_POINTER; |
|---|
| 222 | 282 | |
|---|
| 223 | | HRESULT result = NOERROR; |
|---|
| 224 | | if( _p_instance->isRunning() ) |
|---|
| 225 | | { |
|---|
| 226 | | libvlc_instance_t *p_libvlc; |
|---|
| 227 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 228 | | if( SUCCEEDED(result) ) |
|---|
| 229 | | { |
|---|
| 230 | | *seconds = VLC_TimeGet(i_vlc); |
|---|
| 231 | | } |
|---|
| 232 | | } |
|---|
| 233 | | else |
|---|
| 234 | | *seconds = _p_instance->getTime(); |
|---|
| 235 | | |
|---|
| | 283 | *seconds = 0; |
|---|
| | 284 | libvlc_instance_t* p_libvlc; |
|---|
| | 285 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 286 | if( SUCCEEDED(result) ) |
|---|
| | 287 | { |
|---|
| | 288 | libvlc_exception_t ex; |
|---|
| | 289 | libvlc_exception_init(&ex); |
|---|
| | 290 | |
|---|
| | 291 | libvlc_media_player_t *p_md; |
|---|
| | 292 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 293 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 294 | { |
|---|
| | 295 | *seconds = libvlc_media_player_get_time(p_md, &ex); |
|---|
| | 296 | libvlc_media_player_release(p_md); |
|---|
| | 297 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 298 | { |
|---|
| | 299 | return NOERROR; |
|---|
| | 300 | } |
|---|
| | 301 | } |
|---|
| | 302 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 303 | libvlc_exception_get_message(&ex)); |
|---|
| | 304 | libvlc_exception_clear(&ex); |
|---|
| | 305 | return E_FAIL; |
|---|
| | 306 | } |
|---|
| 236 | 307 | return result; |
|---|
| 237 | 308 | }; |
|---|
| … | … | |
| 239 | 310 | STDMETHODIMP VLCControl::put_Time(int seconds) |
|---|
| 240 | 311 | { |
|---|
| | 312 | /* setTime function of the plugin sets the time. */ |
|---|
| 241 | 313 | _p_instance->setTime(seconds); |
|---|
| 242 | | |
|---|
| 243 | 314 | return NOERROR; |
|---|
| 244 | 315 | }; |
|---|
| … | … | |
| 246 | 317 | STDMETHODIMP VLCControl::shuttle(int seconds) |
|---|
| 247 | 318 | { |
|---|
| 248 | | HRESULT result = E_UNEXPECTED; |
|---|
| 249 | | if( _p_instance->isRunning() ) |
|---|
| 250 | | { |
|---|
| 251 | | libvlc_instance_t *p_libvlc; |
|---|
| 252 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 253 | | if( SUCCEEDED(result) ) |
|---|
| 254 | | { |
|---|
| 255 | | VLC_TimeSet(i_vlc, seconds, true); |
|---|
| 256 | | } |
|---|
| 257 | | } |
|---|
| 258 | | return result; |
|---|
| | 319 | libvlc_instance_t* p_libvlc; |
|---|
| | 320 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 321 | if( SUCCEEDED(result) ) |
|---|
| | 322 | { |
|---|
| | 323 | libvlc_exception_t ex; |
|---|
| | 324 | libvlc_exception_init(&ex); |
|---|
| | 325 | |
|---|
| | 326 | libvlc_media_player_t *p_md; |
|---|
| | 327 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 328 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 329 | { |
|---|
| | 330 | if( seconds < 0 ) seconds = 0; |
|---|
| | 331 | libvlc_media_player_set_time(p_md, (int64_t)seconds, &ex); |
|---|
| | 332 | libvlc_media_player_release(p_md); |
|---|
| | 333 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 334 | { |
|---|
| | 335 | return NOERROR; |
|---|
| | 336 | } |
|---|
| | 337 | } |
|---|
| | 338 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 339 | libvlc_exception_get_message(&ex)); |
|---|
| | 340 | libvlc_exception_clear(&ex); |
|---|
| | 341 | return E_FAIL; |
|---|
| | 342 | } |
|---|
| | 343 | return result; |
|---|
| | 344 | |
|---|
| 259 | 345 | }; |
|---|
| 260 | 346 | |
|---|
| … | … | |
| 287 | 373 | if( NULL == seconds ) |
|---|
| 288 | 374 | return E_POINTER; |
|---|
| 289 | | |
|---|
| 290 | | HRESULT result = NOERROR; |
|---|
| | 375 | *seconds = 0; |
|---|
| | 376 | |
|---|
| | 377 | libvlc_instance_t* p_libvlc; |
|---|
| | 378 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 379 | if( SUCCEEDED(result) ) |
|---|
| | 380 | { |
|---|
| | 381 | libvlc_exception_t ex; |
|---|
| | 382 | libvlc_exception_init(&ex); |
|---|
| | 383 | |
|---|
| | 384 | libvlc_media_player_t *p_md; |
|---|
| | 385 | p_md = libvlc_playlist_get_media_player(p_libvlc, &ex); |
|---|
| | 386 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 387 | { |
|---|
| | 388 | *seconds = (double)libvlc_media_player_get_length(p_md, &ex); |
|---|
| | 389 | libvlc_media_player_release(p_md); |
|---|
| | 390 | if( ! libvlc_exception_raised(&ex) ) |
|---|
| | 391 | { |
|---|
| | 392 | return NOERROR; |
|---|
| | 393 | } |
|---|
| | 394 | } |
|---|
| | 395 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 396 | libvlc_exception_get_message(&ex)); |
|---|
| | 397 | libvlc_exception_clear(&ex); |
|---|
| | 398 | return E_FAIL; |
|---|
| | 399 | } |
|---|
| | 400 | return result; |
|---|
| | 401 | |
|---|
| | 402 | }; |
|---|
| | 403 | |
|---|
| | 404 | STDMETHODIMP VLCControl::playFaster(void) |
|---|
| | 405 | { |
|---|
| | 406 | HRESULT result = E_UNEXPECTED; |
|---|
| 291 | 407 | if( _p_instance->isRunning() ) |
|---|
| 292 | 408 | { |
|---|
| … | … | |
| 295 | 411 | if( SUCCEEDED(result) ) |
|---|
| 296 | 412 | { |
|---|
| 297 | | *seconds = VLC_LengthGet(i_vlc); |
|---|
| 298 | | return NOERROR; |
|---|
| 299 | | } |
|---|
| 300 | | } |
|---|
| 301 | | *seconds = 0; |
|---|
| 302 | | return result; |
|---|
| 303 | | }; |
|---|
| 304 | | |
|---|
| 305 | | STDMETHODIMP VLCControl::playFaster(void) |
|---|
| | 413 | VLC_SpeedFaster(i_vlc); |
|---|
| | 414 | } |
|---|
| | 415 | } |
|---|
| | 416 | return result; |
|---|
| | 417 | }; |
|---|
| | 418 | |
|---|
| | 419 | STDMETHODIMP VLCControl::playSlower(void) |
|---|
| 306 | 420 | { |
|---|
| 307 | 421 | HRESULT result = E_UNEXPECTED; |
|---|
| … | … | |
| 312 | 426 | if( SUCCEEDED(result) ) |
|---|
| 313 | 427 | { |
|---|
| 314 | | VLC_SpeedFaster(i_vlc); |
|---|
| 315 | | } |
|---|
| 316 | | } |
|---|
| 317 | | return result; |
|---|
| 318 | | }; |
|---|
| 319 | | |
|---|
| 320 | | STDMETHODIMP VLCControl::playSlower(void) |
|---|
| 321 | | { |
|---|
| 322 | | HRESULT result = E_UNEXPECTED; |
|---|
| 323 | | if( _p_instance->isRunning() ) |
|---|
| 324 | | { |
|---|
| 325 | | libvlc_instance_t *p_libvlc; |
|---|
| 326 | | result = _p_instance->getVLC(&p_libvlc); |
|---|
| 327 | | if( SUCCEEDED(result) ) |
|---|
| 328 | | { |
|---|
| 329 | 428 | VLC_SpeedSlower(i_vlc); |
|---|
| 330 | 429 | } |
|---|
| … | … | |
| 350 | 449 | STDMETHODIMP VLCControl::toggleMute(void) |
|---|
| 351 | 450 | { |
|---|
| 352 | | libvlc_instance_t *p_libvlc; |
|---|
| | 451 | libvlc_instance_t* p_libvlc; |
|---|
| 353 | 452 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 354 | 453 | if( SUCCEEDED(result) ) |
|---|
| 355 | 454 | { |
|---|
| 356 | | VLC_VolumeMute(i_vlc); |
|---|
| | 455 | libvlc_exception_t ex; |
|---|
| | 456 | libvlc_exception_init(&ex); |
|---|
| | 457 | |
|---|
| | 458 | libvlc_audio_toggle_mute(p_libvlc, &ex); |
|---|
| | 459 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 460 | { |
|---|
| | 461 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 462 | libvlc_exception_get_message(&ex)); |
|---|
| | 463 | libvlc_exception_clear(&ex); |
|---|
| | 464 | return E_FAIL; |
|---|
| | 465 | } |
|---|
| | 466 | return NOERROR; |
|---|
| 357 | 467 | } |
|---|
| 358 | 468 | return result; |
|---|
| … | … | |
| 365 | 475 | |
|---|
| 366 | 476 | libvlc_instance_t *p_libvlc; |
|---|
| 367 | | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| | 477 | HRESULT hr = _p_instance->getVLC(&p_libvlc); |
|---|
| 368 | 478 | if( SUCCEEDED(hr) ) |
|---|
| 369 | 479 | { |
|---|
| … | … | |
| 917 | 1027 | STDMETHODIMP VLCControl::get_PlaylistCount(int *count) |
|---|
| 918 | 1028 | { |
|---|
| 919 | | libvlc_instance_t *p_libvlc; |
|---|
| | 1029 | if( NULL == count ) |
|---|
| | 1030 | return E_POINTER; |
|---|
| | 1031 | |
|---|
| | 1032 | *count = 0; |
|---|
| | 1033 | libvlc_instance_t* p_libvlc; |
|---|
| 920 | 1034 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 921 | 1035 | if( SUCCEEDED(result) ) |
|---|
| 922 | 1036 | { |
|---|
| 923 | | *count = VLC_PlaylistNumberOfItems(i_vlc); |
|---|
| | 1037 | libvlc_exception_t ex; |
|---|
| | 1038 | libvlc_exception_init(&ex); |
|---|
| | 1039 | |
|---|
| | 1040 | *count = libvlc_playlist_items_count(p_libvlc, &ex); |
|---|
| | 1041 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 1042 | { |
|---|
| | 1043 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 1044 | libvlc_exception_get_message(&ex)); |
|---|
| | 1045 | libvlc_exception_clear(&ex); |
|---|
| | 1046 | return E_FAIL; |
|---|
| | 1047 | } |
|---|
| 924 | 1048 | return NOERROR; |
|---|
| 925 | 1049 | } |
|---|
| 926 | | *count = 0; |
|---|
| 927 | 1050 | return result; |
|---|
| 928 | 1051 | }; |
|---|
| … | … | |
| 930 | 1053 | STDMETHODIMP VLCControl::playlistNext(void) |
|---|
| 931 | 1054 | { |
|---|
| 932 | | libvlc_instance_t *p_libvlc; |
|---|
| | 1055 | libvlc_instance_t* p_libvlc; |
|---|
| 933 | 1056 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 934 | 1057 | if( SUCCEEDED(result) ) |
|---|
| 935 | 1058 | { |
|---|
| 936 | | VLC_PlaylistNext(i_vlc); |
|---|
| | 1059 | libvlc_exception_t ex; |
|---|
| | 1060 | libvlc_exception_init(&ex); |
|---|
| | 1061 | |
|---|
| | 1062 | libvlc_playlist_next(p_libvlc, &ex); |
|---|
| | 1063 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 1064 | { |
|---|
| | 1065 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 1066 | libvlc_exception_get_message(&ex)); |
|---|
| | 1067 | libvlc_exception_clear(&ex); |
|---|
| | 1068 | return E_FAIL; |
|---|
| | 1069 | } |
|---|
| 937 | 1070 | return NOERROR; |
|---|
| 938 | 1071 | } |
|---|
| … | … | |
| 942 | 1075 | STDMETHODIMP VLCControl::playlistPrev(void) |
|---|
| 943 | 1076 | { |
|---|
| 944 | | libvlc_instance_t *p_libvlc; |
|---|
| | 1077 | libvlc_instance_t* p_libvlc; |
|---|
| 945 | 1078 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 946 | 1079 | if( SUCCEEDED(result) ) |
|---|
| 947 | 1080 | { |
|---|
| 948 | | VLC_PlaylistPrev(i_vlc); |
|---|
| | 1081 | libvlc_exception_t ex; |
|---|
| | 1082 | libvlc_exception_init(&ex); |
|---|
| | 1083 | |
|---|
| | 1084 | libvlc_playlist_prev(p_libvlc, &ex); |
|---|
| | 1085 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 1086 | { |
|---|
| | 1087 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 1088 | libvlc_exception_get_message(&ex)); |
|---|
| | 1089 | libvlc_exception_clear(&ex); |
|---|
| | 1090 | return E_FAIL; |
|---|
| | 1091 | } |
|---|
| 949 | 1092 | return NOERROR; |
|---|
| 950 | 1093 | } |
|---|
| … | … | |
| 954 | 1097 | STDMETHODIMP VLCControl::playlistClear(void) |
|---|
| 955 | 1098 | { |
|---|
| 956 | | libvlc_instance_t *p_libvlc; |
|---|
| | 1099 | libvlc_instance_t* p_libvlc; |
|---|
| 957 | 1100 | HRESULT result = _p_instance->getVLC(&p_libvlc); |
|---|
| 958 | 1101 | if( SUCCEEDED(result) ) |
|---|
| 959 | 1102 | { |
|---|
| 960 | | VLC_PlaylistClear(i_vlc); |
|---|
| | 1103 | libvlc_exception_t ex; |
|---|
| | 1104 | libvlc_exception_init(&ex); |
|---|
| | 1105 | |
|---|
| | 1106 | libvlc_playlist_clear(p_libvlc, &ex); |
|---|
| | 1107 | if( libvlc_exception_raised(&ex) ) |
|---|
| | 1108 | { |
|---|
| | 1109 | _p_instance->setErrorInfo(IID_IVLCControl, |
|---|
| | 1110 | libvlc_exception_get_message(&ex)); |
|---|
| | 1111 | libvlc_exception_clear(&ex); |
|---|
| | 1112 | return E_FAIL; |
|---|
| | 1113 | } |
|---|
| 961 | 1114 | return NOERROR; |
|---|
| 962 | 1115 | } |
|---|
| … | … | |
| 973 | 1126 | { |
|---|
| 974 | 1127 | *version = BSTRFromCStr(CP_UTF8, versionStr); |
|---|
| 975 | | |
|---|
| 976 | | return NULL == *version ? E_OUTOFMEMORY : NOERROR; |
|---|
| | 1128 | return (NULL == *version) ? E_OUTOFMEMORY : NOERROR; |
|---|
| 977 | 1129 | } |
|---|
| 978 | 1130 | *version = NULL; |
|---|