Public Member Functions | Protected Member Functions | Protected Attributes

wosh::bundles::PlayerMPDBundle Class Reference
[WOSH Bundles]

Audio player implementation based on MPD software. More...

#include <H:/WOSH/win32_vc2010/src/bundles/PlayerMPD/PlayerMPDBundle.h>

List of all members.

Public Member Functions

 PlayerMPDBundle (const std::string &name="", const std::string &device_name="default")
 Empty constructor, init bundle and vars, Properties and Methods. May Assign device name.
virtual ~PlayerMPDBundle ()
 Empty destructor, may (synch) stop bundle and internal threads when still running.
void busMessage (const Message &message, const Bus *source)
 Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.
PlayerAudio Interface - Playback
WRESULT play (const std::string &file_url, int volume=-1, bool override_current=false)
 Play a resource.
WRESULT play (unsigned int index)
WRESULT play ()
 Play the current media.
WRESULT pause ()
 Pause the current media, keeping track of position. Continue calling play()
WRESULT stop ()
 Stop the current media.
WRESULT first ()
 Play the first element in the playlist.
WRESULT next ()
 Play the next element in the playlist.
WRESULT prev ()
 Play the previous element in the playlist.
WRESULT last ()
 Play the last element in the playlist.
WRESULT enqueue (const std::string &file_url)
WRESULT remove (unsigned int index)
WRESULT clear ()
 Clear the playlist. Won't necessary stop current playback.
PlayerAudio Interface - Setters
WRESULT setVolume (int newVolume)
 Set the volume of device.
WRESULT setVolumeOffset (int volume_span)
WRESULT setMute (bool on)
WRESULT setRepeat (short on)
WRESULT setRandom (short on)
WRESULT setCrossfade (int seconds)
WRESULT setPosition (float position_rate)
WRESULT setPositionOffset (float position_rate_offset)
WRESULT setPositionMs (int64 position_ms)
PlayerAudio Interface - Getters
bool isPlaying () const
long getPlayListIndex () const
long getPlayListLength () const
int getVolume () const
bool isMuted () const
int getCrossfade () const
short getRepeat () const
short getRandom () const
float getPosition () const
std::string getPositionStr () const
int64 getPositionMs () const
int64 getLengthMs () const
std::string getLengthStr () const
Player Events
void changed_PlayState (int state, PlayerAudio *source)
void changed_Volume (int volume, bool muted, PlayerAudio *source)
void changed_PlayOptions (int crossfade, short repeat, short random, PlayerAudio *source)
void changed_PlayItem (const wosh::entertainment::MediaTrack *track, PlayerAudio *source)
void changed_PlayList (const wosh::entertainment::MediaList *list, PlayerAudio *source)
void updated_Stats (const std::map< std::string, std::string > &fields, PlayerMPD *source)
void changed_Outputs (const VectorT< PlayerMpdOutput * > &final_outputs, VectorT< PlayerMpdOutput * > &outofdate_items, VectorT< PlayerMpdOutput * > &new_items, VectorT< PlayerMpdOutput * > &changed_items, PlayerMPD *source)
IPropertiesProviderListener interface
bool updatingProperty (bool &do_update, const Variant &value_proposed, Property &property_current, const PropertiesProvider *source)
Thread Events
void thread_event (Thread::THREAD_STATE thread_event, Thread *thread_source)

Protected Member Functions

void raiseEvent (MessageContent *fact)
 Raise a standard Device event (fact): Create Message and inject in BusDevices ("_Bus_Devices")

Protected Attributes

BusConnector BusDevices
 register myself & work as Device too
PlayerMPDplayerWorker
 real implementation
wosh::rmi::skeletons::PlayerAudio skeleton
 skeleton for PlayerAudio

Detailed Description

Audio player implementation based on MPD software.

wosh::bundles::PlayerMPDBundle (MPD) and some ALSA hacking enables a great and simple way to manage whole-house music:

http://www.musicpd.org

apt-get install mpc mpd

apt-get install libmpd-dev

0.13.2

Bug:
keep trying connecting
See also:
wosh::interfaces::entertainment::PlayerAudio
wosh::bundles:PlayerPhononBundle
Version:
0.8.527
Id:
PlayerMPDBundle.h 3775 2011-01-01 16:38:17Z alex
Author:
Alessandro Polo

Definition at line 163 of file PlayerMPDBundle.h.


