foobar2000 SDK  2015-08-03
Public Member Functions
playlist_manager_v2abstract

#include <playlist.h>

+ Inheritance diagram for playlist_manager_v2:

Public Member Functions

virtual bool playlist_get_property (t_size p_playlist, const GUID &p_property, stream_writer *p_stream, abort_callback &p_abort)=0
 
template<typename t_array >
bool playlist_get_property (t_size p_playlist, const GUID &p_property, t_array &p_data)
 
template<typename _t_int >
bool playlist_get_property_int (t_size p_playlist, const GUID &p_property, _t_int &p_value)
 
virtual bool playlist_get_runtime_property (t_size p_playlist, const GUID &p_property, service_ptr_t< service_base > &p_data)=0
 
template<typename _t_interface >
bool playlist_get_runtime_property (t_size p_playlist, const GUID &p_property, service_ptr_t< _t_interface > &p_data)
 
virtual bool playlist_have_property (t_size p_playlist, const GUID &p_property)=0
 
virtual bool playlist_have_runtime_property (t_size p_playlist, const GUID &p_property)=0
 
virtual bool playlist_remove_property (t_size p_playlist, const GUID &p_property)=0
 
virtual bool playlist_remove_runtime_property (t_size p_playlist, const GUID &p_property)=0
 
virtual void playlist_set_property (t_size p_playlist, const GUID &p_property, stream_reader *p_stream, t_size p_size_hint, abort_callback &p_abort)=0
 
template<typename t_array >
void playlist_set_property (t_size p_playlist, const GUID &p_property, const t_array &p_data)
 
template<typename _t_int >
void playlist_set_property_int (t_size p_playlist, const GUID &p_property, _t_int p_value)
 
virtual void playlist_set_runtime_property (t_size p_playlist, const GUID &p_property, service_ptr_t< service_base > p_data)=0
 
- Public Member Functions inherited from playlist_manager
void active_playlist_fix ()
 
bool activeplaylist_add_items (const pfc::list_base_const_t< metadb_handle_ptr > &data, const bit_array &p_selection)
 
bool activeplaylist_add_items_filter (const pfc::list_base_const_t< metadb_handle_ptr > &p_data, bool p_select)
 
bool activeplaylist_add_locations (const pfc::list_base_const_t< const char * > &p_urls, bool p_select, HWND p_parentwnd)
 
void activeplaylist_clear ()
 
void activeplaylist_clear_selection ()
 
void activeplaylist_ensure_visible (t_size p_item)
 
void activeplaylist_enum_items (enum_items_callback &p_callback, const bit_array &p_mask)
 
bool activeplaylist_execute_default_action (t_size p_item)
 
bool activeplaylist_find_item (metadb_handle_ptr p_item, t_size &p_result)
 
void activeplaylist_get_all_items (pfc::list_base_t< metadb_handle_ptr > &out)
 
t_size activeplaylist_get_focus_item ()
 
bool activeplaylist_get_focus_item_handle (metadb_handle_ptr &item)
 
t_size activeplaylist_get_item_count ()
 
bool activeplaylist_get_item_handle (metadb_handle_ptr &item, t_size p_item)
 
metadb_handle_ptr activeplaylist_get_item_handle (t_size p_item)
 
void activeplaylist_get_items (pfc::list_base_t< metadb_handle_ptr > &out, const bit_array &p_mask)
 
bool activeplaylist_get_name (pfc::string_base &p_out)
 
t_size activeplaylist_get_selected_count (bit_array const &p_mask)
 
void activeplaylist_get_selected_items (pfc::list_base_t< metadb_handle_ptr > &out)
 
t_size activeplaylist_get_selection_count (t_size p_max)
 
void activeplaylist_get_selection_mask (bit_array_var &out)
 
t_size activeplaylist_insert_items (t_size p_base, const pfc::list_base_const_t< metadb_handle_ptr > &data, const bit_array &p_selection)
 
bool activeplaylist_insert_items_filter (t_size p_base, const pfc::list_base_const_t< metadb_handle_ptr > &p_data, bool p_select)
 
bool activeplaylist_insert_locations (t_size p_base, const pfc::list_base_const_t< const char * > &p_urls, bool p_select, HWND p_parentwnd)
 
