Auto-DJ description

This bug describes a feature set that can be implemented as a plugin. It can function as an Alarm, or as an automated DJ for a party or radio station. It supercedes features described in #829 (auto-play) and #470 (alarm).  To be fully functional, it is dependent upon the implementation of many other features in MM (see additional information), however, it can even be useful, though less so, with MediaMonkey's current feature set.

The primary objectives of the feature are:
1) Alarm: must be simple to configure MM to fade in music at any particular time on any particular set of days.  It should be a 2-3 step intuitive operation.
2) Allow MediaMonkey to suppress silence i.e. to automatically play 'something' when the Now Playing list has run out OR the Now Playing list contains nothing in it and the user presses Play.
3) Allow a Pro version of MediaMonkey to be sold that allows for sophisticated scheduling.
.i Support for scheduled Jingles/Ads (prioritized)
.ii Display scheduled events
.iii Ability to set weights on playlists (e.g. all tracks in playlist A on heavy rotation)

Note: Manual (unscheduled) Jingles/Ads should also be playable in some manner, however, this will be treated as a separate feature (that would also be part of the Pro version).

Description of Implementation:
------------------------------
a) The functionality should be accessible via:
-An alarm button on the advanced toolbar
-A menu entry just above 'Sleep'
-Selecting the plugin and pressing 'Configure'
-->Pressing either of these buttons --> Auto-DJ dialog appears

b) Auto-DJ must be localizable in the same manner as MediaMonkey is (i.e. using .pot file bundled with the installer & configured via the General|Language option)

c) It would be nice to utilize MediaMonkey themes within the plugin.  This can only be done if some level of support for this is added to the main app.

d) The dialog should have it's own Auto-DJ entry on the toolbar so that the user can control whether it or the MediaMonkey main panel is on top.

e) The plugin should make all features available if the user has upgraded to Professional.  If not, it should only allow support for a single alarm entry in addition to the silence suppression 'AutoPlay' entry (i.e. 2 entries in total).  If a non-Gold user attempts to add a third entry, the following message should appear 'MediaMonkey Auto-DJ provides advanced scheduling functionality so that you can create advanced playlist rotations for parties, bars, background music in shopping centers, or radio broadcasts. If you wish to add more than 2 Auto-DJ entries and use MediaMonkey for commercial use, you need to purchase the Professional version.

Auto-DJ dialog
The dialog should consist of three main sections:
1) List of all jobs (this section is where the user is able to add new jobs)
2) List of jobs on a specified date

f) Event list:
|--Event--|--------Event Schedule---------------|--Date Limiter--|---------------|Now Playing|          |
|--Name---|S M T W T F S . . Time(s) . |Priority| . Start - End .|-Playlist------|Queue Depth|--Actions-|
|[]<name>-|[][][][][][][]. .<times> . .|--<pri>-| <date> - <date>| <Playlist>----| . <x>. . .| <actions>| 
| . <Add new scheduled event>
---------------------------------------------------------------------------------------------------------------------------
The events list functions similarly to the criteria lists in the advanced autoplaylist panel:
-To create a new entry, the user simply clicks <Add new scheduled event> and the dialog described in j) appears.
-To edit an existing entry, the user clicks it to select it and then clicks again causing j) to appear.
-To enable an event, just click the checkbox next to it

g) Scheduled Events <Date> (set to todays date by default)
|----|--Event--|--------Event Schedule---------------|--Date Limiter--|---------------| Now Playing|Fade in|Fade out|
|Time|--Name---|S M T W T F S . . Time . .. |Priority| . Start - End .|-Playlist------| Queue depth| (min) | (min) .|
|time|-<name> -|[][][][][][][]. . <time> . .|--<pri>-| <date> - <date>| <tr/Playlist>-| . .<x>. . .| <min> | <min> .|
---------------------------------------------------------------------------------------------------------------------------
In the scheduled events list, any event that is 1 hour prior to Now or 10 hours after now appears in this window in chronological order.  Events that are currently occuring appear green.  Events about to occur next flash green. Any event set for the specified time but is inactive, is greyed out.

h) At the bottom of the dialog there are the following buttons: <Options>  <Close>  . At this point in time it's unclear what options would need to be configured. 

i) description of variables and their effects:
-[] - Checkbox indicates whether the event is active or not.

-Name: Shows a name for the scheduled event that is meaningful to the user

-The Play Time days indicator: indicates what day(s) the event will occur on

-The Play Time indicators: indicates, in 24hr notation, the duration for an event, or the end-time only, or the start-time(s) only, depending on the type of event (the implication being that depending on the type of event, sometimes a single duration needs to be set, sometimes a single end-time, and sometimes single or multiple start times)  IMPORTANT: If multiple equivalent priority events are scheduled for the same time, the events are played in round-robin fashion--provided they are of equivalent priority.  Otherwise, the higher priority event runs first.

-Priority: indicates the priority level of an event. High priority events finish before lower priority events scheduled for the same time slot can play. Possible values: high, normal, low. 'High' is generally used for events that interrupt others. 'Normal' is used for regular events. 'Low' is used for backup events that occur in case the user forgot to schedule a 'normal' event for a specified time.

