Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
126 lines (110 sloc) 3.77 KB
/*
* sbIPlaydarService XPCOM Interface
*
* Copyright (c) 2009 Steven M. Lloyd
* steve@repeatingbeats.com
*
*
* This file is part of the Birdplaydar Songbird add-on.
*
* This file may be licensed under the terms of of the
* GNU General Public License Version 2 (the ``GPL'').
*
* Software distributed under the License is distributed
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the GPL for the specific language
* governing rights and limitations.
*
* You should have received a copy of the GPL along with this
* program. If not, go to http://www.gnu.org/licenses/gpl.html
* or write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "nsISupports.idl"
interface sbILibrary;
interface sbIMediaList;
interface sbIMediaListListener;
interface sbIPlaydarServiceListener;
interface sbIPropertyArray;
interface sbIServicePaneNode;
/**
* \interface sbIPlaydarService
*
* \brief Manages interaction between Songbird and Playdar
*/
[scriptable, uuid(57b773d6-7a0f-41f1-8ef1-768109d47e1c)]
interface sbIPlaydarService : nsISupports
{
/** \brief playdar service version */
readonly attribute AString versionString;
/** \brief library for all playdar tracks */
attribute sbILibrary playdarLibrary;
/** \brief service pane folder node for playdar */
attribute sbIServicePaneNode playdarServiceNode;
/** \brief custom playdar property for resolve source */
attribute AString sourcePropID;
/** \brief custom playdar property for resolve score */
attribute AString scorePropID;
/**
* \brief registers a new client with the playdar service
*
* \param aListener The service listener
* \param aHideTracks If true, resolved Playdar tracks are hidden in library
*
* \return client ID to be used for calls to the playdar service
*/
AString registerClient(in sbIPlaydarServiceListener aListener,
in boolean aHideTracks);
/**
* \brief cleanup when client no longer needs service
*
* \param aCid Client ID
* \param aRemoveClientList If true, client playlist is removed from library
* \param aRemoveAllTracks If true, all tracks resolved for this client are
* removed from the library
* \param aRemoveHiddenTracks If true, only hidden tracks resolved for this
* client are removed from the library
*/
void unregisterClient(in AString aCid,
in boolean aRemoveClientList,
in boolean aRemoveAllTracks,
[optional] in boolean aRemoveHiddenTracks);
/**
* \brief gets the sbIMediaList for a given client. playdar tracks are
* resolved to this list.
*
* \param aCid Client ID
*
* \return an sbIMediaList for this client
*/
sbIMediaList getClientList(in AString aCid);
/**
* \brief query to check availability of playdar. the 'onStat' function in
* the client's sbIPlaydarServiceListener will be called with results.
*/
void stat();
/**
* \brief query playdar to resolve a track
*
* \param aCid Client ID
* \param aArtist Track artist
* \param aAlbum Track album
* \param aTrack Track name
* \param aQid Query ID
*/
void resolve(in AString aCid,
in AString aArtist,
in AString aAlbum,
in AString aTrack,
[optional] in AString aQid);
/**
* \brief Set the client's playdar medialist to be visible in the service
* pane. This automatically sets resolved tracks to be visible.
*
* \param aCid Client ID
* \param aName Name for the playlist
*/
void showClientListInServicePane (in AString aCid,
in AString aName);
};