bool activeplaylist_is_item_selected (t_size p_item)
 
bool activeplaylist_is_redo_available ()
 
bool activeplaylist_is_undo_available ()
 
void activeplaylist_item_format_title (t_size p_item, titleformat_hook *p_hook, pfc::string_base &out, const service_ptr_t< titleformat_object > &p_script, titleformat_text_filter *p_filter, play_control::t_display_level p_playback_info_level)
 
t_uint32 activeplaylist_lock_get_filter_mask ()
 
void activeplaylist_move_selection (int p_delta)
 
bool activeplaylist_redo_restore ()
 
bool activeplaylist_remove_items (const bit_array &mask)
 
void activeplaylist_remove_selection (bool p_crop=false)
 
bool activeplaylist_rename (const char *p_name, t_size p_name_len)
 
bool activeplaylist_reorder_items (const t_size *order, t_size count)
 
bool activeplaylist_replace_item (t_size p_item, const metadb_handle_ptr &p_new_item)
 
t_size activeplaylist_set_focus_by_handle (metadb_handle_ptr p_item)
 
void activeplaylist_set_focus_item (t_size p_item)
 
void activeplaylist_set_selection (const bit_array &affected, const bit_array &status)
 
void activeplaylist_set_selection_single (t_size p_item, bool p_state)
 
bool activeplaylist_sort_by_format (const char *spec, bool p_sel_only)
 
void activeplaylist_undo_backup ()
 
bool activeplaylist_undo_restore ()
 
virtual t_size create_playlist (const char *p_name, t_size p_name_length, t_size p_index)=0
 
t_size create_playlist_autoname (t_size p_index=~0)
 
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (playlist_manager)
 
t_size find_or_create_playlist (const char *p_name, t_size p_name_length=~0)
 
t_size find_or_create_playlist_unlocked (const char *p_name, t_size p_name_length=~0)
 
t_size find_playlist (const char *p_name, t_size p_name_length=~0)
 
virtual t_size get_active_playlist ()=0
 
bool get_all_items (pfc::list_base_t< metadb_handle_ptr > &out)
 
virtual bool get_playing_item_location (t_size *p_playlist, t_size *p_index)=0
 
virtual t_size get_playing_playlist ()=0
 
virtual t_size get_playlist_count ()=0
 
bool highlight_playing_item ()
 
virtual void modify_callback (class playlist_callback *p_callback, unsigned p_flags)=0
 
virtual void modify_callback (class playlist_callback_single *p_callback, unsigned p_flags)=0
 
virtual void on_files_deleted_sorted (const pfc::list_base_const_t< const char * > &p_items)=0
 
virtual void on_files_moved_sorted (const pfc::list_base_const_t< const char * > &p_from, const pfc::list_base_const_t< const char * > &p_to)=0
 
virtual t_size playback_order_get_active ()=0
 
virtual t_size playback_order_get_count ()=0
 
virtual GUID playback_order_get_guid (t_size p_index)=0
 
virtual const char * playback_order_get_name (t_size p_index)=0
 
virtual void playback_order_set_active (t_size p_index)=0
 
void playlist_activate_delta (int p_delta)
 
void playlist_activate_next ()
 
void playlist_activate_previous ()
 
bool playlist_add_items (t_size playlist, const pfc::list_base_const_t< metadb_handle_ptr > &data, const bit_array &p_selection)
 
bool playlist_add_items_filter (t_size p_playlist, const pfc::list_base_const_t< metadb_handle_ptr > &p_data, bool p_select)
 
bool playlist_add_locations (t_size p_playlist, const pfc::list_base_const_t< const char * > &p_urls, bool p_select, HWND p_parentwnd)
 
void playlist_clear (t_size p_playlist)
 
void playlist_clear_selection (t_size p_playlist)
 
virtual void playlist_ensure_visible (t_size p_playlist, t_size p_item)=0
 
