search interface

lookfor:
 tracks      TRK
 albums      ALB
 artists     ART

filter:
 Include Everything                ALL
 Limit to Current filter           CUR

Look in:
 Path to file            PTH
 track name              TRN
 album name              ALN
 artist name             ARN
 Complete name           CMN
 Expanded macro          MAC

Apply action to:
 matching                MAT
 first match only        FIR
 non-matching            NON

Action
 create menu             MEN
 queue                   QUE
 play                    PLY
 remove from database    RDB
 remove from history     RHT
 refresh time            RFT
 export list             EXP
 set filter              FIL
 set relative track volume  VOL
 set random weighting       WGT
 set link to next           LNK
 set ignore uniqueness      UNQ


search block

offset

 0 o_srch_ver%         block version       (4bytes)
 4 o_srch_size%        total block size    (4bytes)
 8 o_srch_flags%       search flags        (4bytes)
12 o_srch_lookfor%     lookfor word        (4bytes)
16 o_srch_filter%      filter word         (4bytes)
20 o_srch_lookin%      lookin word         (4bytes)
24 o_srch_applyto%     applyto word        (4bytes)
28 o_srch_action%      action word         (4bytes)
32 o_srch_actdetail1%  action details word1(4bytes)
36 o_srch_actdetail2%  action details word2(4bytes)
40 o_srch_stroffset%   offset for string   (4bytes)
44 o_srch_macro%       macro               (up to 30 bytes)
!40                    search string       (up to 252 bytes)

The above structure applies to block version 200. It is possible that
later versions may add extra words, although it is more likely (at
first at least) that later versions will just add extra possible states
for the above words.

the macro length is not stored. The macro string, if any, is stored at
offset 40, cr terminated. The search string is stored starting at the
next word boundary, also cr terminated.

If there is no macro, then a gap is still left. In this case the search
string would start at +48

The offset within the block to find the macro string is fixed (44 at
present, for search block version 200. The offset within the block to
find the search string itself is stored within the block at +36. The
theoretical maximum size of a block is 330 bytes, but most blocks will
be much smaller, as search terms of that length should be rare.

The flags word is a bitfield with the following meanings if set;
bit 0: convert spaces to hard spaces
bit 1: search is case sensitive
bit 2: perform raw search
other bits unused, should be 0.

The lookfor, filter, lookin, applyto and action words each comprise 4
bytes, consisting of a three character identifier and a CR. The three
character identifiers are given in the menu structures above. Note that
these strings are note case sensitive, and are hardcoded. i.e. they are
not fetched from the messages file, and so are not language dependant.
They may bear no relation to the text displayed on the corresponding
menu options. The use of strings mean that there is no reliance on magic
numbers that may change meaning between versions.

The action details word contains the data that may be needed to go
along with particular actions. The layout of data within this word will
vary depending on the selected action. Unless indictated below, bits
must be zero.

Action: set filter;
word1: integer from 1-20 specifying which filter.
word2: filterstate: never=0, linear=1, isolated=2, always=3. 

Action: set relative track volume
word1: integer from -63 to +63 specifing volume
word2: bit0 set indicates volume is to be set.
       bit0 unset indicates volume is an alteration to make to existing
       values.

Action: set random weight
word1: integer from -7 to +7 specifing weight
word2: bit0 set indicates weight is to be set.
       bit0 unset indicates weight is an alteration to make to existing
       values.

Action: set linkage or set uniqueness
word1: bit0 indicates new state of linkage or uniqueness.
word2: unused.


See BlockFormats for how search blocks are saved as part of the state

________________________________________________________________________
Copyright  2008 Mike Sandells, mike@mikejs.com
Last Modified: 30.05.2008

