Logo Search packages:      
Sourcecode: banshee-community-extensions version File versions  Download package

Banshee::LiveRadio::Plugins::MagnatunePlugin Class Reference

Inheritance diagram for Banshee::LiveRadio::Plugins::MagnatunePlugin:

Banshee::LiveRadio::Plugins::LiveRadioBasePlugin Banshee::LiveRadio::Plugins::ILiveRadioPlugin

List of all members.


Detailed Description

LiveRadio plugin for magnatune.com.

This plugin is able to download a genre list upon initialize/refresh and execute live queries on the shoutcast directory

Definition at line 51 of file MagnatunePlugin.cs.


Public Member Functions

virtual SafeUri CleanUpUrl (SafeUri url)
 Cleans up any plugin specific data from a track url, such as session data or any other temporary parameters.
virtual void Disable ()
 Method that will disable the plugin. Must set Enabled Property to false and should disable any background tasks.
void ExecuteRequest (LiveRadioRequestType request_type, string query)
 Method capsuling the actual RetrieveRequest worker method with a background worker thread.
virtual void Initialize ()
 Initializes the plugin by retrieving its genre list.
 MagnatunePlugin ()
 Constructor -- sets configuration entries.
void RaiseErrorReturned (string short_message, string long_message)
 Raises the ErrorReturned event.
void RaiseGenreListLoaded ()
 Raises the GenreListLoaded event.
void RaiseRequestResultRetrieved (LiveRadioRequestType request_type, string query)
 Raises the ResultsRetrieved event.
void RetrieveGenreList ()
 Method capsuling the actual RetrieveGenres worker method with a background worker thread.
override void SaveConfiguration ()
 Saves the configuration for this plugin.
virtual void SetLiveRadioPluginSource (LiveRadioPluginSource source)
 Set the LiveRadioPluginSource of the plugin.
override string ToString ()
 Return a string most likely unique to the plugin, best practice is to return the name of the plugin.

Static Public Attributes

static readonly SchemaEntry
< string > 
HttpTimeoutEntry
static readonly SchemaEntry
< string > 
ProxyUrlEntry
static readonly SchemaEntry
< string > 
UseProxyEntry

Protected Member Functions

void OnErrorReturned (string short_message, string long_message)
 Method to invoke the ErrorReturned event.
void OnGenreListLoaded ()
 Method to invoke the GenreListLoaded event.
void OnRequestResultRetrieved (LiveRadioRequestType request_type, string query, List< DatabaseTrackInfo > result)
 Method to invoke the RequestResultRetrieved event.
override void RetrieveGenres ()
 Retrieve and parse genre list.
string RetrieveHtml (string query)
 Retrieves, reads and returns an HTML document from the specified query url using HTTP GET.
override void RetrieveRequest (LiveRadioRequestType request_type, string query)
 Retrieve and parse a live query on the shoutcast directory.
XmlDocument RetrieveXml (string query)
 Retrieves, reads and returns an XML document from the specified query url using HTTP GET.

Protected Attributes

Dictionary< string, List
< DatabaseTrackInfo > > 
cached_results
LiveRadioPluginConfigurationWidget configuration_widget
string credentials_password
string credentials_username
List< Genregenres
bool has_login
int http_timeout_seconds
string proxy_url
LiveRadioPluginSource source
bool use_credentials
bool use_proxy

Properties

virtual Widget ConfigurationWidget [get]
 Always returns a new standard Configration Widget with all base Properties set.
bool Enabled [get]
 Must truthfully return, if the plugin is enabled. A plugin is enabled, if it has been initialized and not been disabled afterwards.
List< GenreGenres [get]
 Returns the list of genres.
string HttpPassword [get, set]
int HttpTimeout [get, set]
string HttpUsername [get, set]
string IsEnabled [get]
 Should return "Yes" if enabled, and "No" if not enabled.
override string Name [get]
 The name of the plugin -- used as identifier and as label for the source header.
LiveRadioPluginSource PluginSource [get]
 Returns the LiveRadioPluginSource for this plugin.
string ProxyUrl [get, set]
bool UseCredentials [get, set]
bool UseProxy [get, set]
override string Version [get]
 Version of this plugin code.

Events

ErrorReturnedEventHandler ErrorReturned
 Event raised when an Error occurs in a plugin.
GenreListLoadedEventHandler GenreListLoaded
 Event raised when a genre list has been retrieved by the plugin.
RequestResultRetrievedEventHandler RequestResultRetrieved
 Event raised when a query result has been retrieved by the plugin.

Private Member Functions

void ParseGenres (string html)
 Parses and sorts an XML genre catalog and fills the plugins genre list.
void ParseSearchResult (string html, string query)
 Parses the response to a query request and fills the results cache.
void ParseXspf (XmlDocument document, Genre genre)

Private Attributes

const string album_postfix = "hifi.xspf"
const string base_url = "http://magnatune.com"
const string freetext_request = "/search_one?c=songnames&t=m&w="
const string genre_url = "/collections/"
const string search_url = "http://my.magnatune.com"

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

Generated by  Doxygen 1.6.0   Back to index