virtual void playlist_enum_items (t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
 
virtual bool playlist_execute_default_action (t_size p_playlist, t_size p_item)=0
 
bool playlist_find_item (t_size p_playlist, metadb_handle_ptr p_item, t_size &p_result)
 
bool playlist_find_item_selected (t_size p_playlist, metadb_handle_ptr p_item, t_size &p_result)
 
void playlist_get_all_items (t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out)
 
virtual t_size playlist_get_focus_item (t_size p_playlist)=0
 
bool playlist_get_focus_item_handle (metadb_handle_ptr &p_item, t_size p_playlist)
 
virtual t_size playlist_get_item_count (t_size p_playlist)=0
 
bool playlist_get_item_handle (metadb_handle_ptr &p_out, t_size p_playlist, t_size p_item)
 
metadb_handle_ptr playlist_get_item_handle (t_size playlist, t_size item)
 
void playlist_get_items (t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out, const bit_array &p_mask)
 
virtual bool playlist_get_name (t_size p_playlist, pfc::string_base &p_out)=0
 
t_size playlist_get_selected_count (t_size p_playlist, bit_array const &p_mask)
 
void playlist_get_selected_items (t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out)
 
t_size playlist_get_selection_count (t_size p_playlist, t_size p_max)
 
void playlist_get_selection_mask (t_size p_playlist, bit_array_var &out)
 
virtual t_size playlist_insert_items (t_size p_playlist, t_size p_base, const pfc::list_base_const_t< metadb_handle_ptr > &data, const bit_array &p_selection)=0
 
bool playlist_insert_items_filter (t_size p_playlist, t_size p_base, const pfc::list_base_const_t< metadb_handle_ptr > &p_data, bool p_select)
 
bool playlist_insert_locations (t_size p_playlist, t_size p_base, const pfc::list_base_const_t< const char * > &p_urls, bool p_select, HWND p_parentwnd)
 
bool playlist_is_item_selected (t_size p_playlist, t_size p_item)
 
virtual bool playlist_is_redo_available (t_size p_playlist)=0
 
virtual bool playlist_is_undo_available (t_size p_playlist)=0
 
virtual void playlist_item_format_title (t_size p_playlist, t_size p_item, titleformat_hook *p_hook, pfc::string_base &p_out, const service_ptr_t< titleformat_object > &p_script, titleformat_text_filter *p_filter, playback_control::t_display_level p_playback_info_level)=0
 
virtual t_uint32 playlist_lock_get_filter_mask (t_size p_playlist)=0
 
virtual bool playlist_lock_install (t_size p_playlist, const service_ptr_t< playlist_lock > &p_lock)=0
 
virtual bool playlist_lock_is_present (t_size p_playlist)=0
 
virtual bool playlist_lock_query_name (t_size p_playlist, pfc::string_base &p_out)=0
 
virtual bool playlist_lock_show_ui (t_size p_playlist)=0
 
virtual bool playlist_lock_uninstall (t_size p_playlist, const service_ptr_t< playlist_lock > &p_lock)=0
 
bool playlist_move_selection (t_size p_playlist, int p_delta)
 
virtual bool playlist_redo_restore (t_size p_playlist)=0
 
virtual bool playlist_remove_items (t_size p_playlist, const bit_array &mask)=0
 
void playlist_remove_selection (t_size p_playlist, bool p_crop=false)
 
virtual bool playlist_rename (t_size p_index, const char *p_name, t_size p_name_length)=0
 
virtual bool playlist_reorder_items (t_size p_playlist, const t_size *p_order, t_size p_count)=0
 
virtual bool playlist_replace_item (t_size p_playlist, t_size p_item, const metadb_handle_ptr &p_new_item)=0
 
t_size playlist_set_focus_by_handle (t_size p_playlist, metadb_handle_ptr p_item)
 
virtual void playlist_set_focus_item (t_size p_playlist, t_size p_item)=0
 
virtual void playlist_set_selection (t_size p_playlist, const bit_array &p_affected, const bit_array &p_status)=0
 
void playlist_set_selection_single (t_size p_playlist, t_size p_item, bool p_state)
 
virtual bool playlist_sort_by_format (t_size p_playlist, const char *p_pattern, bool p_sel_only)=0
 
virtual void playlist_undo_backup (t_size p_playlist)=0
 
virtual bool playlist_undo_restore (t_size p_playlist)=0
 
bool playlist_update_content (t_size playlist, metadb_handle_list_cref content, bool bUndoBackup)
 
virtual void queue_add_item (metadb_handle_ptr p_item)=0
 
virtual void queue_add_item_playlist (t_size p_playlist, t_size p_item)=0
 
virtual t_size queue_find_index (t_playback_queue_item const &p_item)=0
 
void queue_flush ()
 
virtual void queue_get_contents (pfc::list_base_t< t_playback_queue_item > &p_out)=0
 
virtual t_size queue_get_count ()=0
 
bool queue_is_active ()
 
virtual void queue_remove_mask (bit_array const &p_mask)=0
 
virtual void register_callback (class playlist_callback *p_callback, unsigned p_flags)=0
 
virtual void register_callback (class playlist_callback_single *p_callback, unsigned p_flags)=0
 
void remove_items_from_all_playlists (const pfc::list_base_const_t< metadb_handle_ptr > &p_data)
 
bool remove_playlist (t_size p_playlist)
 
bool remove_playlist_switch (t_size p_playlist)
 
virtual bool remove_playlists (const bit_array &p_mask)=0
 
virtual bool reorder (const t_size *p_order, t_size p_count)=0
 
void reset_playing_playlist ()
 
virtual void set_active_playlist (t_size p_index)=0
 
virtual void set_playing_playlist (t_size p_index)=0
 
virtual void unregister_callback (class playlist_callback *p_callback)=0
 
virtual void unregister_callback (class playlist_callback_single *p_callback)=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

- Public Types inherited from service_base
typedef service_base t_interface
 
- Static Public Member Functions inherited from playlist_manager
static void g_make_selection_move_permutation (t_size *p_output, t_size p_count, const bit_array &p_selection, int p_delta)
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Extension of the playlist_manager service that manages playlist properties. Playlist properties come in two flavors: persistent and runtime. Persistent properties are blocks of binary that that will be preserved when the application is exited and restarted. Runtime properties are service pointers that will be lost when the application exits.

Since
0.9.5

Definition at line 381 of file playlist.h.

Member Function Documentation

virtual bool playlist_manager_v2::playlist_get_property ( t_size  p_playlist,
const GUID p_property,
stream_writer p_stream,
abort_callback p_abort 
)
pure virtual

Read a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_streamstream that will receive the stored data
p_abortabort_callback that will be used when writing to p_stream
Returns
true if the property exists, false otherwise
template<typename t_array >
bool playlist_manager_v2::playlist_get_property ( t_size  p_playlist,
const GUID p_property,
t_array &  p_data 
)
inline

Read a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_dataarray that will receive the stored data
Returns
true if the property exists, false otherwise

Definition at line 442 of file playlist.h.

442  {
443  PFC_STATIC_ASSERT( sizeof(p_data[0]) == 1 );
445  t_temp temp;
446  if (!playlist_get_property(p_playlist,p_property,&stream_writer_buffer_append_ref_t<t_temp>(temp),abort_callback_dummy())) return false;
447  p_data = temp;
448  return true;
449  }
virtual bool playlist_get_property(t_size p_playlist, const GUID &p_property, stream_writer *p_stream, abort_callback &p_abort)=0
Read a persistent playlist property.
abort_callback_impl abort_callback_dummy
template<typename _t_int >
bool playlist_manager_v2::playlist_get_property_int ( t_size  p_playlist,
const GUID p_property,
_t_int &  p_value 
)
inline

Read a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_valueinteger reference that will receive the stored data
Returns
true if the property exists and if the data is compatible with p_value, false otherwise

Definition at line 477 of file playlist.h.

477  {
479  if (!playlist_get_property(p_playlist,p_property,temp)) return false;
480  if (temp.get_size() != sizeof(_t_int)) return false;
481  pfc::decode_little_endian(p_value,temp.get_ptr());
482  return true;
483  }
virtual bool playlist_get_property(t_size p_playlist, const GUID &p_property, stream_writer *p_stream, abort_callback &p_abort)=0
Read a persistent playlist property.
const t_item * get_ptr() const
Definition: array.h:213
void decode_little_endian(TInt &p_out, const t_uint8 *p_buffer)
t_size get_size() const
Definition: array.h:130
virtual bool playlist_manager_v2::playlist_get_runtime_property ( t_size  p_playlist,
const GUID p_property,
service_ptr_t< service_base > &  p_data 
)
pure virtual

Read a runtime playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_database service pointer reference that will receive the stored servive pointer
Returns
true if the property exists, false otherwise
template<typename _t_interface >
bool playlist_manager_v2::playlist_get_runtime_property ( t_size  p_playlist,
const GUID p_property,
service_ptr_t< _t_interface > &  p_data 
)
inline

Read a runtime playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_dataspecific service pointer reference that will receive the stored servive pointer
Returns
true if the property exists and can be converted to the type of p_data, false otherwise

Definition at line 455 of file playlist.h.

455  {
457  if (!playlist_get_runtime_property(p_playlist,p_property,ptr)) return false;
458  return ptr->service_query_t(p_data);
459  }
virtual bool playlist_get_runtime_property(t_size p_playlist, const GUID &p_property, service_ptr_t< service_base > &p_data)=0
Read a runtime playlist property.
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
virtual bool playlist_manager_v2::playlist_have_property ( t_size  p_playlist,
const GUID p_property 
)
pure virtual

Test existence of a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
Returns
true if the property exists, false otherwise
virtual bool playlist_manager_v2::playlist_have_runtime_property ( t_size  p_playlist,
const GUID p_property 
)
pure virtual

Test existence of a runtime playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
Returns
true if the property exists, false otherwise
virtual bool playlist_manager_v2::playlist_remove_property ( t_size  p_playlist,
const GUID p_property 
)
pure virtual

Remove a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
Returns
true if the property existed, false otherwise
virtual bool playlist_manager_v2::playlist_remove_runtime_property ( t_size  p_playlist,
const GUID p_property 
)
pure virtual

Remove a runtime playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
Returns
true if the property existed, false otherwise
virtual void playlist_manager_v2::playlist_set_property ( t_size  p_playlist,
const GUID p_property,
stream_reader p_stream,
t_size  p_size_hint,
abort_callback p_abort 
)
pure virtual

Write a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_streamstream that contains the data that will be associated with the property
p_abortabort_callback that will be used when reading from p_stream
template<typename t_array >
void playlist_manager_v2::playlist_set_property ( t_size  p_playlist,
const GUID p_property,
const t_array &  p_data 
)
inline

Write a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_dataarray that contains the data that will be associated with the property

Definition at line 433 of file playlist.h.

433  {
434  PFC_STATIC_ASSERT( sizeof(p_data[0]) == 1 );
435  playlist_set_property(p_playlist,p_property,&stream_reader_memblock_ref(p_data),p_data.get_size(),abort_callback_dummy());
436  }
abort_callback_impl abort_callback_dummy
virtual void playlist_set_property(t_size p_playlist, const GUID &p_property, stream_reader *p_stream, t_size p_size_hint, abort_callback &p_abort)=0
Write a persistent playlist property.
template<typename _t_int >
void playlist_manager_v2::playlist_set_property_int ( t_size  p_playlist,
const GUID p_property,
_t_int  p_value 
)
inline

Write a persistent playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_valueinteger that will be associated with the property

Definition at line 466 of file playlist.h.

466  {
467  pfc::array_t<t_uint8> temp; temp.set_size(sizeof(_t_int));
468  pfc::encode_little_endian(temp.get_ptr(),p_value);
469  playlist_set_property(p_playlist,p_property,temp);
470  }
const t_item * get_ptr() const
Definition: array.h:213
void encode_little_endian(t_uint8 *p_buffer, TInt p_value)
void set_size(t_size p_size)
Definition: array.h:104
virtual void playlist_set_property(t_size p_playlist, const GUID &p_property, stream_reader *p_stream, t_size p_size_hint, abort_callback &p_abort)=0
Write a persistent playlist property.
virtual void playlist_manager_v2::playlist_set_runtime_property ( t_size  p_playlist,
const GUID p_property,
service_ptr_t< service_base p_data 
)
pure virtual

Write a runtime playlist property.

Parameters
p_playlistIndex of the playlist
p_propertyGUID that identifies the property
p_dataservice pointer that will be associated with the property

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