Interface IAimpExtensionDataStorage
The extension for the IAimpServiceMusicLibrary service provides an ability to plugin to implement custom data storage for the Music Library. Interface implementation must support asynchronous access.
Data storage MUST contains a fields with following names: AIMPML_RESERVED_FIELD_ID - unique ID of record in data storage AIMPML_RESERVED_FIELD_FILENAME - file name of the record that used by player If this fields are not defined in Data Storage - registration of the extension will be failed. Also, the Music Library engine provides an ability to use following special fields: AIMPML_RESERVED_FIELD_FILESIZE - file size in bytes (type: Int64), used to calculate information about the content of table AIMPML_RESERVED_FIELD_DURATION - duration in seconds (type: Double) ,used to calculate information about the content of table AIMPML_RESERVED_FIELD_USERMARK - user rating mark (type: Double), Refer to the IAIMPMLDataStorageCommandUserMark
Namespace: AIMP.SDK.MusicLibrary.Extension
Assembly: AIMP.SDK.dll
Syntax
public interface IAimpExtensionDataStorage
Properties
Capabilities
Gets the capabilities.
Declaration
CapabilitiesType Capabilities { get; }
Caption
Gets the storage title.
Declaration
string Caption { get; }
Id
Gets the storage identifier.
Declaration
string Id { get; }
Methods
ConfigLoad(IAimpConfig, String)
Method will be called on first activation of tab of data storage in Music Library interface.
Declaration
AimpActionResult ConfigLoad(IAimpConfig config, string section)
Parameters
Type | Name | Description |
---|---|---|
IAimpConfig | config | The configuration. |
System.String | section | Section Name to that contains the settings. You can use the children section names if it needed: Section + "." + ChildSectionName |
ConfigSave(IAimpConfig, String)
Method calls before the finalization of plugin.
Declaration
AimpActionResult ConfigSave(IAimpConfig config, string section)
Parameters
Type | Name | Description |
---|---|---|
IAimpConfig | config | The configuration. |
System.String | section | Section Name to store the settings. You can use the children section names if it needed: Section + "." + ChildSectionName |
FlushCache()
Method calls when user executes the "refresh" command via hotkey or context menu. After this call the Music Library engine will automatically reload the data from data storage.
Declaration
void FlushCache()
GetFields(SchemaType)
Method returns settings and layout of the data fields in dependency from specified Schema value.
Declaration
AimpActionResult<IList> GetFields(SchemaType schemaType)
Parameters
Type | Name | Description |
---|---|---|
SchemaType | schemaType | Type of the schema SchemaType. |
GetGroupingPresets(GroupingPresetsSchemaType, IAimpGroupingPresets)
Plugin must populate the Presets list by predefined presets for grouping tree based on the Schema value.
Declaration
AimpActionResult GetGroupingPresets(GroupingPresetsSchemaType schema, IAimpGroupingPresets presets)
Parameters
Type | Name | Description |
---|---|---|
GroupingPresetsSchemaType | schema | The schema. |
IAimpGroupingPresets | presets | The presets. |
Initialize(IAimpDataStorageManager)
Method calls after succeeded registration of data storage.
Declaration
void Initialize(IAimpDataStorageManager manager)
Parameters
Type | Name | Description |
---|---|---|
IAimpDataStorageManager | manager | The Manager interface is used to notify the Music Library about the changes in data storage. |
Terminate()
Method calls before the finalization of plugin. Plugin must dispose all external links.
Declaration
void Terminate()