{*------------------------------------------------------------------------------
  Returns the capabilities of this database connection

  @return       A set of zero or more of the following values:
                dcUpdateItem: Playlist items can be saved back into the database
                dcReverseLookup: Database can lookup items based on their
                filename
-------------------------------------------------------------------------------}
function GetCapabilities: TDatabaseCapabilities;
begin
end;

{*------------------------------------------------------------------------------
  Connect to the database. Raise exception if connection fails.
-------------------------------------------------------------------------------}
procedure Connect;
begin
end;

{*------------------------------------------------------------------------------
  Disconnect from database.
-------------------------------------------------------------------------------}
procedure Disconnect;
begin
end;

{*------------------------------------------------------------------------------
  This function is called periodically every few seconds while the connection
  is alive. It can be used to perform background caching tasks etc.
-------------------------------------------------------------------------------}
procedure IsConnected;
begin
end;

{*------------------------------------------------------------------------------
  Check if the database connection is still alive.

  @return       true of connection is still alive,
                false if connection was terminated by the server
-------------------------------------------------------------------------------}
function ConnectionAlive: boolean;
begin
end;

{*------------------------------------------------------------------------------
  Search for items in the database.

  @param SearchString   The string to search for.
  @param ResultPlaylist The playlist the matching items must be added to.
-------------------------------------------------------------------------------}
procedure SearchItems(SearchString: string; ResultPlaylist: IPlaylist);
begin
end;

{*------------------------------------------------------------------------------
  Retrieve an item from the playlist based on its ID.

  @param ID   The ID of the item which is to be created.
  @return     The playlist item object as an IPlaylistItem reference.
-------------------------------------------------------------------------------}
function CreatePlaylistItem(ID: string): IPlaylistItem;
begin
end;

{*------------------------------------------------------------------------------
  Retrieve the playlist for a particular time slot.

  @param Slot             The time slot (date and hour)
  @param ResultPlaylist   The playlist object to add the items to.
-------------------------------------------------------------------------------}
procedure GetPlaylist(Slot: TDateTime; ResultPlaylist: IPlaylist);
begin
end;

{*------------------------------------------------------------------------------
  Retrieve a playlist based on its internal ID. This method can be implemented
  for databases that do not have a "time slot" playlist facility, like e.g.
  iTunes. The data can later be accessed by other scripts.

  @param ID               The ID.
  @param ResultPlaylist   The playlist object to add the items to.
-------------------------------------------------------------------------------}
procedure GetPlaylistByID(iID: string; ResultPlaylist: IPlaylist);
begin
end;

{*------------------------------------------------------------------------------
  Execute an SQL statement. This function can be invoke by other scripts
  using the IDatabase.ExecuteSQL method.

  @param SQL               The SQL statement to execute.
-------------------------------------------------------------------------------}
procedure ExecuteSQL(SQL: string);
begin
end;

{*------------------------------------------------------------------------------
  Add items to a particular node of the database browser tree. This procedure
  receives information about the parent node which is to be filled, and then
  has to call Tree.AddNode for each child to be added to that node.

  @param Tree             A reference to the tree object. Use the AddNode
                          method of that object to add nodes to it. Use the
                          GetNodeType etc. methods to retrieve information
                          about a particular node, e.g. the parent node passed
                          to this procedure.
  @param Parent           The ID of the parent node. Must be passed to
                          Tree.AddNode. Can also be used to retrieve information
                          about the parent node through the Tree object.
  @param ThisDatabase     Reference to the IDatabase interface of the current
                          database. Must be passed to Tree.AddNode.
  @param NodeType         The type of the parent node.
  @param Caption          The caption of the parent node.
  @param Duration         The duration of the parent node.
  @param ExpectChildren   Did the parent node expect any child nodes?
  @param Duration         The duration of the parent node.
  @param Data             The data of the parent node.
-------------------------------------------------------------------------------}
procedure FillDatabaseTree(Tree: IDatabaseTree; Parent: integer;
  ThisDatabase: IDatabase; NodeType: TDatabaseTreeNodeType; Caption: string;
  Duration: TTimeValue; ExpectChildren: boolean; Data: string);
begin
end;

{*------------------------------------------------------------------------------
  Save a playlist item back to the database. You must return dcUpdateItem in
  GetCapabilities for this function to be enabled. Use Item.GetDatabaseID
  to retrieve the ID of the item.

  @param Item             The playlist item to be saved.
-------------------------------------------------------------------------------}
procedure SavePlaylistItem(Item: IPlaylistItem);
begin
end;

{*------------------------------------------------------------------------------
  Check if a particular file is stored in this database, and if so, create the
  playlist item for it.

  @param Filename         The name of the file to look up.
  @param ResultItem       The playlist item of that file. If the file is not
                          stored in the database, set ResultItem to nil or
                          leave it untouched.
-------------------------------------------------------------------------------}
procedure ReverseLookup(Filename: string; var ResultItem: IPlaylistItem);
begin
end;

begin
end.