17 #ifndef __NUGU_PLAYSYNC_MANAGER_INTERFACE_H__
18 #define __NUGU_PLAYSYNC_MANAGER_INTERFACE_H__
27 namespace NuguClientKit {
83 virtual void onDataChanged(
const std::string& ps_id, std::pair<void*, void*> extra_datas);
89 virtual void onStackChanged(
const std::pair<std::string, std::string>& ps_ids);
98 using PlaySyncContainer = std::map<std::string, std::pair<PlaySyncState, void*>>;
99 using PlayStacks = std::map<std::string, PlaySyncContainer>;
136 virtual void startSync(
const std::string& ps_id,
const std::string& requester,
void* extra_data =
nullptr) = 0;
143 virtual void cancelSync(
const std::string& ps_id,
const std::string& requester) = 0;
150 virtual void releaseSync(
const std::string& ps_id,
const std::string& requester) = 0;
254 virtual void replacePlayStack(
const std::string& prev_ps_id,
const std::string& new_ps_id, std::pair<std::string, void*> extra_data = {}) = 0;
IPlaySyncManagerListener interface.
Definition: playsync_manager_interface.hh:66
virtual void onDataChanged(const std::string &ps_id, std::pair< void *, void * > extra_datas)
Receive callback when the extra data is changed.
virtual void onSyncState(const std::string &ps_id, PlaySyncState state, void *extra_data)
Receive callback when sync state is changed.
virtual void onStackChanged(const std::pair< std::string, std::string > &ps_ids)
Receive callback when the play stack is changed.
IPlaySyncManager interface.
Definition: playsync_manager_interface.hh:96
virtual void cancelSync(const std::string &ps_id, const std::string &requester)=0
Cancel sync specific capability agent which was synced.
virtual void clearHolding()=0
Clear timer for releasing sync.
virtual std::vector< std::string > getAllPlayStackItems()=0
Get all items which are stored in playstack.
virtual void restartHolding()=0
Restart timer for releasing sync.
virtual void setDefaultPlayStackHoldTime(unsigned int time)=0
Set default playstack hold time.
virtual void releaseSync(const std::string &ps_id, const std::string &requester)=0
Release sync all capability agents. (Actually, it release sync after context holding time....
virtual void continueRelease()=0
Continue pending release if exist.
virtual void releaseSyncUnconditionally(const std::string &ps_id="")=0
Release sync all capability agents unconditionally. If it's not specify the play service id,...
virtual void releaseSyncLater(const std::string &ps_id, const std::string &requester)=0
Release sync all capability agents after long time elapsed.
virtual void registerCapabilityForSync(const std::string &capability_name)=0
Register capability agent for sync (default:TTS, AudioPlayer, Display)
virtual bool hasNextPlayStack()=0
Check whether the next playstack to handle exists.
virtual void adjustPlayStackHoldTime(unsigned int time)=0
Adjust playstack hold time.
virtual void replacePlayStack(const std::string &prev_ps_id, const std::string &new_ps_id, std::pair< std::string, void * > extra_data={})=0
Replace current playstack to new one. (It only replace playstack not notifying related callbacks....
virtual void stopHolding()=0
Stop timer for releasing sync.
virtual void removeListener(const std::string &requester)=0
Remove IPlayStackManagerListener.
virtual void prepareSync(const std::string &ps_id, NuguDirective *ndir)=0
Prepare sync capability agents which are included in directive.
virtual bool isConditionToHandlePrevDialog(NuguDirective *prev_ndir, NuguDirective *cur_ndir)=0
Check whether the previous dialog has to be handled or not.
virtual void clear()=0
Clear all playstack info.
virtual void startSync(const std::string &ps_id, const std::string &requester, void *extra_data=nullptr)=0
Start sync specific capability agent which was prepared.
virtual void resetHolding()=0
Reset timer for releasing sync.
virtual void releaseSyncImmediately(const std::string &ps_id, const std::string &requester)=0
Release sync all capability agents immediately.
virtual bool hasActivity(const std::string &ps_id, PlayStackActivity activity)=0
Check whether the specific playstack activity exist.
virtual void postPoneRelease()=0
Postpone already started release if exist.
virtual void addListener(const std::string &requester, IPlaySyncManagerListener *listener)=0
Add IPlaySyncManagerListener.
struct _nugu_directive NuguDirective
Directive object.
Definition: nugu_directive.h:48
PlayStackActivity
PlayStack Activity Type.
Definition: playsync_manager_interface.hh:54
PlaySyncState
PlaySync State.
Definition: playsync_manager_interface.hh:43