foobar2000 SDK  2015-08-03
Data Structures | Public Member Functions | Static Public Member Functions
playlist_managerabstract

#include <playlist.h>

+ Inheritance diagram for playlist_manager:

Data Structures

class  enum_items_callback
 

Public Member Functions

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 ()
 

Static Public Member Functions

static void g_make_selection_move_permutation (t_size *p_output, t_size p_count, const bit_array &p_selection, int p_delta)
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

This service provides methods for all sorts of playlist interaction.
All playlist_manager methods are valid only from main app thread.
Usage: static_api_ptr_t<playlist_manager>.

Definition at line 74 of file playlist.h.

Member Function Documentation

void playlist_manager::active_playlist_fix ( )

Definition at line 564 of file playlist.cpp.

565 {
566  t_size playlist = get_active_playlist();
567  if (playlist == pfc_infinite)
568  {
569  t_size max = get_playlist_count();
570  if (max == 0)
571  {
573  }
575  }
576 }
virtual void set_active_playlist(t_size p_index)=0
Sets active playlist (infinite to set no active playlist).
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
t_size create_playlist_autoname(t_size p_index=~0)
Definition: playlist.cpp:524
size_t t_size
Definition: int_types.h:48
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
bool playlist_manager::activeplaylist_add_items ( const pfc::list_base_const_t< metadb_handle_ptr > &  data,
const bit_array p_selection 
)

Definition at line 343 of file playlist.cpp.