Constructor & Destructor Documentation

wosh::bundles::PlayerMPDBundle::PlayerMPDBundle ( const std::string &  name = "",
const std::string &  device_name = "default" 
)

Empty constructor, init bundle and vars, Properties and Methods. May Assign device name.

Parameters:
name[in] optional name of the bundle
device_name[in] output device name, 'default' is the default output for gstreamer
See also:
setDeviceOutput()

Definition at line 79 of file PlayerMPDBundle.cpp.

References _METHOD_Retrieve, and wosh::LOG_DEBUG.

wosh::bundles::PlayerMPDBundle::~PlayerMPDBundle (  ) [virtual]

Empty destructor, may (synch) stop bundle and internal threads when still running.

Definition at line 136 of file PlayerMPDBundle.cpp.

References wosh::LOG_VERBOSE, and wosh::LOG_WARNING.


Member Function Documentation

void wosh::bundles::PlayerMPDBundle::busMessage ( const Message message,
const Bus source 
) [virtual]

Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.

Parameters:
[in]messagethe incoming message
[in]sourcethe source Bus of the incoming message
Warning:
The current thread is own and managed by the caller Bus. Heavy, dangerous or time expensive operations should be executed asynchronously and not inline!

Reimplemented from wosh::BundleGeneric.

Definition at line 203 of file PlayerMPDBundle.cpp.

References BusCore.

WRESULT wosh::bundles::PlayerMPDBundle::clear (  ) [virtual]

Clear the playlist. Won't necessary stop current playback.

Returns:
WRET_OK if playlist has been cleared. Check custom implementation error codes.

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 374 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::first (  ) [virtual]

Play the first element in the playlist.

Returns:
WRET_ERR_ILLEGAL_USE when playlist is empty/invalid; WRET_OK when playback is starting

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 375 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::last (  ) [virtual]

Play the last element in the playlist.

Returns:
WRET_ERR_ILLEGAL_USE when playlist is empty/invalid; WRET_OK when playback is starting

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 378 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::next (  ) [virtual]

Play the next element in the playlist.

Returns:
WRET_ERR_ILLEGAL_USE when playlist is empty/invalid; WRET_ERR_PARAM when out of index; WRET_OK when playback is starting

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 376 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::pause (  ) [virtual]

Pause the current media, keeping track of position. Continue calling play()

Returns:
See also:
play()

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 372 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::play (  ) [virtual]

Play the current media.

Returns:

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 371 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::play ( const std::string &  file_url,
int  volume = -1,
bool  override_current = false 
) [virtual]

Play a resource.

Parameters:
file_url[in] the URI of the resource to be played. Multiple protocols are supported:

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 397 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::prev (  ) [virtual]

Play the previous element in the playlist.

Returns:
WRET_ERR_ILLEGAL_USE when playlist is empty/invalid; WRET_ERR_PARAM when out of index; WRET_OK when playback is starting

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 377 of file PlayerMPDBundle.cpp.

void wosh::bundles::PlayerMPDBundle::raiseEvent ( MessageContent fact ) [protected]

Raise a standard Device event (fact): Create Message and inject in BusDevices ("_Bus_Devices")

Parameters:
fact[in] the fact (instance) to include in (event) Message, instance will be deleted by Bus

Definition at line 211 of file PlayerMPDBundle.cpp.

References wosh::Message::setDestinationBroadcast().

WRESULT wosh::bundles::PlayerMPDBundle::setVolume ( int  newVolume ) [virtual]

Set the volume of device.

Parameters:
[in]newVolumethe volume level expressed in range [0; 100]
Returns:

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 402 of file PlayerMPDBundle.cpp.

WRESULT wosh::bundles::PlayerMPDBundle::stop (  ) [virtual]

Stop the current media.

Returns:

Implements wosh::interfaces::entertainment::PlayerAudio.

Definition at line 373 of file PlayerMPDBundle.cpp.


Member Data Documentation

register myself & work as Device too

Definition at line 297 of file PlayerMPDBundle.h.

real implementation

Definition at line 298 of file PlayerMPDBundle.h.

skeleton for PlayerAudio

Definition at line 300 of file PlayerMPDBundle.h.


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

Generated on Tue Feb 8 2011 09:33:36 for WOSH system 0.8.888 [wolf] by Alessandro Polo, using DoxyGen 1.7.2 hosted by WOSH Framework