Adds AmPlaylistSeparator, which can be used to get notified in the Session when the playlist reaches a certain entry.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@351 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent e5dfd2811f
commit 560742c100

@ -88,6 +88,43 @@ class AmPlaylist: public AmAudio
void close();
};
/**
* \brief event fired by the AmPlaylistSeparator
*/
class AmPlaylistSeparatorEvent :
public AmEvent {
public:
AmPlaylistSeparatorEvent(int id)
: AmEvent(id) { }
};
/**
* null-playlist element which notifies session that this position in
* playlist is reached. It fies a AmPlaylistSeparatorEvent if it is
* read or written.
*/
class AmPlaylistSeparator
: public AmAudio {
bool notified;
AmEventQueue* ev_q;
int id;
public:
AmPlaylistSeparator(AmEventQueue* q, int id)
: ev_q(q), notified(false), id(id) { }
~AmPlaylistSeparator() { }
int read(unsigned int user_ts, unsigned int size){
if (!notified)
ev_q->postEvent(new AmPlaylistSeparatorEvent(id));
notified = true;
return 0;
}
int write(unsigned int user_ts, unsigned int size){
return read(user_ts, size);
}
};
#endif

Loading…
Cancel
Save