Search scripts: Difference between revisions
No edit summary |
(Fixed formatting) |
||
Line 12: | Line 12: | ||
This procedure initializes the whole search. It's called only once when search is started. Its parameters are: | This procedure initializes the whole search. It's called only once when search is started. Its parameters are: | ||
;Panel | |||
:Object of [[SDBUITranspPanel]] where you can place the controls showing results. Usually, e.g. in [[Sample AMG Search script]], it is [[SDBUIActiveX]] control containing a web browser. | |||
;SearchTerm | |||
:The term user searches for. In case the search string wasn't entered by the user, it's a compilation of Artist and Album values (with some useless characters removed). | |||
;SearchArtist | |||
:Artist extracted from tracks that are being search for. In case the search is initiated by user entering a search string, this value is empty. | |||
;SearchAlbum | |||
:Album extracted from tracks that are being search for. In case the search is initiated by user entering a search string, this value is empty. | |||
In case you need details about the tracks that are being searched, use [[ISDBWebSearch::NewTracks]] property to access individual tracks. | In case you need details about the tracks that are being searched, use [[ISDBWebSearch::NewTracks]] property to access individual tracks. | ||
When search results are returned, you should use [[ISDBWebSearch::SetSearchResults]] to let MediaMonkey know about it. | |||
====Sub ShowResult( ResultID)==== | |||
====Sub FinishSearch( Panel)==== |
Revision as of 14:04, 10 April 2007
Search scripts let developers to plug-in new search types into Auto-tag from Web dialog (formerly Auto-tag from Amazon). You can learn most about them from a well commented Sample AMG Search script. This script type was introduced in MediaMonkey 3.0.
Search script basics
Each search script must be in a separate file (usually .vbs) and must contain several procedures that MediaMonkey calls. The script remains loaded in memory during the whole life of searching (i.e. starting from initialization of a search until user choosed different search method or searches for something else). Therefore you can use global script variables and keep values in them among calls to the procedures of script.
Search script structure
Each search script must contain several procedures so that it can properly respond to what user and MediaMonkey want from it. The required procedures are:
Sub StartSearch( Panel, SearchTerm, SearchArtist, SearchAlbum)
This procedure initializes the whole search. It's called only once when search is started. Its parameters are:
- Panel
- Object of SDBUITranspPanel where you can place the controls showing results. Usually, e.g. in Sample AMG Search script, it is SDBUIActiveX control containing a web browser.
- SearchTerm
- The term user searches for. In case the search string wasn't entered by the user, it's a compilation of Artist and Album values (with some useless characters removed).
- SearchArtist
- Artist extracted from tracks that are being search for. In case the search is initiated by user entering a search string, this value is empty.
- SearchAlbum
- Album extracted from tracks that are being search for. In case the search is initiated by user entering a search string, this value is empty.
In case you need details about the tracks that are being searched, use ISDBWebSearch::NewTracks property to access individual tracks.
When search results are returned, you should use ISDBWebSearch::SetSearchResults to let MediaMonkey know about it.