okie, i'll add a getversion function in next release.
you can use set event function to set it event to your main windows.
function BassVideo_SetEventNotify(Handle : HSTREAM; hwnd: OAHWND; lMsg: Longint; lInstanceData: Longint) : BOOL; stdcall;
Handle :[in] channel handle
hwnd : [in] Handle to the window, or NULL to stop receiving event messages.
lMsg : [in] Window message to be passed as the notification. (should be WM_EVENT)
lInstanceData : [in] Value to be passed as the lParam parameter for the lMsg message. (should use WM_Event_Lparam)
after that in your wnd proc code
procedure TForm1.WndProc(var Msg: TMessage);
var EVCode, p1, p2 : integer;
begin
inherited;
case Msg.Msg of
....
WM_EVENT : begin
if BassVideo_GetEvent(chan, EVCode, p1, p2, 200) then
begin
case EVCode of
EC_BUFFERING_DATA :
begin
end;
EC_COMPLETE :
begin
end;
end;
end;
end;
end;
end;
The EC_COMPLETE event indicates that playback has completed normally.
The EC_USERABORT event indicates that the user has interrupted playback. Video renderers send this event if the user closes the video window.
The EC_ERRORABORT event indicates that an error has caused playback to halt.
this is from directshow sdk :
Event notification code Description
EC_ACTIVATE A video window is being activated or deactivated.
EC_BANDWIDTHCHANGE Not supported.
EC_BUFFERING_DATA The graph is buffering data, or has stopped buffering data.
EC_BUILT Send by the Video Control when a graph has been built. Not forwarded to applications.
EC_CLOCK_CHANGED The reference clock has changed.
EC_CLOCK_UNSET The clock provider was disconnected.
EC_CODECAPI_EVENT Sent by an encoder to signal an encoding event.
EC_COMPLETE All data from a particular stream has been rendered.
EC_CONTENTPROPERTY_CHANGED Not supported.
EC_DEVICE_LOST A Plug and Play device was removed or has become available again.
EC_DISPLAY_CHANGED The display mode has changed.
EC_END_OF_SEGMENT The end of a segment has been reached.
EC_EOS_SOON Not supported.
EC_ERROR_STILLPLAYING An asynchronous command to run the graph has failed.
EC_ERRORABORT An operation was aborted because of an error.
EC_ERRORABORTEX An operation was aborted because of an error.
EC_EXTDEVICE_MODE_CHANGE Not supported.
EC_FILE_CLOSED The source file was closed because of an unexpected event.
EC_FULLSCREEN_LOST The video renderer is switching out of full-screen mode.
EC_GRAPH_CHANGED The filter graph has changed.
EC_LENGTH_CHANGED The length of a source has changed.
EC_LOADSTATUS Notifies the application of progress when opening a network file.
EC_MARKER_HIT Not supported.
EC_NEED_RESTART A filter is requesting that the graph be restarted.
EC_NEW_PIN Not supported.
EC_NOTIFY_WINDOW Notifies a filter of the video renderer's window.
EC_OLE_EVENT A filter is passing a text string to the application.
EC_OPENING_FILE The graph is opening a file, or has finished opening a file.
EC_PALETTE_CHANGED The video palette has changed.
EC_PAUSED A pause request has completed.
EC_PLEASE_REOPEN The source file has changed.
EC_PREPROCESS_COMPLETE Sent by the WM ASF Writer filter when it completes the pre-processing for multipass encoding.
EC_PROCESSING_LATENCY Indicates the amount of time that a component is taking to process each sample.
EC_QUALITY_CHANGE The graph is dropping samples, for quality control.
EC_RENDER_FINISHED Not supported.
EC_REPAINT A video renderer requires a repaint.
EC_SAMPLE_LATENCY Specifies how far behind schedule a component is for processing samples.
EC_SAMPLE_NEEDED Requests a new input sample from the Enhanced Video Renderer (EVR) filter.
EC_SCRUB_TIME Specifies the time stamp for the most recent frame step.
EC_SEGMENT_STARTED A new segment has started.
EC_SHUTTING_DOWN The filter graph is shutting down, prior to being destroyed.
EC_SNDDEV_IN_ERROR A device error has occurred in an audio capture filter.
EC_SNDDEV_OUT_ERROR A device error has occurred in an audio renderer filter.
EC_STARVATION A filter is not receiving enough data.
EC_STATE_CHANGE The filter graph has changed state.
EC_STATUS Contains two arbitrary status strings.
EC_STEP_COMPLETE A filter performing frame stepping has stepped the specified number of frames.
EC_STREAM_CONTROL_STARTED A stream-control start command has taken effect.
EC_STREAM_CONTROL_STOPPED A stream-control stop command has taken effect.
EC_STREAM_ERROR_STILLPLAYING An error has occurred in a stream. The stream is still playing.
EC_STREAM_ERROR_STOPPED A stream has stopped because of an error.
EC_TIMECODE_AVAILABLE Not supported.
EC_UNBUILT Send by the Video Control when a graph has been torn down. Not forwarded to applications.
EC_USERABORT The user has terminated playback.
EC_VIDEO_SIZE_CHANGED The native video size has changed.
EC_VIDEOFRAMEREADY A video frame is ready for display.
EC_VMR_RECONNECTION_FAILED Sent by the VMR-7 and the VMR-9 when it was unable to accept a dynamic format change request from the upstream decoder.
EC_VMR_RENDERDEVICE_SET Sent when the VMR has selected its rendering mechanism.
EC_VMR_SURFACE_FLIPPED Sent when the VMR-7's allocator presenter has called the DirectDraw Flip method on the surface being presented.
EC_WINDOW_DESTROYED The video renderer was destroyed or removed from the graph.
EC_WMT_EVENT Sent by the Windows Media Format SDK when an application uses the ASF Reader filter to play ASF files protected by digital rights management (DRM).
EC_WMT_INDEX_EVENT Sent by the Windows Media Format SDK when an application uses the ASF Writer to index Windows Media Video files.