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

Banshee::LiveRadio::Plugins::Live365Plugin Class Reference

Inheritance diagram for Banshee::LiveRadio::Plugins::Live365Plugin:

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

List of all members.

Detailed Description

LiveRadio plugin for live365.com.

This plugin is able to download a genre list upon initialize/refresh and execute live queries on the live365 directory. The plugin can configure and handle user login data of registered live365 users. Once added to the internet radio source, the user specifics for a track are lost, so this makes only sense for public tracks available to non-registered users

Definition at line 54 of file Live365Plugin.cs.

Public Member Functions

override SafeUri CleanUpUrl (SafeUri url)
 Cleans up live365 session data from a track url.
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.
 Live365Plugin ()
 Constructor -- invokes the base constructor with has_login=true for handling user credentials. Sets configured Properties.
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 > 
static readonly SchemaEntry
< string > 
static readonly SchemaEntry
< string > 
static readonly SchemaEntry
< string > 
static readonly SchemaEntry
< string > 
static readonly SchemaEntry
< string > 

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.
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 > > 
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


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.


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 CreateSession ()
 Creates a new user session and saves the result in the private session_id member.
string GetSession ()
 Get a user session identifier. If a session_id is already present, it tests the current session_id for validity first and will reuse it, if valid, otherwise a new session is created.
void OnKeepAliveElapsed (object sender, System.Timers.ElapsedEventArgs e)
 This function is periodically called by a timer, after a session has been established and tests session validity. The test is used as a keepalive signal for the session.
void ParseGenres (XmlDocument doc)
 Parses and sorts an XML genre catalog and fills the plugins genre list.
void ParseXmlResponse (XmlDocument xml_response, LiveRadioRequestType request_type, string query)
 Parses the response to a query request and fills the results cache.
bool TestSession ()
 Checks if the memorized user session is still valid.

Private Attributes

const string base_url = "http://www.live365.com"
const string freetext_request = "&searchdesc="
const string genre_request = "&genre="
const string genre_url = "/cgi-bin/api_genres.cgi?site=xml&org=live365&access=all&version=4&charset=UTF-8"
const int keepalive_timeout = 600000
Timer keepalive_timer = null
const string login_url = "http://www.live365.com/cgi-bin/api_login.cgi?site=xml&remeber=Y&org=live365&access=all&version=4&charset=UTF-8&membername=%USERNAME%&password=%PASSWORD%"
const string playlist_url = "http://www.live365.com/play/"
const string replace_url = "http://www.live365.com/play/"
const string request_url = "/cgi-bin/directory.cgi?site=xml&org=live365&access=all&version=4&rows=200&charset=UTF-8"
string session_id = null
const string test_session_url = "http://www.live365.com/cgi-bin/api_presets.cgi?action=get&org=live365&first=1&device_id=UNKNOWN&rows="

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

Generated by  Doxygen 1.6.0   Back to index