
(Ordermethod is called 'Playback Order' in the user documentation,
because that makes more sense to the user. Within AMPlay however,
it is still called ordermethod, and variables and FN/PROCs involved
tend to have om_ as a prefix.)

Plan A was how amplay 1.5x does it.

Plan B was partially implemented, didn't really work, and was
ripped out again.

Playback order, Plan C

This is what is actually implemented in 2.00



Problems it aims to solve;

Blind Guardian problem:

tracks 1,3,5,7 = linking tracks. not to be played except in order with
other tracks in the album.  = Don't want them shuffled.
tracks 2,4,6 = good anytime. = Always play
track 8 = dire. never want to hear it. = never play

Moby problem;

tracks 1-10 are all remixes of same track. Only want random tracks,
never want to hear entire album.


can be condensed to four states;

- always play
- Only play in playlist order (=linear)
- Only play in isolation.
- never play

So, proposed plan c;

a=Ordered filter (one word per track)
b=Isolated filter (one word per track)

bg prob;
1,3,5,7= 10
2,4,6=   11
8=       00

Moby
1-10=    01

ordermethod : filter
NNR : b
NRL : a
NRR : ?
problem: what applies for shuffle within album? Filter a is for playing
tracks in order, and filter b is for playing tracks in isolation. If we
allow a to apply here, then we don't fix the bg problem. If we allow b,
then we don't fix the moby problem. We need to use (a AND b).

A further problem is what to do when importing the 1.5x state. It has
two bits per filter, but in a different layout, and with the random bit
having a subtly different meaning. In 1.5x, tracks with only the random
bit set are played when in shuffle-in-album mode. in 2.00, they would
not.)

ways around this;

- Store a third word per track, keeping a AND b.

- import 1.5x states as is. It's the closest approximation.

As far as the user is concerned, there is still a single filter - it
just has four states (always, only in order, only in isolation, never).
Sprites needed for this, and code to cycle through the states.

For 1.5x use, there is no longer a play track in random track and on
shuffle within block, but not in linear mode. This is because random
track is now treated as a different type of playback mode altogether.

By storing a third word, even though the information it contains
is redundant, it allows all the existing filter code to work with
minor tweaks. It just needs to decide which filter word it should
be reading.

This is done by a variable called a_whichfilter%. This always
equals o_tfilterlin%, o_tfilteriso%, or o_tfilterboth%, as
appropriate for the current ordermethod.

Any routine can therefore decide whether track c% passes the current
filter by;

IF (FNdb_tracks(c%,a_whichfilter%) AND a_activefilters%)>0 THEN
 REM passes filter.
ELSE
 REM blocked by filter.
ENDIF


further complexity;

When in, say, random track mode, what should happen when the user uses
the goto menu to queue an album. This should probably make use of the
most appropriate filter for an entire album.

In all circumstances except random track, the current filter (linear or
shuffled) would be the correct one to use. For random track mode though
the current filter is specifically for things you never want to hear a
whole album of (plus the always play stuff).

One resolution for this would have albums/artists queued by the goto
menus or the db interface use the 'always play' filter if the current
mode is random track, and the current filter otherwise.

Also, if the current mode includes shuffle albums within artist, then
picking an artist should play those albums shuffled.

Likewise if the current mode includes shuffle within blah, when picking
an album or artist the tracks should be shuffled.

This would also apply to the generation of the goto album and goto
artist menus (tracks menu could always use the current filter, even in
random album mode)

This is handled by a further variable - a_menufilter%, which the
album and artist menus use.



Complete list of ordermethods;

N=not involved - ignore.
R=random if at selection level, shuffled otherwise
L=linear

selection level is first item set to something other than N.

Artist, Album, Track                                    Filter    Level

 1  NNL = linear tracks                                      a    Track
 2  NNR = random tracks                                      b    Track
 3  NRL = random album, linear tracks                        a    Album
 4  NRR = random album, shuffled tracks                      c    Album
 5  NLL = linear album, linear tracks  [*]                   a    Album
 6  NLR = linear album, shuffled tracks                      c    Album
 7  LNL = linear artist, linear tracks  [*]                  a    Artist
 8  LNR = linear artist, shuffled tracks                     c    Artist
 9  LRL = linear artist, shuffled albums, linear tracks      a    Artist
10  LRR = linear artist, shuffled albums, shuffled tracks    c    Artist
11  LLL = linear artist, linear albums, linear tracks [+]    a    Artist
12  LLR = linear artist, linear albums, shuffled tracks [=]  c    Artist
13  RNL = random artist, linear tracks                       a    Artist
14  RNR = random artist, shuffled tracks                     c    Artist
15  RRL = random artist, shuffled albums, linear tracks      a    Artist
16  RRR = random artist, shuffled albums, shuffled tracks [#]c    Artist
17  RLL = random artist, linear albums, linear tracks        a    Artist
18  RLR = random artist, linear albums, shuffled tracks      c    Artist


[*] Same as 1 in terms of resulting order of tracks played. However
they differ in terms of how far ahead things are stacked up in the
history.

[+] absolutely identical to 7.

[=] 12 is NOT the same as 8. 8 shuffles all tracks within the artist
freely. 12 only mixes tracks within their albums, and plays the albums
in order.

[#] 16 is NOT the same as 14 for the same reason that 8 is not the same
as 12.

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