-Date Limiter: this optional field sets a limit to the date timeframe during which the scheduled events occur. Otherwise the events have no date driven limitation.

-Playlist: determines what playlist is to be played for the event in question.   (note: as described earlier, the playlist or track is not necessarily played in its entirety)

-Queue depth <x>: Determines the minimum number of tracks that should be kept in the Now Playing queue. Valid values 0-x. If it's zero, then the queue is filled with the contents of that job (to the exclusion of other equal priority events scheduled in that time slot) up to a the maximum that can fit in the slot. If it is 1, the scheduler always ensures that there's 1 track in the Now Playing list after the currently playing track. If it is 2, the scheduler always ensures that there are 2 tracks in the Now Playing list after the currently playing track.

-Fade in: Determines the amount of time to be used for volume to fade from 20% to the current setting of the mixer

-Fade out: Determines the amount of time to be used for volume to fade from current mixer setting to 0%

j) Event editing dialog Layout:
----------------------------------------------------------------------------------------
| Schedule Event
----------------------------------------------------------------------------------------
| Name: Untitled1           | Event Schedule:
----------------------------|-----------------------------------------------------------
| Type:                     | Days:                | Time:
| ( ) Ad/Jingle (Mask)      | [x] Monday           | ( ) Set start time only (play entire playlist)
| ( ) Ad/Jingle             | [x] Tuesday          | ( ) Set time range
| ( ) Alarm                 | [x] Wednesday        | ( ) Set end time (plays now until end time)
| ( ) Sleep                 | [x] Thursday         | 
| (o) Normal Music          | [x] Friday           | From: ______   To: ______ <Add> 
| ( ) AutoPlay Music        | [x] Saturday         | Time1
|                           | [x] Sunday           | Time2
|                           |                      | Time3
|                           | [x] Limit Date Range:|
|                           | From: ____ To: _____ | Priority: <Priority drop down>
----------------------------------------------------------------------------------------
| Playlist Settings:                            | Actions:    
| Playlist: _____________________ <chooser>     | [ ] Fade in at start (minutes): ___ 
| Queue Depth: __ <up/down arrow>               | [ ] Fade out at end (minutes): ___
| Volume:                                       | [ ] Insert Break at end
|                                               | [ ] Turn off at end
|---------------------------------------------------------------------------------------
| <Reset Template>                                                      <OK> <Cancel>
----------------------------------------------------------------------------------------

Event Type Template descriptions:
-Event Type: Indicates the type of event being scheduled and determines how it is handled. There are several types:
--Alarm. Preconfigured with All days enabled, Priority=normal, date limiter not set, queue depth=0, fade-in set to 3 minutes + inserts <break> at end of playlist
--Sleep. Preconfigured with All days greyed out, Priority=normal, Start time: greyed out, End time=60 minutes from current time, date limiter greyed out, playlist=Now Playing, queue depth=0, fade out set to 10 minutes + inserts <break> at end of playlist.
--Normal Music. Preconfigured with Priority=normal, queue depth=3
--Ad/Jingle (Mask).  Preconfigured with priority=high, End Time greyed out, queue depth=0 (this is used for playing an ad/jingle playlist at a specified time while music continues to play)
--Ad/Jingle. Preconfigured with priority=normal, End Time greyed out, queue depth=0 (this is used for playing an ad/jingle playlist immediately following whatever song is playing at the specified time)
--AutoPlay Music. Preconfigured with All days enabled, all times enabled, Priority=low, depth=1 (this is used as a rule to play music from some playlist whenever no other rules have been set and music has stopped playing. 

Addiitonal Variable Descriptions:
-Volume: Values: Default, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% . This is used in case the user wishes to set a custom volume for the event in question. Always defaults to 'Default' (which is the current volume).
-Insert <Break> at end: causes the event to pause the Now Playing list after the event is complete. 
-Turn off at end: causes the computer to turn off after the event is complete.

Note: The time section is structured as it is because in some cases, a single start time is chosen, for others a single end time is chosen, for others a range is chosen, and for others multiple start times can be chosen).  It should be possible to choose times to the minute.

Tooltips:
-Ad/Jingle (Mask) -- Tooltip: This template is used for playing an ad/jingle playlist at a specified time while music continues to play
-Ad/Jingle -- Tooltip: This template is used for playing an ad/jingle playlist immediately following whatever song is playing at the specified time
-Alarm -- Tooltip: This template is used to set a timed alarm
-Sleep -- Tooltip: This template is used to cause MediaMonkey to stop playing music after a set time
-Normal Music -- Tooltip: This template is used to schedule music to play over a range of time
-AutoPlay Music -- Tooltip: This template causes MediaMonkey to play music when no other events have been scheduled and the Now Playing list has run out. 

k) Default AutoPlay entry:
By default an Entry called 'Default AutoPlay' should be created.  Uses the AutoPlay music template, and one of the default Auto-Playlists (preferable a rotation playlist). 

l) Standard functionality
User can't edit anything (but can view it).

m) Gold functionality
User can have and edit up to 3 entries in the list.

n) Pro functionality
User can do whatever they want.