foobar2000 SDK  2015-08-03
Public Types | Public Member Functions
playlist_lockabstract

#include <playlist.h>

+ Inheritance diagram for playlist_lock:

Public Types

enum  {
  filter_add = 1 << 0, filter_remove = 1 << 1, filter_reorder = 1 << 2, filter_replace = 1 << 3,
  filter_rename = 1 << 4, filter_remove_playlist = 1 << 5, filter_default_action = 1 << 6
}
 
- Public Types inherited from service_base
typedef service_base t_interface
 

Public Member Functions

virtual bool execute_default_action (t_size p_item)=0
 
 FB2K_MAKE_SERVICE_INTERFACE (playlist_lock, service_base)
 
virtual t_uint32 get_filter_mask ()=0
 
virtual void get_lock_name (pfc::string_base &p_out)=0
 
virtual void on_playlist_index_change (t_size p_new_index)=0
 
virtual void on_playlist_remove ()=0
 
virtual bool query_item_replace (t_size p_index, const metadb_handle_ptr &p_old, const metadb_handle_ptr &p_new)=0
 
virtual bool query_items_add (t_size p_base, const pfc::list_base_const_t< metadb_handle_ptr > &p_data, const bit_array &p_selection)=0
 
virtual bool query_items_remove (const bit_array &p_mask, bool p_force)=0
 
virtual bool query_items_reorder (const t_size *p_order, t_size p_count)=0
 
virtual bool query_playlist_remove ()=0
 
virtual bool query_playlist_rename (const char *p_new_name, t_size p_new_name_len)=0
 
virtual void show_ui ()=0
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Additional Inherited Members

- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

This interface allows filtering of playlist modification operations.
Implemented by components "locking" playlists; use playlist_manager::playlist_lock_install() etc to takeover specific playlist with your instance of playlist_lock.

Definition at line 3 of file playlist.h.

Member Enumeration Documentation

anonymous enum
Enumerator
filter_add 
filter_remove 
filter_reorder 
filter_replace 
filter_rename 
filter_remove_playlist 
filter_default_action 

Definition at line 5 of file playlist.h.

Member Function Documentation

virtual bool playlist_lock::execute_default_action ( t_size  p_item)
pure virtual

Executes "default action" (doubleclick etc) for specified playlist item. When the playlist is not locked, default action starts playback of the item.

Returns
True if custom default action was executed, false to fall-through to default one for non-locked playlists (start playback).
playlist_lock::FB2K_MAKE_SERVICE_INTERFACE ( playlist_lock  ,
service_base   
)
virtual t_uint32 playlist_lock::get_filter_mask ( )
pure virtual

Queries which actions the lock filters. The return value must not change while the lock is registered with playlist_manager. The return value is a combination of one or more filter_* constants.

virtual void playlist_lock::get_lock_name ( pfc::string_base p_out)
pure virtual

Retrieves human-readable name of playlist lock to display.

virtual void playlist_lock::on_playlist_index_change ( t_size  p_new_index)
pure virtual

Notifies lock about changed index of the playlist, in result of user reordering playlists or removing other playlists.

virtual void playlist_lock::on_playlist_remove ( )
pure virtual

Notifies lock about the locked playlist getting removed.

virtual bool playlist_lock::query_item_replace ( t_size  p_index,
const metadb_handle_ptr p_old,
const metadb_handle_ptr p_new 
)
pure virtual

Queries whether specified item replacement operation is allowed in the locked playlist.

Parameters
p_indexIndex of the item being replaced.
p_oldOld value of the item being replaced.
p_newNew value of the item being replaced.
Returns
True to allow the operation, false to block it.
virtual bool playlist_lock::query_items_add ( t_size  p_base,
const pfc::list_base_const_t< metadb_handle_ptr > &  p_data,
const bit_array p_selection 
)
pure virtual

Queries whether specified item insertiion operation is allowed in the locked playlist.

Parameters
p_baseIndex from which the items are being inserted.
p_dataItems being inserted.
p_selectionCaller-requested selection state of items being inserted.
Returns
True to allow the operation, false to block it.
virtual bool playlist_lock::query_items_remove ( const bit_array p_mask,
bool  p_force 
)
pure virtual

Queries whether specified item removal operation is allowed in the locked playlist.

Parameters
p_maskSpecifies which items from locked playlist are being removed.
p_forceIf set to true, the call is made only for notification purpose and items are getting removed regardless (after e.g. they have been physically removed).
Returns
True to allow the operation, false to block it. Note that return value is ignored if p_force is set to true.
virtual bool playlist_lock::query_items_reorder ( const t_size p_order,
t_size  p_count 
)
pure virtual

Queries whether specified item reorder operation is allowed in the locked playlist.

Parameters
p_orderPointer to array containing permutation defining requested reorder operation.
p_countNumber of items in array pointed to by p_order. This should always be equal to number of items on the locked playlist.
Returns
True to allow the operation, false to block it.
virtual bool playlist_lock::query_playlist_remove ( )
pure virtual

Queries whether removal of the locked playlist is allowed. Note that the lock will be released when the playlist is removed.

Returns
True to allow the operation, false to block it.
virtual bool playlist_lock::query_playlist_rename ( const char *  p_new_name,
t_size  p_new_name_len 
)
pure virtual

Queries whether renaming the locked playlist is allowed.

Parameters
p_new_nameRequested new name of the playlist; a UTF-8 encoded string.
p_new_name_lenLength limit of the name string, in bytes (actual string may be shorter if null terminator is encountered before). Set this to infinite to use plain null-terminated strings.
Returns
True to allow the operation, false to block it.
virtual void playlist_lock::show_ui ( )
pure virtual

Requests user interface of component controlling the playlist lock to be shown.


The documentation for this class was generated from the following file: