EMIT_EXCEPTION_BRIDGE( VLCPlaylistItems )
EMIT_EXCEPTION_BRIDGE( VLCPlaylist )
EMIT_EXCEPTION_BRIDGE( VLCVideo )
+EMIT_EXCEPTION_BRIDGE( VLCSubtitle )
#undef EMIT_EXCEPTION_BRIDGE
libvlc_exception_init(&ex);
// get the number of audio track available and return it
*trackNumber = libvlc_audio_get_track_count(p_md, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCAudio,
- libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ hr = exception_bridge(&ex);
}
return hr;
};
// get tracks description
p_trackDesc = libvlc_audio_get_track_description(p_md, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
+ hr = exception_bridge(&ex);
+ if( FAILED(hr) )
+ return hr;
//get the number of available track
i_limit = libvlc_audio_get_track_count(p_md, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
+ hr = exception_bridge(&ex);
+ if( FAILED(hr) )
+ return hr;
// check if the number given is a good one
if ( ( trackID > ( i_limit -1 ) ) || ( trackID < 0 ) )
libvlc_exception_init(&ex);
*state = libvlc_media_player_get_state(p_md, &ex);
- if( ! libvlc_exception_raised(&ex) )
+ if( libvlc_exception_raised(&ex) )
{
- return NOERROR;
+ // don't fail, just return the idle state
+ *state = 0;
+ libvlc_exception_clear(&ex);
}
- libvlc_exception_clear(&ex);
- // don't fail, just return the idle state
- *state = 0;
- return NOERROR;
}
return hr;
};
libvlc_exception_init(&ex);
*spu = libvlc_video_get_spu(p_md, &ex);
- if( ! libvlc_exception_raised(&ex) )
- {
- return NOERROR;
- }
- _p_instance->setErrorInfo(IID_IVLCSubtitle, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
+ hr = exception_bridge(&ex);
}
return hr;
};
libvlc_exception_init(&ex);
libvlc_video_set_spu(p_md, spu, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCSubtitle, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ hr = exception_bridge(&ex);
}
return hr;
};
libvlc_exception_init(&ex);
// get the number of video subtitle available and return it
*spuNumber = libvlc_video_get_spu_count(p_md, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCSubtitle, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
- return NOERROR;
+ hr = exception_bridge(&ex);
}
return hr;
};
// get subtitles description
p_spuDesc = libvlc_video_get_spu_description(p_md, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCSubtitle, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
+ hr = exception_bridge(&ex);
+ if( FAILED(hr) )
+ return hr;
// get the number of available subtitle
i_limit = libvlc_video_get_spu_count(p_md, &ex);
- if( libvlc_exception_raised(&ex) )
- {
- _p_instance->setErrorInfo(IID_IVLCSubtitle, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
- }
+ hr = exception_bridge(&ex);
+ if( FAILED(hr) )
+ return hr;
// check if the number given is a good one
if ( ( nameID > ( i_limit -1 ) ) || ( nameID < 0 ) )
char *psz_filepath = path;
/* first convert to unicode using current code page */
WCHAR wpath[MAX_PATH+1];
- if( 0 == MultiByteToWideChar(CP_ACP, 0, filepath, -1, wpath, sizeof(wpath)/sizeof(WCHAR)) )
+ if( 0 == MultiByteToWideChar(CP_ACP, 0, filepath, -1,
+ wpath, sizeof(wpath)/sizeof(WCHAR)) )
return E_FAIL;
#endif
/* convert to UTF8 */
- pathlen = WideCharToMultiByte(CP_UTF8, 0, wpath, -1, psz_filepath, sizeof(path), NULL, NULL);
- // fail if path is 0 or too short (i.e pathlen is the same as storage size)
+ pathlen = WideCharToMultiByte(CP_UTF8, 0, wpath, -1,
+ psz_filepath, sizeof(path), NULL, NULL);
+ // fail if path is 0 or too short (i.e pathlen is the same as
+ // storage size)
+
if( (0 == pathlen) || (sizeof(path) == pathlen) )
return E_FAIL;
/* take snapshot into file */
libvlc_video_take_snapshot(p_md, psz_filepath, 0, 0, &ex);
- if( ! libvlc_exception_raised(&ex) )
+ hr = exception_bridge(&ex);
+ if( SUCCEEDED(hr) )
{
- hr = E_FAIL;
/* open snapshot file */
- HANDLE snapPic = LoadImage(NULL, filepath, IMAGE_BITMAP,0, 0, LR_CREATEDIBSECTION|LR_LOADFROMFILE);
+ HANDLE snapPic = LoadImage(NULL, filepath, IMAGE_BITMAP, 0, 0,
+ LR_CREATEDIBSECTION|LR_LOADFROMFILE);
if( snapPic )
{
PICTDESC snapDesc;
snapDesc.bmp.hbitmap = (HBITMAP)snapPic;
snapDesc.bmp.hpal = NULL;
- hr = OleCreatePictureIndirect(&snapDesc, IID_IPictureDisp, TRUE, (LPVOID*)picture);
+ hr = OleCreatePictureIndirect(&snapDesc, IID_IPictureDisp,
+ TRUE, (LPVOID*)picture);
if( FAILED(hr) )
{
*picture = NULL;
}
}
DeleteFile(filepath);
- return hr;
}
- _p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
- libvlc_exception_clear(&ex);
- return E_FAIL;
}
return hr;
};