Public Member Functions | Protected Attributes

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

Audio player implementation based on Qt Phonon library, multiplatform. More...

#include <H:/WOSH/win32_vc2010/src/bundles/PlayerPhonon/PlayerPhononBundle.h>

List of all members.

Public Member Functions

 PlayerPhononBundle (const std::string &name="", const std::string &device_name="default")
 Empty constructor, init bundle and vars, Properties and Methods. May Assign device name.
virtual ~PlayerPhononBundle ()
 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
virtual WRESULT play (const std::string &file_url, int volume=-1, bool override_current=false)
 Play a resource.
virtual WRESULT play (unsigned int index)
virtual WRESULT play ()
 Play the current media.
virtual WRESULT pause ()
 Pause the current media, keeping track of position. Continue calling play()
virtual WRESULT stop ()
 Stop the current media.
virtual WRESULT enqueue (const std::string &file_url)
virtual WRESULT remove (unsigned int index)
virtual WRESULT clear ()
 Clear the playlist. Won't necessary stop current playback.
virtual WRESULT first ()
 Play the first element in the playlist.
virtual WRESULT next ()
 Play the next element in the playlist.
virtual WRESULT prev ()
 Play the previous element in the playlist.
virtual WRESULT last ()
 Play the last element in the playlist.
PlayerAudio Interface - Setters
virtual WRESULT setVolume (int newVolume)
 Set the volume of device.
virtual WRESULT setVolumeOffset (int volume_span)
virtual WRESULT setMute (bool on)
virtual WRESULT setRandom (short value)
virtual WRESULT setRepeat (short value)
virtual WRESULT setCrossfade (int crossfade_seconds)
virtual WRESULT setPosition (float position_rate)
virtual WRESULT setPositionOffset (float position_rate_offset)
virtual WRESULT setPositionMs (int64 position_ms)
PlayerAudio Interface - Getters
virtual bool isPlaying () const
virtual long getPlayListIndex () const
virtual long getPlayListLength () const
virtual int getVolume () const
virtual bool isMuted () const
virtual int getCrossfade () const
virtual short getRepeat () const
virtual short getRandom () const
virtual float getPosition () const
virtual std::string getPositionStr () const
virtual int64 getPositionMs () const
virtual int64 getLengthMs () const
virtual std::string getLengthStr () const
Player Events
void changed_PlayState (int volume, PlayerPhonon *source)
 Raised when play-state has changed.
void changed_Volume (int volume, bool muted, PlayerPhonon *source)
 Raised when play-state has changed.
void changed_PlayList (const MediaList *list, PlayerPhonon *source)
 Raised when playlist has changed.
void changed_PlayItem (const MediaTrack *track, PlayerPhonon *source)
 Raised when current playing file has changed.
Thread Events
void thread_event (Thread::THREAD_STATE thread_event, Thread *thread_source)

Protected Member Functions

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

Protected Attributes

BusConnector BusDevices
 register myself & work as Device too
PlayerPhononplayerWorker
 real implementation

Detailed Description

Audio player implementation based on Qt Phonon library, multiplatform.

Todo:
[..] DEVICEOUTPUT, PLAYLIST and VOLUME, ALSA STUFF
See also:
wosh::interfaces::entertainment::PlayerAudio
wosh::bundles::PlayerGStreamerBundle
Version:
0.8.384
Id:
PlayerPhononBundle.h 3775 2011-01-01 16:38:17Z alex
Author:
Alessandro Polo
Date:
Released on 2009-06-04

Definition at line 60 of file PlayerPhononBundle.h.


Constructor & Destructor Documentation

wosh::bundles::PlayerPhononBundle::PlayerPhononBundle ( 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 QT phonon

Definition at line 58 of file PlayerPhononBundle.cpp.

References wosh::LOG_DEBUG.

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

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

Definition at line 82 of file PlayerPhononBundle.cpp.

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


Member Function Documentation

void wosh::bundles::PlayerPhononBundle::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 176 of file PlayerPhononBundle.cpp.

References BusCore.

void wosh::bundles::PlayerPhononBundle::changed_PlayItem ( const MediaTrack track,
PlayerPhonon source 
) [virtual]

Raised when current playing file has changed.

Parameters:
[in]trackthe media track being played (uri) of the media
[in]sourcethe source (instance) of the event

Implements IPlayerPhononListener.

Definition at line 257 of file PlayerPhononBundle.cpp.

References wosh::ResourcePath::getPathFull().

void wosh::bundles::PlayerPhononBundle::changed_PlayList ( const MediaList list,
PlayerPhonon source 
) [virtual]

Raised when playlist has changed.

Parameters:
[in]listthe media track being played (uri) of the media
[in]sourcethe source (instance) of the event

Implements IPlayerPhononListener.

Definition at line 253 of file PlayerPhononBundle.cpp.

void wosh::bundles::PlayerPhononBundle::changed_PlayState ( int  state,
PlayerPhonon source 
) [virtual]

Raised when play-state has changed.

Parameters:
[in]stateplaying status
[in]sourcethe source (instance) of the event

Implements IPlayerPhononListener.

Definition at line 234 of file PlayerPhononBundle.cpp.

void wosh::bundles::PlayerPhononBundle::changed_Volume ( int  volume,
bool  muted,
PlayerPhonon source 
) [virtual]

Raised when play-state has changed.

Parameters:
[in]volumevolume in range [0:100]
[in]mutedmuted flag
[in]sourcesource (instance) of the event

Implements IPlayerPhononListener.

Definition at line 244 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 279 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 280 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 283 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 281 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 277 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 299 of file PlayerPhononBundle.cpp.

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

Play the current media.

Returns:

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

Definition at line 276 of file PlayerPhononBundle.cpp.

WRESULT wosh::bundles::PlayerPhononBundle::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 282 of file PlayerPhononBundle.cpp.

void wosh::bundles::PlayerPhononBundle::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 223 of file PlayerPhononBundle.cpp.

References wosh::Message::setDestinationBroadcast().

WRESULT wosh::bundles::PlayerPhononBundle::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 305 of file PlayerPhononBundle.cpp.

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

Stop the current media.

Returns:

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

Definition at line 278 of file PlayerPhononBundle.cpp.


Member Data Documentation

register myself & work as Device too

Definition at line 196 of file PlayerPhononBundle.h.

real implementation

Definition at line 197 of file PlayerPhononBundle.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