344 {
345  t_size playlist = get_active_playlist();
346  if (playlist != pfc_infinite) return playlist_add_items(playlist,data,p_selection);
347  else return false;
348 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_add_items(t_size playlist, const pfc::list_base_const_t< metadb_handle_ptr > &data, const bit_array &p_selection)
Definition: playlist.cpp:338
bool playlist_manager::activeplaylist_add_items_filter ( const pfc::list_base_const_t< metadb_handle_ptr > &  p_data,
bool  p_select 
)

Definition at line 386 of file playlist.cpp.

387 {
388  return activeplaylist_insert_items_filter(pfc_infinite,p_data,p_select);
389 }
bool activeplaylist_insert_items_filter(t_size p_base, const pfc::list_base_const_t< metadb_handle_ptr > &p_data, bool p_select)
Definition: playlist.cpp:359
bool playlist_manager::activeplaylist_add_locations ( const pfc::list_base_const_t< const char * > &  p_urls,
bool  p_select,
HWND  p_parentwnd 
)

Definition at line 395 of file playlist.cpp.

396 {
397  return activeplaylist_insert_locations(pfc_infinite,p_urls,p_select,p_parentwnd);
398 }
bool activeplaylist_insert_locations(t_size p_base, const pfc::list_base_const_t< const char * > &p_urls, bool p_select, HWND p_parentwnd)
Definition: playlist.cpp:374
void playlist_manager::activeplaylist_clear ( )

Definition at line 281 of file playlist.cpp.

282 {
283  t_size playlist = get_active_playlist();
284  if (playlist != pfc_infinite) playlist_clear(playlist);
285 }
void playlist_clear(t_size p_playlist)
Clears contents of specified playlist (removes all items from it).
Definition: playlist.cpp:276
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_manager::activeplaylist_clear_selection ( )

Definition at line 410 of file playlist.cpp.

411 {
412  t_size playlist = get_active_playlist();
413  if (playlist != pfc_infinite) playlist_clear_selection(playlist);
414 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_clear_selection(t_size p_playlist)
Definition: playlist.cpp:405
void playlist_manager::activeplaylist_ensure_visible ( t_size  p_item)

Definition at line 209 of file playlist.cpp.

210 {
211  t_size playlist = get_active_playlist();
212  if (playlist != pfc_infinite) playlist_ensure_visible(playlist,p_item);
213 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
virtual void playlist_ensure_visible(t_size p_playlist, t_size p_item)=0
Tells playlist renderers to make sure that specified item is visible.
size_t t_size
Definition: int_types.h:48
void playlist_manager::activeplaylist_enum_items ( enum_items_callback p_callback,
const bit_array p_mask 
)

Definition at line 148 of file playlist.cpp.

149 {
150  t_size playlist = get_active_playlist();
151  if (playlist != pfc_infinite) playlist_enum_items(playlist,p_callback,p_mask);
152 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
bool playlist_manager::activeplaylist_execute_default_action ( t_size  p_item)

Definition at line 685 of file playlist.cpp.

685  {
686  t_size idx = get_active_playlist();
687  if (idx == pfc_infinite) return false;
688  else return playlist_execute_default_action(idx,p_item);
689 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
virtual bool playlist_execute_default_action(t_size p_playlist, t_size p_item)=0
Executes default doubleclick/enter action for specified item on specified playlist (starts playing th...
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_find_item ( metadb_handle_ptr  p_item,
t_size p_result 
)

Definition at line 843 of file playlist.cpp.

843  {
844  t_size playlist = get_active_playlist();
845  if (playlist == pfc_infinite) return false;
846  return playlist_find_item(playlist,p_item,p_result);
847 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_find_item(t_size p_playlist, metadb_handle_ptr p_item, t_size &p_result)
Definition: playlist.cpp:821
void playlist_manager::activeplaylist_get_all_items ( pfc::list_base_t< metadb_handle_ptr > &  out)

Definition at line 254 of file playlist.cpp.

255 {
256  t_size playlist = get_active_playlist();
257  if (playlist != pfc_infinite) playlist_get_all_items(playlist,out);
258 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_get_all_items(t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out)
Definition: playlist.cpp:86
t_size playlist_manager::activeplaylist_get_focus_item ( )

Definition at line 154 of file playlist.cpp.

155 {
156  t_size playlist = get_active_playlist();
157  if (playlist == pfc_infinite) return pfc_infinite;
158  else return playlist_get_focus_item(playlist);
159 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual t_size playlist_get_focus_item(t_size p_playlist)=0
Retrieves index of focus item on specified playlist; returns infinite when no item has focus...
bool playlist_manager::activeplaylist_get_focus_item_handle ( metadb_handle_ptr item)

Definition at line 489 of file playlist.cpp.

490 {
491  t_size playlist = get_active_playlist();
492  if (playlist != pfc_infinite) return playlist_get_focus_item_handle(p_out,playlist);
493  else return false;
494 }
bool playlist_get_focus_item_handle(metadb_handle_ptr &p_item, t_size p_playlist)
Definition: playlist.cpp:482
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
t_size playlist_manager::activeplaylist_get_item_count ( )

Definition at line 141 of file playlist.cpp.

142 {
143  t_size playlist = get_active_playlist();
144  if (playlist == pfc_infinite) return 0;
145  else return playlist_get_item_count(playlist);
146 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual t_size playlist_get_item_count(t_size p_playlist)=0
Retrieves number of items on specified playlist.
bool playlist_manager::activeplaylist_get_item_handle ( metadb_handle_ptr item,
t_size  p_item 
)

Definition at line 235 of file playlist.cpp.

236 {
237  t_size playlist = get_active_playlist();
238  if (playlist != pfc_infinite) return playlist_get_item_handle(p_out,playlist,p_item);
239  else return false;
240 }
bool playlist_get_item_handle(metadb_handle_ptr &p_out, t_size p_playlist, t_size p_item)
Helper; retrieves metadb_handle of the specified playlist item. Returns true on success, false on failure (invalid parameters).
Definition: playlist.cpp:115
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
metadb_handle_ptr playlist_manager::activeplaylist_get_item_handle ( t_size  p_item)

Definition at line 229 of file playlist.cpp.

229  {
230  metadb_handle_ptr temp;
231  if (!activeplaylist_get_item_handle(temp, p_item)) throw pfc::exception_invalid_params();
232  PFC_ASSERT( temp.is_valid() );
233  return temp;
234 }
bool activeplaylist_get_item_handle(metadb_handle_ptr &item, t_size p_item)
Definition: playlist.cpp:235
bool is_valid() const
Definition: service.h:119
void playlist_manager::activeplaylist_get_items ( pfc::list_base_t< metadb_handle_ptr > &  out,
const bit_array p_mask 
)

Definition at line 557 of file playlist.cpp.

558 {
559  t_size playlist = get_active_playlist();
560  if (playlist != pfc_infinite) playlist_get_items(playlist,out,p_mask);
561  else out.remove_all();
562 }
void playlist_get_items(t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out, const bit_array &p_mask)
Definition: playlist.cpp:552
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void remove_all()
Definition: list.h:213
bool playlist_manager::activeplaylist_get_name ( pfc::string_base p_out)

Definition at line 161 of file playlist.cpp.

162 {
163  t_size playlist = get_active_playlist();
164  if (playlist == pfc_infinite) return false;
165  else return playlist_get_name(playlist,p_out);
166 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_get_name(t_size p_playlist, pfc::string_base &p_out)=0
Retrieves name of specified playlist. Should never fail unless the parameters are invalid...
t_size playlist_manager::activeplaylist_get_selected_count ( bit_array const &  p_mask)
inline

Definition at line 363 of file playlist.h.

t_size playlist_get_selected_count(t_size p_playlist, bit_array const &p_mask)
Definition: playlist.cpp:780
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
void playlist_manager::activeplaylist_get_selected_items ( pfc::list_base_t< metadb_handle_ptr > &  out)

Definition at line 260 of file playlist.cpp.

261 {
262  t_size playlist = get_active_playlist();
263  if (playlist != pfc_infinite) playlist_get_selected_items(playlist,out);
264 }
void playlist_get_selected_items(t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out)
Definition: playlist.cpp:91
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
t_size playlist_manager::activeplaylist_get_selection_count ( t_size  p_max)

Definition at line 475 of file playlist.cpp.

476 {
477  t_size playlist = get_active_playlist();
478  if (playlist != pfc_infinite) return playlist_get_selection_count(playlist,p_max);
479  else return 0;
480 }
t_size playlist_get_selection_count(t_size p_playlist, t_size p_max)
Definition: playlist.cpp:468
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_manager::activeplaylist_get_selection_mask ( bit_array_var out)

Definition at line 248 of file playlist.cpp.

249 {
250  t_size playlist = get_active_playlist();
251  if (playlist != pfc_infinite) playlist_get_selection_mask(playlist,out);
252 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
void playlist_get_selection_mask(t_size p_playlist, bit_array_var &out)
Retrieves selection map of specific playlist, using bit_array_var interface.
Definition: playlist.cpp:96
size_t t_size
Definition: int_types.h:48
t_size playlist_manager::activeplaylist_insert_items ( t_size  p_base,
const pfc::list_base_const_t< metadb_handle_ptr > &  data,
const bit_array p_selection 
)

Definition at line 202 of file playlist.cpp.

203 {
204  t_size playlist = get_active_playlist();
205  if (playlist != pfc_infinite) return playlist_insert_items(playlist,p_base,data,p_selection);
206  else return pfc_infinite;
207 }
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
Inserts new items into specified playlist, at specified position.
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_insert_items_filter ( t_size  p_base,
const pfc::list_base_const_t< metadb_handle_ptr > &  p_data,
bool  p_select 
)

Definition at line 359 of file playlist.cpp.

360 {
361  t_size playlist = get_active_playlist();
362  if (playlist != pfc_infinite) return playlist_insert_items_filter(playlist,p_base,p_data,p_select);
363  else return false;
364 }
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)
Definition: playlist.cpp:350
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_insert_locations ( t_size  p_base,
const pfc::list_base_const_t< const char * > &  p_urls,
bool  p_select,
HWND  p_parentwnd 
)
Deprecated:
(since 0.9.3) Use playlist_incoming_item_filter_v2::process_locations_async whenever possible

Definition at line 374 of file playlist.cpp.

375 {
376  t_size playlist = get_active_playlist();
377  if (playlist != pfc_infinite) return playlist_insert_locations(playlist,p_base,p_urls,p_select,p_parentwnd);
378  else return false;
379 }
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)
Definition: playlist.cpp:366
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_is_item_selected ( t_size  p_item)

Definition at line 222 of file playlist.cpp.

223 {
224  t_size playlist = get_active_playlist();
225  if (playlist != pfc_infinite) return playlist_is_item_selected(playlist,p_item);
226  else return false;
227 }
bool playlist_is_item_selected(t_size p_playlist, t_size p_item)
Helper; returns whether specified item on specified playlist is selected or not.
Definition: playlist.cpp:101
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_is_redo_available ( )

Definition at line 645 of file playlist.cpp.

646 {
647  t_size playlist = get_active_playlist();
648  if (playlist == pfc_infinite) return false;
649  else return playlist_is_redo_available(playlist);
650 }
virtual bool playlist_is_redo_available(t_size p_playlist)=0
Returns whether a redo restore point is available for specified playlist.
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_is_undo_available ( )

Definition at line 638 of file playlist.cpp.

639 {
640  t_size playlist = get_active_playlist();
641  if (playlist == pfc_infinite) return false;
642  else return playlist_is_undo_available(playlist);
643 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
virtual bool playlist_is_undo_available(t_size p_playlist)=0
Returns whether an undo restore point is available for specified playlist.
size_t t_size
Definition: int_types.h:48
void playlist_manager::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 
)

Definition at line 450 of file playlist.cpp.

451 {
452  t_size playlist = get_active_playlist();
453  if (playlist == pfc_infinite) out = "NJET";
454  else playlist_item_format_title(playlist,p_item,p_hook,out,p_script,p_filter,p_playback_info_level);
455 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
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
Renders information about specified playlist item, using specified titleformatting script parameters...
t_uint32 playlist_manager::activeplaylist_lock_get_filter_mask ( )

Definition at line 631 of file playlist.cpp.

632 {
633  t_size playlist = get_active_playlist();
634  if (playlist == pfc_infinite) return ~0;
635  else return playlist_lock_get_filter_mask(playlist);
636 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual t_uint32 playlist_lock_get_filter_mask(t_size p_playlist)=0
void playlist_manager::activeplaylist_move_selection ( int  p_delta)

Definition at line 242 of file playlist.cpp.

243 {
244  t_size playlist = get_active_playlist();
245  if (playlist != pfc_infinite) playlist_move_selection(playlist,p_delta);
246 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_move_selection(t_size p_playlist, int p_delta)
Moves selected items up/down in the playlist by specified offset.
Definition: playlist.cpp:127
bool playlist_manager::activeplaylist_redo_restore ( )

Definition at line 429 of file playlist.cpp.

430 {
431  t_size playlist = get_active_playlist();
432  if (playlist != pfc_infinite) return playlist_redo_restore(playlist);
433  else return false;
434 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_redo_restore(t_size p_playlist)=0
Reverts specified playlist to next redo restore point and generates an undo restore point...
bool playlist_manager::activeplaylist_remove_items ( const bit_array mask)

Definition at line 182 of file playlist.cpp.

183 {
184  t_size playlist = get_active_playlist();
185  if (playlist != pfc_infinite) return playlist_remove_items(playlist,mask);
186  else return false;
187 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_remove_items(t_size p_playlist, const bit_array &mask)=0
Removes specified items from specified playlist. Returns true on success or false on failure (playlis...
void playlist_manager::activeplaylist_remove_selection ( bool  p_crop = false)

Definition at line 444 of file playlist.cpp.

445 {
446  t_size playlist = get_active_playlist();
447  if (playlist != pfc_infinite) playlist_remove_selection(playlist,p_crop);
448 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_remove_selection(t_size p_playlist, bool p_crop=false)
Definition: playlist.cpp:436
bool playlist_manager::activeplaylist_rename ( const char *  p_name,
t_size  p_name_len 
)

Definition at line 215 of file playlist.cpp.

216 {
217  t_size playlist = get_active_playlist();
218  if (playlist != pfc_infinite) return playlist_rename(playlist,p_name,p_name_len);
219  else return false;
220 }
virtual bool playlist_rename(t_size p_index, const char *p_name, t_size p_name_length)=0
Renames specified playlist.
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_reorder_items ( const t_size order,
t_size  count 
)

Definition at line 169 of file playlist.cpp.

170 {
171  t_size playlist = get_active_playlist();
172  if (playlist != pfc_infinite) return playlist_reorder_items(playlist,order,count);
173  else return false;
174 }
virtual bool playlist_reorder_items(t_size p_playlist, const t_size *p_order, t_size p_count)=0
Reorders items in specified playlist according to specified permutation.
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool playlist_manager::activeplaylist_replace_item ( t_size  p_item,
const metadb_handle_ptr p_new_item 
)

Definition at line 189 of file playlist.cpp.

190 {
191  t_size playlist = get_active_playlist();
192  if (playlist != pfc_infinite) return playlist_replace_item(playlist,p_item,p_new_item);
193  else return false;
194 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_replace_item(t_size p_playlist, t_size p_item, const metadb_handle_ptr &p_new_item)=0
Replaces specified item on specified playlist. Returns true on success or false on failure (playlist ...
t_size playlist_manager::activeplaylist_set_focus_by_handle ( metadb_handle_ptr  p_item)

Definition at line 848 of file playlist.cpp.

848  {
849  t_size playlist = get_active_playlist();
850  if (playlist == pfc_infinite) return pfc_infinite;
851  return playlist_set_focus_by_handle(playlist,p_item);
852 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
t_size playlist_set_focus_by_handle(t_size p_playlist, metadb_handle_ptr p_item)
Definition: playlist.cpp:837
size_t t_size
Definition: int_types.h:48
void playlist_manager::activeplaylist_set_focus_item ( t_size  p_item)

Definition at line 196 of file playlist.cpp.

197 {
198  t_size playlist = get_active_playlist();
199  if (playlist != pfc_infinite) playlist_set_focus_item(playlist,p_item);
200 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual void playlist_set_focus_item(t_size p_playlist, t_size p_item)=0
Sets index of focus item on specified playlist; use infinite to set no focus item.
void playlist_manager::activeplaylist_set_selection ( const bit_array affected,
const bit_array status 
)

Definition at line 176 of file playlist.cpp.

177 {
178  t_size playlist = get_active_playlist();
179  if (playlist != pfc_infinite) playlist_set_selection(playlist,affected,status);
180 }
virtual void playlist_set_selection(t_size p_playlist, const bit_array &p_affected, const bit_array &p_status)=0
Selects/deselects items on specified playlist.
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_manager::activeplaylist_set_selection_single ( t_size  p_item,
bool  p_state 
)

Definition at line 462 of file playlist.cpp.

463 {
464  t_size playlist = get_active_playlist();
465  if (playlist != pfc_infinite) playlist_set_selection_single(playlist,p_item,p_state);
466 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
void playlist_set_selection_single(t_size p_playlist, t_size p_item, bool p_state)
Definition: playlist.cpp:457
bool playlist_manager::activeplaylist_sort_by_format ( const char *  spec,
bool  p_sel_only 
)

Definition at line 534 of file playlist.cpp.

535 {
536  t_size playlist = get_active_playlist();
537  if (playlist != pfc_infinite) return playlist_sort_by_format(playlist,spec,p_sel_only);
538  else return false;
539 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_sort_by_format(t_size p_playlist, const char *p_pattern, bool p_sel_only)=0
Sorts specified playlist - entire playlist or selection only - by specified title formatting pattern...
void playlist_manager::activeplaylist_undo_backup ( )

Definition at line 416 of file playlist.cpp.

417 {
418  t_size playlist = get_active_playlist();
419  if (playlist != pfc_infinite) playlist_undo_backup(playlist);
420 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual void playlist_undo_backup(t_size p_playlist)=0
Creates an undo restore point for specified playlist.
bool playlist_manager::activeplaylist_undo_restore ( )

Definition at line 422 of file playlist.cpp.

423 {
424  t_size playlist = get_active_playlist();
425  if (playlist != pfc_infinite) return playlist_undo_restore(playlist);
426  else return false;
427 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_undo_restore(t_size p_playlist)=0
Reverts specified playlist to last undo restore point and generates a redo restore point...
virtual t_size playlist_manager::create_playlist ( const char *  p_name,
t_size  p_name_length,
t_size  p_index 
)
pure virtual

Creates a new playlist.

Parameters
p_nameName of playlist to create; a UTF-8 encoded string.
p_name_lengthLength limit of playlist 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.
p_indexIndex at which to insert new playlist; set to infinite to put it at the end of playlist list.
Returns
Actual index of newly inserted playlist, infinite on failure (call from invalid context).
t_size playlist_manager::create_playlist_autoname ( t_size  p_index = ~0)

Definition at line 524 of file playlist.cpp.

524  {
525  static const char new_playlist_text[] = "New Playlist";
526  if (find_playlist(new_playlist_text,pfc_infinite) == pfc_infinite) return create_playlist(new_playlist_text,pfc_infinite,p_index);
527  for(t_size walk = 2; ; walk++) {
528  pfc::string_fixed_t<64> namebuffer;
529  namebuffer << new_playlist_text << " (" << walk << ")";
530  if (find_playlist(namebuffer,pfc_infinite) == pfc_infinite) return create_playlist(namebuffer,pfc_infinite,p_index);
531  }
532 }
virtual t_size create_playlist(const char *p_name, t_size p_name_length, t_size p_index)=0
Creates a new playlist.
t_size find_playlist(const char *p_name, t_size p_name_length=~0)
Definition: playlist.cpp:496
size_t t_size
Definition: int_types.h:48
playlist_manager::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( playlist_manager  )
t_size playlist_manager::find_or_create_playlist ( const char *  p_name,
t_size  p_name_length = ~0 
)

Definition at line 517 of file playlist.cpp.

518 {
519  t_size index = find_playlist(p_name,p_name_length);
520  if (index != pfc_infinite) return index;
521  return create_playlist(p_name,p_name_length,pfc_infinite);
522 }
virtual t_size create_playlist(const char *p_name, t_size p_name_length, t_size p_index)=0
Creates a new playlist.
t_size find_playlist(const char *p_name, t_size p_name_length=~0)
Definition: playlist.cpp:496
size_t t_size
Definition: int_types.h:48
t_size playlist_manager::find_or_create_playlist_unlocked ( const char *  p_name,
t_size  p_name_length = ~0 
)

Definition at line 507 of file playlist.cpp.

507  {
508  t_size n, m = get_playlist_count();
510  for(n=0;n<m;n++) {
511  if (!playlist_lock_is_present(n) && playlist_get_name(n,temp)) {
512  if (stricmp_utf8_ex(temp,~0,p_name,p_name_length) == 0) return n;
513  }
514  }
515  return create_playlist(p_name,p_name_length,pfc_infinite);
516 }
virtual bool playlist_lock_is_present(t_size p_playlist)=0
int SHARED_EXPORT stricmp_utf8_ex(const char *p1, t_size len1, const char *p2, t_size len2)
virtual t_size create_playlist(const char *p_name, t_size p_name_length, t_size p_index)=0
Creates a new playlist.
size_t t_size
Definition: int_types.h:48
virtual bool playlist_get_name(t_size p_playlist, pfc::string_base &p_out)=0
Retrieves name of specified playlist. Should never fail unless the parameters are invalid...
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
t_size playlist_manager::find_playlist ( const char *  p_name,
t_size  p_name_length = ~0 
)

Definition at line 496 of file playlist.cpp.

497 {
498  t_size n, m = get_playlist_count();
500  for(n=0;n<m;n++) {
501  if (!playlist_get_name(n,temp)) break;
502  if (stricmp_utf8_ex(temp,temp.length(),p_name,p_name_length) == 0) return n;
503  }
504  return pfc_infinite;
505 }
int SHARED_EXPORT stricmp_utf8_ex(const char *p1, t_size len1, const char *p2, t_size len2)
size_t t_size
Definition: int_types.h:48
virtual bool playlist_get_name(t_size p_playlist, pfc::string_base &p_out)=0
Retrieves name of specified playlist. Should never fail unless the parameters are invalid...
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
t_size length() const
For compatibility with old conventions.
Definition: string_base.h:209
void playlist_manager::g_make_selection_move_permutation ( t_size p_output,
t_size  p_count,
const bit_array p_selection,
int  p_delta 
)
static

Definition at line 123 of file playlist.cpp.

123  {
124  pfc::create_move_items_permutation(p_output,p_count,p_selection,p_delta);
125 }
void create_move_items_permutation(t_size *p_output, t_size p_count, const class bit_array &p_selection, int p_delta)
Creates a permutation that moves selected items in a list box by the specified delta-offset.
virtual t_size playlist_manager::get_active_playlist ( )
pure virtual

Retrieves index of active playlist; infinite if no playlist is active.

bool playlist_manager::get_all_items ( pfc::list_base_t< metadb_handle_ptr > &  out)

Definition at line 619 of file playlist.cpp.

620 {
621  t_size n, m = get_playlist_count();
622  if (m == pfc_infinite) return false;
623  enum_items_callback_retrieve_all_items callback(out);
624  for(n=0;n<m;n++)
625  {
626  playlist_enum_items(n,callback,bit_array_true());
627  }
628  return true;
629 }
size_t t_size
Definition: int_types.h:48
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
virtual bool playlist_manager::get_playing_item_location ( t_size p_playlist,
t_size p_index 
)
pure virtual

Retrieves playlist position of currently playing item.

Parameters
p_playlistReceives index of playlist containing currently playing item on success.
p_indexReceives index of currently playing item in the playlist that contains it on success.
Returns
True on success, false on failure (not playing or currently played item has been removed from the playlist it was on when starting).
virtual t_size playlist_manager::get_playing_playlist ( )
pure virtual

Retrieves playlist from which items to be played are taken from.

virtual t_size playlist_manager::get_playlist_count ( )
pure virtual

Retrieves number of playlists.

bool playlist_manager::highlight_playing_item ( )

Helper; highlights currently playing item; returns true on success or false on failure (not playing or currently played item has been removed from playlist since playback started).

Definition at line 541 of file playlist.cpp.

542 {
543  t_size playlist,item;
544  if (!get_playing_item_location(&playlist,&item)) return false;
545  set_active_playlist(playlist);
546  playlist_set_focus_item(playlist,item);
548  playlist_ensure_visible(playlist,item);
549  return true;
550 }
virtual void playlist_set_selection(t_size p_playlist, const bit_array &p_affected, const bit_array &p_status)=0
Selects/deselects items on specified playlist.
virtual void set_active_playlist(t_size p_index)=0
Sets active playlist (infinite to set no active playlist).
virtual void playlist_ensure_visible(t_size p_playlist, t_size p_item)=0
Tells playlist renderers to make sure that specified item is visible.
size_t t_size
Definition: int_types.h:48
virtual void playlist_set_focus_item(t_size p_playlist, t_size p_item)=0
Sets index of focus item on specified playlist; use infinite to set no focus item.
virtual bool get_playing_item_location(t_size *p_playlist, t_size *p_index)=0
Retrieves playlist position of currently playing item.
virtual void playlist_manager::modify_callback ( class playlist_callback p_callback,
unsigned  p_flags 
)
pure virtual

Modifies flags indicating which calback methods are requested (playlist_callback version).

virtual void playlist_manager::modify_callback ( class playlist_callback_single p_callback,
unsigned  p_flags 
)
pure virtual

Modifies flags indicating which calback methods are requested (playlist_callback_single version).

virtual void playlist_manager::on_files_deleted_sorted ( const pfc::list_base_const_t< const char * > &  p_items)
pure virtual

For internal use only; p_items must be sorted by metadb::path_compare; use file_operation_callback static methods instead of calling this directly.

virtual void playlist_manager::on_files_moved_sorted ( const pfc::list_base_const_t< const char * > &  p_from,
const pfc::list_base_const_t< const char * > &  p_to 
)
pure virtual

For internal use only; p_from must be sorted by metadb::path_compare; use file_operation_callback static methods instead of calling this directly.

virtual t_size playlist_manager::playback_order_get_active ( )
pure virtual

Retrieves index of active playback order mode.

virtual t_size playlist_manager::playback_order_get_count ( )
pure virtual

Retrieves number of available playback order modes.

virtual GUID playlist_manager::playback_order_get_guid ( t_size  p_index)
pure virtual

Retrieves GUID of specified playback order mode. Used for managing playback modes without relying on names.

Parameters
p_indexIndex of playback order mode to query, from 0 to playback_order_get_count() return value - 1.
virtual const char* playlist_manager::playback_order_get_name ( t_size  p_index)
pure virtual

Retrieves name of specified playback order move.

Parameters
p_indexIndex of playback order mode to query, from 0 to playback_order_get_count() return value - 1.
Returns
Null-terminated UTF-8 encoded string containing name of the playback order mode. Returned pointer points to statically allocated string and can be safely stored without having to free it later.
virtual void playlist_manager::playback_order_set_active ( t_size  p_index)
pure virtual

Sets index of active playback order mode.

void playlist_manager::playlist_activate_delta ( int  p_delta)

Definition at line 741 of file playlist.cpp.

741  {
742  const t_size total = get_playlist_count();
743  if (total > 0) {
744  t_size active = get_active_playlist();
745 
746  //clip p_delta to -(total-1)...(total-1) range
747  if (p_delta < 0) {
748  p_delta = - ( (-p_delta) % (t_ssize)total );
749  } else {
750  p_delta = p_delta % total;
751  }
752  if (p_delta != 0) {
753  if (active == pfc_infinite) {
754  //special case when no playlist is active
755  if (p_delta > 0) {
756  active = (t_size)(p_delta - 1);
757  } else {
758  active = (total + p_delta);//p_delta is negative
759  }
760  } else {
761  active = (t_size) (active + total + p_delta) % total;
762  }
763  set_active_playlist(active % total);
764  }
765  }
766 }
virtual void set_active_playlist(t_size p_index)=0
Sets active playlist (infinite to set no active playlist).
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
pfc::sized_int_t< sizeof(size_t) >::t_signed t_ssize
Definition: int_types.h:49
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
void playlist_manager::playlist_activate_next ( )
inline

Definition at line 358 of file playlist.h.

void playlist_activate_delta(int p_delta)
Definition: playlist.cpp:741
void playlist_manager::playlist_activate_previous ( )
inline

Definition at line 359 of file playlist.h.

void playlist_activate_delta(int p_delta)
Definition: playlist.cpp:741
bool playlist_manager::playlist_add_items ( t_size  playlist,
const pfc::list_base_const_t< metadb_handle_ptr > &  data,
const bit_array p_selection 
)

Definition at line 338 of file playlist.cpp.

339 {
340  return playlist_insert_items(playlist,pfc_infinite,data,p_selection) != pfc_infinite;
341 }
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
Inserts new items into specified playlist, at specified position.
bool playlist_manager::playlist_add_items_filter ( t_size  p_playlist,
const pfc::list_base_const_t< metadb_handle_ptr > &  p_data,
bool  p_select 
)

Definition at line 381 of file playlist.cpp.

382 {
383  return playlist_insert_items_filter(p_playlist,pfc_infinite,p_data,p_select);
384 }
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)
Definition: playlist.cpp:350
bool playlist_manager::playlist_add_locations ( t_size  p_playlist,
const pfc::list_base_const_t< const char * > &  p_urls,
bool  p_select,
HWND  p_parentwnd 
)

Definition at line 391 of file playlist.cpp.

392 {
393  return playlist_insert_locations(p_playlist,pfc_infinite,p_urls,p_select,p_parentwnd);
394 }
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)
Definition: playlist.cpp:366
void playlist_manager::playlist_clear ( t_size  p_playlist)

Clears contents of specified playlist (removes all items from it).

Definition at line 276 of file playlist.cpp.

277 {
279 }
virtual bool playlist_remove_items(t_size p_playlist, const bit_array &mask)=0
Removes specified items from specified playlist. Returns true on success or false on failure (playlis...
void playlist_manager::playlist_clear_selection ( t_size  p_playlist)

Definition at line 405 of file playlist.cpp.

406 {
408 }
virtual void playlist_set_selection(t_size p_playlist, const bit_array &p_affected, const bit_array &p_status)=0
Selects/deselects items on specified playlist.
virtual void playlist_manager::playlist_ensure_visible ( t_size  p_playlist,
t_size  p_item 
)
pure virtual

Tells playlist renderers to make sure that specified item is visible.

virtual void playlist_manager::playlist_enum_items ( t_size  p_playlist,
enum_items_callback p_callback,
const bit_array p_mask 
)
pure virtual

Enumerates contents of specified playlist.

virtual bool playlist_manager::playlist_execute_default_action ( t_size  p_playlist,
t_size  p_item 
)
pure virtual

Executes default doubleclick/enter action for specified item on specified playlist (starts playing the item unless overridden by a lock to do something else).

bool playlist_manager::playlist_find_item ( t_size  p_playlist,
metadb_handle_ptr  p_item,
t_size p_result 
)

Definition at line 821 of file playlist.cpp.

821  {
822  enum_items_callback_find_item callback(p_item);
823  playlist_enum_items(p_playlist,callback,bit_array_true());
824  t_size result = callback.result();
825  if (result == pfc_infinite) return false;
826  p_result = result;
827  return true;
828 }
size_t t_size
Definition: int_types.h:48
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
bool playlist_manager::playlist_find_item_selected ( t_size  p_playlist,
metadb_handle_ptr  p_item,
t_size p_result 
)

Definition at line 829 of file playlist.cpp.

829  {
830  enum_items_callback_find_item_selected callback(p_item);
831  playlist_enum_items(p_playlist,callback,bit_array_true());
832  t_size result = callback.result();
833  if (result == pfc_infinite) return false;
834  p_result = result;
835  return true;
836 }
size_t t_size
Definition: int_types.h:48
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
void playlist_manager::playlist_get_all_items ( t_size  p_playlist,
pfc::list_base_t< metadb_handle_ptr > &  out 
)

Definition at line 86 of file playlist.cpp.

87 {
88  playlist_get_items(p_playlist,out,bit_array_true());
89 }
void playlist_get_items(t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out, const bit_array &p_mask)
Definition: playlist.cpp:552
virtual t_size playlist_manager::playlist_get_focus_item ( t_size  p_playlist)
pure virtual

Retrieves index of focus item on specified playlist; returns infinite when no item has focus.

bool playlist_manager::playlist_get_focus_item_handle ( metadb_handle_ptr p_item,
t_size  p_playlist 
)

Definition at line 482 of file playlist.cpp.

483 {
484  t_size index = playlist_get_focus_item(p_playlist);
485  if (index == pfc_infinite) return false;
486  return playlist_get_item_handle(p_out,p_playlist,index);
487 }
bool playlist_get_item_handle(metadb_handle_ptr &p_out, t_size p_playlist, t_size p_item)
Helper; retrieves metadb_handle of the specified playlist item. Returns true on success, false on failure (invalid parameters).
Definition: playlist.cpp:115
size_t t_size
Definition: int_types.h:48
virtual t_size playlist_get_focus_item(t_size p_playlist)=0
Retrieves index of focus item on specified playlist; returns infinite when no item has focus...
virtual t_size playlist_manager::playlist_get_item_count ( t_size  p_playlist)
pure virtual

Retrieves number of items on specified playlist.

bool playlist_manager::playlist_get_item_handle ( metadb_handle_ptr p_out,
t_size  p_playlist,
t_size  p_item 
)

Helper; retrieves metadb_handle of the specified playlist item. Returns true on success, false on failure (invalid parameters).

Definition at line 115 of file playlist.cpp.

116 {
117  enum_items_callback_retrieve_item callback;
118  playlist_enum_items(p_playlist,callback,bit_array_one(p_item));
119  p_out = callback.get_item();
120  return p_out.is_valid();
121 }
bool is_valid() const
Definition: service.h:119
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
metadb_handle_ptr playlist_manager::playlist_get_item_handle ( t_size  playlist,
t_size  item 
)

Helper; retrieves metadb_handle of the specified playlist item; throws pfc::exception_invalid_params() on failure.

Definition at line 108 of file playlist.cpp.

108  {
109  metadb_handle_ptr temp;
110  if (!playlist_get_item_handle(temp, playlist, item)) throw pfc::exception_invalid_params();
111  PFC_ASSERT( temp.is_valid() );
112  return temp;
113 
114 }
bool playlist_get_item_handle(metadb_handle_ptr &p_out, t_size p_playlist, t_size p_item)
Helper; retrieves metadb_handle of the specified playlist item. Returns true on success, false on failure (invalid parameters).
Definition: playlist.cpp:115
bool is_valid() const
Definition: service.h:119
void playlist_manager::playlist_get_items ( t_size  p_playlist,
pfc::list_base_t< metadb_handle_ptr > &  out,
const bit_array p_mask 
)

Definition at line 552 of file playlist.cpp.

553 {
554  playlist_enum_items(p_playlist,enum_items_callback_retrieve_all_items(out),p_mask);
555 }
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
virtual bool playlist_manager::playlist_get_name ( t_size  p_playlist,
pfc::string_base p_out 
)
pure virtual

Retrieves name of specified playlist. Should never fail unless the parameters are invalid.

t_size playlist_manager::playlist_get_selected_count ( t_size  p_playlist,
bit_array const &  p_mask 
)

Definition at line 780 of file playlist.cpp.

780  {
781  enum_items_callback_get_selected_count callback;
782  playlist_enum_items(p_playlist,callback,p_mask);
783  return callback.get_count();
784 }
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
void playlist_manager::playlist_get_selected_items ( t_size  p_playlist,
pfc::list_base_t< metadb_handle_ptr > &  out 
)

Definition at line 91 of file playlist.cpp.

92 {
93  playlist_enum_items(p_playlist,enum_items_callback_retrieve_selected_items(out),bit_array_true());
94 }
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
t_size playlist_manager::playlist_get_selection_count ( t_size  p_playlist,
t_size  p_max 
)

Definition at line 468 of file playlist.cpp.

469 {
470  enum_items_callback_count_selection callback(p_max);
471  playlist_enum_items(p_playlist,callback,bit_array_true());
472  return callback.get_count();
473 }
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
void playlist_manager::playlist_get_selection_mask ( t_size  p_playlist,
bit_array_var out 
)

Retrieves selection map of specific playlist, using bit_array_var interface.

Definition at line 96 of file playlist.cpp.

97 {
98  playlist_enum_items(p_playlist,enum_items_callback_retrieve_selection_mask(out),bit_array_true());
99 }
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
virtual t_size playlist_manager::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 
)
pure virtual

Inserts new items into specified playlist, at specified position.

bool playlist_manager::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 
)

Definition at line 350 of file playlist.cpp.

351 {
352  metadb_handle_list temp;
354  if (!api->filter_items(p_data,temp))
355  return false;
356  return playlist_insert_items(p_playlist,p_base,temp,bit_array_val(p_select)) != pfc_infinite;
357 }
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
Inserts new items into specified playlist, at specified position.
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
bool playlist_manager::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 
)
Deprecated:
(since 0.9.3) Use playlist_incoming_item_filter_v2::process_locations_async whenever possible

Definition at line 366 of file playlist.cpp.

367 {
368  metadb_handle_list temp;
370  if (!api->process_locations(p_urls,temp,true,0,0,p_parentwnd)) return false;
371  return playlist_insert_items(p_playlist,p_base,temp,bit_array_val(p_select)) != pfc_infinite;
372 }
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
Inserts new items into specified playlist, at specified position.
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
bool playlist_manager::playlist_is_item_selected ( t_size  p_playlist,
t_size  p_item 
)

Helper; returns whether specified item on specified playlist is selected or not.

Definition at line 101 of file playlist.cpp.

102 {
103  enum_items_callback_retrieve_selection callback;
104  playlist_enum_items(p_playlist,callback,bit_array_one(p_item));
105  return callback.get_state();
106 }
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
virtual bool playlist_manager::playlist_is_redo_available ( t_size  p_playlist)
pure virtual

Returns whether a redo restore point is available for specified playlist.

virtual bool playlist_manager::playlist_is_undo_available ( t_size  p_playlist)
pure virtual

Returns whether an undo restore point is available for specified playlist.

virtual void playlist_manager::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 
)
pure virtual

Renders information about specified playlist item, using specified titleformatting script parameters.

Parameters
p_playlistIndex of playlist containing item being processed.
p_itemIndex of item being processed in the playlist containing it.
p_hookTitleformatting script hook to use; see titleformat_hook documentation for more info. Set to NULL when hook functionality is not needed.
p_outString object receiving results.
p_scriptCompiled titleformatting script to use; see titleformat_object cocumentation for more info.
p_filterText filter to use; see titleformat_text_filter documentation for more info. Set to NULL when text filter functionality is not needed.
p_playback_info_levelLevel of playback related information requested. See playback_control::t_display_level documentation for more info.
virtual t_uint32 playlist_manager::playlist_lock_get_filter_mask ( t_size  p_playlist)
pure virtual
virtual bool playlist_manager::playlist_lock_install ( t_size  p_playlist,
const service_ptr_t< playlist_lock > &  p_lock 
)
pure virtual
virtual bool playlist_manager::playlist_lock_is_present ( t_size  p_playlist)
pure virtual
virtual bool playlist_manager::playlist_lock_query_name ( t_size  p_playlist,
pfc::string_base p_out 
)
pure virtual
virtual bool playlist_manager::playlist_lock_show_ui ( t_size  p_playlist)
pure virtual
virtual bool playlist_manager::playlist_lock_uninstall ( t_size  p_playlist,
const service_ptr_t< playlist_lock > &  p_lock 
)
pure virtual
bool playlist_manager::playlist_move_selection ( t_size  p_playlist,
int  p_delta 
)

Moves selected items up/down in the playlist by specified offset.

Parameters
p_playlistIndex of playlist to alter.
p_deltaOffset to move items by. Set it to a negative valuye to move up, or to a positive value to move down.
Returns
True on success, false on failure (e.g. playlist locked).

Definition at line 127 of file playlist.cpp.

127  {
128  if (p_delta==0) return true;
129 
130  t_size count = playlist_get_item_count(p_playlist);
131 
132  pfc::array_t<t_size> order; order.set_size(count);
133  pfc::array_t<bool> selection; selection.set_size(count);
134 
135  playlist_get_selection_mask(p_playlist,bit_array_var_table(selection.get_ptr(),selection.get_size()));
136  g_make_selection_move_permutation(order.get_ptr(),count,bit_array_table(selection.get_ptr(),selection.get_size()),p_delta);
137  return playlist_reorder_items(p_playlist,order.get_ptr(),count);
138 }
const t_item * get_ptr() const
Definition: array.h:213
bit_array_table_t< bool > bit_array_table
virtual bool playlist_reorder_items(t_size p_playlist, const t_size *p_order, t_size p_count)=0
Reorders items in specified playlist according to specified permutation.
bit_array_var_table_t< bool > bit_array_var_table
void playlist_get_selection_mask(t_size p_playlist, bit_array_var &out)
Retrieves selection map of specific playlist, using bit_array_var interface.
Definition: playlist.cpp:96
static void g_make_selection_move_permutation(t_size *p_output, t_size p_count, const bit_array &p_selection, int p_delta)
Definition: playlist.cpp:123
size_t t_size
Definition: int_types.h:48
void set_size(t_size p_size)
Definition: array.h:104
virtual t_size playlist_get_item_count(t_size p_playlist)=0
Retrieves number of items on specified playlist.
t_size get_size() const
Definition: array.h:130
virtual bool playlist_manager::playlist_redo_restore ( t_size  p_playlist)
pure virtual

Reverts specified playlist to next redo restore point and generates an undo restore point.

Returns
True on success, false on failure (playlist locked or no restore point available).
virtual bool playlist_manager::playlist_remove_items ( t_size  p_playlist,
const bit_array mask 
)
pure virtual

Removes specified items from specified playlist. Returns true on success or false on failure (playlist locked).

void playlist_manager::playlist_remove_selection ( t_size  p_playlist,
bool  p_crop = false 
)

Definition at line 436 of file playlist.cpp.

437 {
438  bit_array_bittable table(playlist_get_item_count(p_playlist));
439  playlist_get_selection_mask(p_playlist,table);
440  if (p_crop) playlist_remove_items(p_playlist,bit_array_not(table));
441  else playlist_remove_items(p_playlist,table);
442 }
Generic variable bit_array implementation. Needs to be initialized with requested array size before ...
Negation of another array. Valid index range is the same as valid index range of the parameter array...
void playlist_get_selection_mask(t_size p_playlist, bit_array_var &out)
Retrieves selection map of specific playlist, using bit_array_var interface.
Definition: playlist.cpp:96
virtual bool playlist_remove_items(t_size p_playlist, const bit_array &mask)=0
Removes specified items from specified playlist. Returns true on success or false on failure (playlis...
virtual t_size playlist_get_item_count(t_size p_playlist)=0
Retrieves number of items on specified playlist.
virtual bool playlist_manager::playlist_rename ( t_size  p_index,
const char *  p_name,
t_size  p_name_length 
)
pure virtual

Renames specified playlist.

Parameters
p_nameNew name of playlist; a UTF-8 encoded string.
p_name_lengthLength limit of playlist 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 on success, false on failure (playlist locked).
virtual bool playlist_manager::playlist_reorder_items ( t_size  p_playlist,
const t_size p_order,
t_size  p_count 
)
pure virtual

Reorders items in specified playlist according to specified permutation.

virtual bool playlist_manager::playlist_replace_item ( t_size  p_playlist,
t_size  p_item,
const metadb_handle_ptr p_new_item 
)
pure virtual

Replaces specified item on specified playlist. Returns true on success or false on failure (playlist locked).

t_size playlist_manager::playlist_set_focus_by_handle ( t_size  p_playlist,
metadb_handle_ptr  p_item 
)

Definition at line 837 of file playlist.cpp.

837  {
838  t_size index;
839  if (!playlist_find_item(p_playlist,p_item,index)) index = pfc_infinite;
840  playlist_set_focus_item(p_playlist,index);
841  return index;
842 }
size_t t_size
Definition: int_types.h:48
bool playlist_find_item(t_size p_playlist, metadb_handle_ptr p_item, t_size &p_result)
Definition: playlist.cpp:821
virtual void playlist_set_focus_item(t_size p_playlist, t_size p_item)=0
Sets index of focus item on specified playlist; use infinite to set no focus item.
virtual void playlist_manager::playlist_set_focus_item ( t_size  p_playlist,
t_size  p_item 
)
pure virtual

Sets index of focus item on specified playlist; use infinite to set no focus item.

virtual void playlist_manager::playlist_set_selection ( t_size  p_playlist,
const bit_array p_affected,
const bit_array p_status 
)
pure virtual

Selects/deselects items on specified playlist.

Parameters
p_playlistIndex of playlist to alter.
p_affectedMask of items to alter.
p_statusMask of selected/deselected state to apply to items specified by p_affected.
void playlist_manager::playlist_set_selection_single ( t_size  p_playlist,
t_size  p_item,
bool  p_state 
)

Definition at line 457 of file playlist.cpp.

458 {
459  playlist_set_selection(p_playlist,bit_array_one(p_item),bit_array_val(p_state));
460 }
virtual void playlist_set_selection(t_size p_playlist, const bit_array &p_affected, const bit_array &p_status)=0
Selects/deselects items on specified playlist.
virtual bool playlist_manager::playlist_sort_by_format ( t_size  p_playlist,
const char *  p_pattern,
bool  p_sel_only 
)
pure virtual

Sorts specified playlist - entire playlist or selection only - by specified title formatting pattern, or randomizes the order.

Parameters
p_playlistIndex of playlist to alter.
p_patternTitle formatting pattern to sort by (an UTF-8 encoded null-termindated string). Set to NULL to randomize the order of items.
p_sel_onlySet to false to sort/randomize whole playlist, or to true to sort/randomize only selection on the playlist.
Returns
True on success, false on failure (playlist locked etc).
virtual void playlist_manager::playlist_undo_backup ( t_size  p_playlist)
pure virtual

Creates an undo restore point for specified playlist.

virtual bool playlist_manager::playlist_undo_restore ( t_size  p_playlist)
pure virtual

Reverts specified playlist to last undo restore point and generates a redo restore point.

Returns
True on success, false on failure (playlist locked or no restore point available).
bool playlist_manager::playlist_update_content ( t_size  playlist,
metadb_handle_list_cref  content,
bool  bUndoBackup 
)

Changes contents of the specified playlist to the specified items, trying to reuse existing playlist content as much as possible (preserving selection/focus/etc). Order of items in playlist not guaranteed to be the same as in the specified item list.

Returns
true if the playlist has been altered, false if there was nothing to update.

Definition at line 287 of file playlist.cpp.

287  {
288  metadb_handle_list old;
289  playlist_get_all_items(playlist, old);
290  if (old.get_size() == 0) {
291  if (content.get_size() == 0) return false;
292  if (bUndoBackup) playlist_undo_backup(playlist);
293  playlist_add_items(playlist, content, bit_array_false());
294  return true;
295  }
296  pfc::avltree_t<metadb_handle::nnptr> itemsOld, itemsNew;
297 
298  for(t_size walk = 0; walk < old.get_size(); ++walk) itemsOld += old[walk];
299  for(t_size walk = 0; walk < content.get_size(); ++walk) itemsNew += content[walk];
300  bit_array_bittable removeMask(old.get_size());
301  bit_array_bittable filterMask(content.get_size());
302  bool gotNew = false, filterNew = false, gotRemove = false;
303  for(t_size walk = 0; walk < content.get_size(); ++walk) {
304  const bool state = !itemsOld.have_item(content[walk]);
305  if (state) gotNew = true;
306  else filterNew = true;
307  filterMask.set(walk, state);
308  }
309  for(t_size walk = 0; walk < old.get_size(); ++walk) {
310  const bool state = !itemsNew.have_item(old[walk]);
311  if (state) gotRemove = true;
312  removeMask.set(walk, state);
313  }
314  if (!gotNew && !gotRemove) return false;
315  if (bUndoBackup) playlist_undo_backup(playlist);
316  if (gotRemove) {
317  playlist_remove_items(playlist, removeMask);
318  }
319  if (gotNew) {
320  if (filterNew) {
321  metadb_handle_list temp(content);
322  temp.filter_mask(filterMask);
323  playlist_add_items(playlist, temp, bit_array_false());
324  } else {
325  playlist_add_items(playlist, content, bit_array_false());
326  }
327  }
328 
329  {
330  playlist_get_all_items(playlist, old);
331  pfc::array_t<t_size> order;
333  playlist_reorder_items(playlist, order.get_ptr(), order.get_size());
334  }
335  }
336  return true;
337 }
const t_item * get_ptr() const
Definition: array.h:213
t_size get_size() const
Definition: list.h:366
Generic variable bit_array implementation. Needs to be initialized with requested array size before ...
virtual bool playlist_reorder_items(t_size p_playlist, const t_size *p_order, t_size p_count)=0
Reorders items in specified playlist according to specified permutation.
bool have_item(const t_param &p_item) const
Same as contains().
Definition: avltree.h:433
t_size get_size() const
Definition: list.h:14
size_t t_size
Definition: int_types.h:48
void playlist_get_all_items(t_size p_playlist, pfc::list_base_t< metadb_handle_ptr > &out)
Definition: playlist.cpp:86
virtual void playlist_undo_backup(t_size p_playlist)=0
Creates an undo restore point for specified playlist.
virtual bool playlist_remove_items(t_size p_playlist, const bit_array &mask)=0
Removes specified items from specified playlist. Returns true on success or false on failure (playlis...
static bool guess_reorder_pattern(pfc::array_t< t_size > &out, const t_list1 &from, const t_list2 &to)
t_size get_size() const
Definition: array.h:130
bool playlist_add_items(t_size playlist, const pfc::list_base_const_t< metadb_handle_ptr > &data, const bit_array &p_selection)
Definition: playlist.cpp:338
virtual void playlist_manager::queue_add_item ( metadb_handle_ptr  p_item)
pure virtual
virtual void playlist_manager::queue_add_item_playlist ( t_size  p_playlist,
t_size  p_item 
)
pure virtual
virtual t_size playlist_manager::queue_find_index ( t_playback_queue_item const &  p_item)
pure virtual

Returns index (0-based) on success, infinite on failure (item not in queue).

void playlist_manager::queue_flush ( )
inline

Helper; removes all items from the playback queue.

Definition at line 235 of file playlist.h.

virtual void queue_remove_mask(bit_array const &p_mask)=0
virtual void playlist_manager::queue_get_contents ( pfc::list_base_t< t_playback_queue_item > &  p_out)
pure virtual
virtual t_size playlist_manager::queue_get_count ( )
pure virtual
bool playlist_manager::queue_is_active ( )
inline

Helper; returns whether there are items in the playback queue.

Definition at line 237 of file playlist.h.

237 {return queue_get_count() > 0;}
virtual t_size queue_get_count()=0
virtual void playlist_manager::queue_remove_mask ( bit_array const &  p_mask)
pure virtual
virtual void playlist_manager::register_callback ( class playlist_callback p_callback,
unsigned  p_flags 
)
pure virtual

Registers a playlist callback; registered object receives notifications about any modifications of any of loaded playlists.

Parameters
p_callbackCallback interface to register.
p_flagsFlags indicating which callback methods are requested. See playlist_callback::flag_* constants for more info. The main purpose of flags parameter is working set optimization by not calling methods that do nothing.
virtual void playlist_manager::register_callback ( class playlist_callback_single p_callback,
unsigned  p_flags 
)
pure virtual

Registers a playlist callback; registered object receives notifications about any modifications of active playlist.

Parameters
p_callbackCallback interface to register.
p_flagsFlags indicating which callback methods are requested. See playlist_callback_single::flag_* constants for more info. The main purpose of flags parameter is working set optimization by not calling methods that do nothing.
void playlist_manager::remove_items_from_all_playlists ( const pfc::list_base_const_t< metadb_handle_ptr > &  p_data)

Definition at line 598 of file playlist.cpp.

599 {
600  t_size playlist_num, playlist_max = get_playlist_count();
601  if (playlist_max != pfc_infinite)
602  {
603  metadb_handle_list temp;
604  temp.add_items(p_data);
605  temp.sort_by_pointer();
606  for(playlist_num = 0; playlist_num < playlist_max; playlist_num++ )
607  {
608  t_size playlist_item_count = playlist_get_item_count(playlist_num);
609  if (playlist_item_count == pfc_infinite) break;
610  bit_array_bittable table(playlist_item_count);
611  enum_items_callback_remove_list callback(temp,table);
612  playlist_enum_items(playlist_num,callback,bit_array_true());
613  if (callback.get_found()>0)
614  playlist_remove_items(playlist_num,table);
615  }
616  }
617 }
Generic variable bit_array implementation. Needs to be initialized with requested array size before ...
void add_items(const t_in &in)
Definition: list.h:424
size_t t_size
Definition: int_types.h:48
virtual void playlist_enum_items(t_size p_playlist, enum_items_callback &p_callback, const bit_array &p_mask)=0
Enumerates contents of specified playlist.
virtual bool playlist_remove_items(t_size p_playlist, const bit_array &mask)=0
Removes specified items from specified playlist. Returns true on success or false on failure (playlis...
virtual t_size playlist_get_item_count(t_size p_playlist)=0
Retrieves number of items on specified playlist.
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
bool playlist_manager::remove_playlist ( t_size  p_playlist)

Helper; removes single playlist of specified index.

Definition at line 266 of file playlist.cpp.

267 {
268  return remove_playlists(bit_array_one(idx));
269 }
virtual bool remove_playlists(const bit_array &p_mask)=0
Removes playlists according to specified mask. See also: bit_array.
bool playlist_manager::remove_playlist_switch ( t_size  p_playlist)

Helper; removes single playlist of specified index, and switches to another playlist when possible.

Definition at line 652 of file playlist.cpp.

653 {
654  bool need_switch = get_active_playlist() == idx;
655  if (remove_playlist(idx))
656  {
657  if (need_switch)
658  {
659  t_size total = get_playlist_count();
660  if (total > 0)
661  {
662  if (idx >= total) idx = total-1;
663  set_active_playlist(idx);
664  }
665  }
666  return true;
667  }
668  else return false;
669 }
virtual void set_active_playlist(t_size p_index)=0
Sets active playlist (infinite to set no active playlist).
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
size_t t_size
Definition: int_types.h:48
bool remove_playlist(t_size p_playlist)
Helper; removes single playlist of specified index.
Definition: playlist.cpp:266
virtual t_size get_playlist_count()=0
Retrieves number of playlists.
virtual bool playlist_manager::remove_playlists ( const bit_array p_mask)
pure virtual

Removes playlists according to specified mask. See also: bit_array.

virtual bool playlist_manager::reorder ( const t_size p_order,
t_size  p_count 
)
pure virtual

Reorders the playlist list according to specified permutation.

Returns
True on success, false on failure (call from invalid context).
void playlist_manager::reset_playing_playlist ( )

Definition at line 400 of file playlist.cpp.

401 {
403 }
virtual t_size get_active_playlist()=0
Retrieves index of active playlist; infinite if no playlist is active.
virtual void set_playing_playlist(t_size p_index)=0
Sets playlist from which items to be played are taken from.
virtual void playlist_manager::set_active_playlist ( t_size  p_index)
pure virtual

Sets active playlist (infinite to set no active playlist).

virtual void playlist_manager::set_playing_playlist ( t_size  p_index)
pure virtual

Sets playlist from which items to be played are taken from.

virtual void playlist_manager::unregister_callback ( class playlist_callback p_callback)
pure virtual

Unregisters a playlist callback (playlist_callback version).

virtual void playlist_manager::unregister_callback ( class playlist_callback_single p_callback)
pure virtual

Unregisters a playlist callback (playlist_callback_single version).


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