QMedia
![]() |
![]() |
QM_SearchText(movieRef; searchText; searchFlags; sampleTime; textOffset; trackID):error | |||
![]() |
movieRef | Longint | Movie reference |
![]() |
searchText | String255 | Search string |
![]() |
searchFlags | Longint | Search flags |
![]() |
sampleTime | Longint | Text sample time |
![]() |
textOffset | Longint | Text offset |
![]() |
trackID | Longint | Text track ID |
![]() |
error | Longint | Error result |
Searches the text tracks of a movie.
Parameter movieRef is the reference to the movie instance. The movie reference must have been previously obtained with a call to QM_NewMovieFromFile.
The text to search for is specified by the searchText parameter.
Parameter searchFlags is a set of flags controlling various search options. The searchFlags parameter can be constructed by combining (with addition or bitwise "or") any of the following constants.
qm_SearchEdgeOK | 0x00000001 | It is OK to find text at the specified sample time |
qm_SearchCaseSensitive | 0x00000002 | Search is case sensitive |
qm_SearchReverseSearch | 0x00000004 | Search from the specified sample time backwards |
qm_SearchWrapAround | 0x00000008 | Wrap around when reaching the beginning or end of movie |
qm_SearchUseOffset | 0x00000010 | Begin search at the specified offset into the text sample rather than the edge |
qm_SearchDontGoToFoundTime | 0x00010000 | Don't go to the found time |
qm_SearchDontHiliteFoundText | 0x00020000 | Don't highlight the found text |
qm_SearchOneTrackOnly | 0x00040000 | Search only the specified track |
qm_SearchEnabledTracksOnly | 0x00080000 | Search only the enabled tracks |
Parameter sampleTime specifies the point in the movie where the search will begin. If the search completes successfully, sampleTime receives the time of the found text sample, otherwise it is set to -1.
Parameter textOffset is the offset in the text sample specified by sampleTime where the search will begin. If qm_searchUseOffset is not specified in searchFlags, textOffset is ignored. If the search completes successfully, textOffset receives the offset of the found text in the found text sample.
Parameter trackID is the ID of the text track to search. If qm_searchOneTrackOnly is not specified in searchFlags, trackID is ignored. If the search completes successfully, trackID receives the ID of the track where the text was found.
Example
C_LONGINT($currTime;$flags;$err) $err:=QM_GetCurrentTime ($movie;$currTime) $flags:=qm_SearchEdgeOK | qm_searchCaseSensitive $err:=QM_SearchText ($movie;"search text";$flags;$currTime) |