library_manager Class Reference

#include <library_manager.h>

Inheritance diagram for library_manager:

service_base library_manager_v2 library_manager_v3

List of all members.

Public Types

typedef library_manager t_interface_entrypoint
typedef library_manager t_interface
typedef service_base t_interface_parent

Public Member Functions

virtual bool is_item_in_library (const metadb_handle_ptr &p_item)=0
 Returns whether specified item is in the Media Library or not.
virtual bool is_item_addable (const metadb_handle_ptr &p_item)=0
 Returns whether current user settings allow specified item to be added to the Media Library or not.
virtual bool is_path_addable (const char *p_path)=0
 Returns whether current user settings allow specified item path to be added to the Media Library or not.
virtual bool get_relative_path (const metadb_handle_ptr &p_item, pfc::string_base &p_out)=0
virtual void enum_items (enum_callback &p_callback)=0
 Calls callback method for every item in the Media Library. Note that order of items in Media Library is undefined.
virtual void add_items (const pfc::list_base_const_t< metadb_handle_ptr > &p_data)=0
 Adds specified items to the Media Library (items actually added will be filtered according to user settings).
virtual void remove_items (const pfc::list_base_const_t< metadb_handle_ptr > &p_data)=0
 Removes specified items from the Media Library (does nothing if specific item is not in the Media Library).
virtual void add_items_async (const pfc::list_base_const_t< metadb_handle_ptr > &p_data)=0
 Adds specified items to the Media Library (items actually added will be filtered according to user settings). The difference between this and add_items() is that items are not added immediately; the operation is queued and executed later, so it is safe to call from e.g. global callbacks.
virtual void on_files_deleted_sorted (const pfc::list_base_const_t< const char * > &p_data)=0
 For internal use only; p_data must be sorted by metadb::path_compare; use file_operation_callback static methods instead of calling this directly.
virtual void get_all_items (pfc::list_base_t< metadb_handle_ptr > &p_out)=0
 Retrieves entire Media Library content.
virtual bool is_library_enabled ()=0
 Returns whether Media Library functionality is enabled or not, for e.g. notifying user to change settings when trying to use a Media Library viewer without having configured Media Library first.
virtual void show_preferences ()=0
 Pops up Media Library preferences page.
virtual void rescan ()=0
virtual void check_dead_entries (const pfc::list_base_t< metadb_handle_ptr > &p_list)=0

Static Public Attributes

static const GUID class_guid

Classes

class  enum_callback
 Interface for use with library_manager::enum_items(). More...


Detailed Description

This service implements methods allowing you to interact with the Media Library.
All methods are valid from main thread only.
To avoid race conditions, methods that alter library contents should not be called from inside global callbacks.
Usage: Use static_api_ptr_t<library_manager> to instantiate.

Member Typedef Documentation

Reimplemented from service_base.

Reimplemented in library_manager_v2, and library_manager_v3.

Reimplemented in library_manager_v2, and library_manager_v3.


Member Function Documentation

virtual bool library_manager::is_item_in_library ( const metadb_handle_ptr p_item  )  [pure virtual]

Returns whether specified item is in the Media Library or not.

virtual bool library_manager::is_item_addable ( const metadb_handle_ptr p_item  )  [pure virtual]

Returns whether current user settings allow specified item to be added to the Media Library or not.

virtual bool library_manager::is_path_addable ( const char *  p_path  )  [pure virtual]

Returns whether current user settings allow specified item path to be added to the Media Library or not.

virtual bool library_manager::get_relative_path ( const metadb_handle_ptr p_item,
pfc::string_base p_out 
) [pure virtual]

Retrieves path of specified item relative to Media Library directory it is in. Returns true on success, false when the item is not in the Media Library. SPECIAL WARNING: to allow multi-CPU optimizations to parse relative track paths, this API works in threads other than the main app thread. Main thread MUST be blocked while working in such scenarios, it's NOT safe to call from worker threads while ML content/configuration might be getting altered.

virtual void library_manager::enum_items ( enum_callback p_callback  )  [pure virtual]

Calls callback method for every item in the Media Library. Note that order of items in Media Library is undefined.

virtual void library_manager::add_items ( const pfc::list_base_const_t< metadb_handle_ptr > &  p_data  )  [pure virtual]

Adds specified items to the Media Library (items actually added will be filtered according to user settings).

virtual void library_manager::remove_items ( const pfc::list_base_const_t< metadb_handle_ptr > &  p_data  )  [pure virtual]

Removes specified items from the Media Library (does nothing if specific item is not in the Media Library).

virtual void library_manager::add_items_async ( const pfc::list_base_const_t< metadb_handle_ptr > &  p_data  )  [pure virtual]

Adds specified items to the Media Library (items actually added will be filtered according to user settings). The difference between this and add_items() is that items are not added immediately; the operation is queued and executed later, so it is safe to call from e.g. global callbacks.

virtual void library_manager::on_files_deleted_sorted ( const pfc::list_base_const_t< const char * > &  p_data  )  [pure virtual]

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

virtual void library_manager::get_all_items ( pfc::list_base_t< metadb_handle_ptr > &  p_out  )  [pure virtual]

Retrieves entire Media Library content.

virtual bool library_manager::is_library_enabled (  )  [pure virtual]

Returns whether Media Library functionality is enabled or not, for e.g. notifying user to change settings when trying to use a Media Library viewer without having configured Media Library first.

virtual void library_manager::show_preferences (  )  [pure virtual]

Pops up Media Library preferences page.

virtual void library_manager::rescan (  )  [pure virtual]

Rescans user-specified Media Library directories for new files and removes references to files that no longer exist from the Media Library.
Note that this function creates modal dialog and does not return until the operation has completed.

Deprecated:
Use library_manager_v2::rescan_async() when possible.

virtual void library_manager::check_dead_entries ( const pfc::list_base_t< metadb_handle_ptr > &  p_list  )  [pure virtual]

Hints Media Library about possible dead items, typically used for "remove dead entries" context action in ML viewers. The implementation will verify whether the items are actually dead before ML contents are altered.
Note that this function creates modal dialog and does not return until the operation has completed.

Deprecated:
Use library_manager_v2::rescan_async() when possible.


Member Data Documentation

const GUID library_manager::class_guid [static]

Initial value:

 
{ 0xfebd85b5, 0xc12d, 0x45b5, { 0xb5, 0x5d, 0xd, 0x3f, 0x43, 0x2b, 0xc, 0x6b } }

Reimplemented in library_manager_v2, and library_manager_v3.


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

Generated on Fri Apr 25 18:49:45 2008 for foobar2000 SDK by  doxygen 1.5.5