Guiliani  Version 2.6 revision 7293 (documentation build 12)
SndWrap.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef SNDWRAP__H_
11#define SNDWRAP__H_
12
13#include "eC_String.h"
14#include "eC_Types.h"
15#include "GUISoundResource.h"
16
17#include "GUIComponentManager.h"
18
20#define GETSND CGUIComponentManager::GetInstance().GetSndWrap()
21
22// define flags
23#define PLAY_SYNC 1
24#define PLAY_ASYNC 2
25#define PLAY_WAIT 4
26#define PLAY_DISCARD 8
27#define PLAY_IMMEDIATELY 16
28
29
31
48{
49 /* the resourcemanager is the only class which may access the loadsnd and
50 unloadsnd-methods of the sndwrapped directly. therefore it is granted
51 friend-access.
52 */
53 friend class CGUIResourceManager;
54 friend class CGUIComponentManager;
55
56public:
58 static void DeleteInstance();
59
65 virtual eC_UByte GetVolume() = 0;
66
71 virtual eC_Bool PauseSnd(const SoundResource_t &eID) = 0;
72
88 virtual eC_Bool PlaySnd(const SoundResource_t &eID, eC_UInt uiFlags = PLAY_ASYNC) = 0;
89
94 virtual eC_Bool ResumeSnd(const SoundResource_t &eID) = 0;
95
102 virtual eC_Bool SetVolume(eC_UByte ubVolume) = 0;
103
108 virtual eC_Bool StopSnd(const SoundResource_t &eID) = 0;
109
113 inline virtual eC_UInt GetNOFSounds() {return m_uiNOFSounds;}
114
115protected:
120 CSndWrap(const CSndWrap& kSource);
121
127 CSndWrap& operator=(const CSndWrap& kSource);
128
131
133 virtual ~CSndWrap();
134
140 virtual eC_Bool SetNOFSounds(eC_UInt uiNOFSounds);
141
147 virtual void LoadSnd(const eC_String& kPath, const SoundResource_t &eID, eC_UInt uiDeviceID = 0) = 0;
148
152 virtual void UnloadSnd(const SoundResource_t &eID) = 0;
153
154protected:
157};
158#endif
Helper Macros in Guiliani
SoundResource_t
List of sound resource ids.
Definition: GUISoundResource.h:48
central component-manager
Definition: GUIComponentManager.h:62
Manages resource ID mappings for fonts, images, sounds, etc.
Definition: GUIResourceManager.h:111
This is the Sound-Wrapper base class.
Definition: SndWrap.h:48
CSndWrap & operator=(const CSndWrap &kSource)
eC_UInt m_uiNOFSounds
total number of sound-objects.
Definition: SndWrap.h:156
virtual eC_Bool PlaySnd(const SoundResource_t &eID, eC_UInt uiFlags=2)=0
virtual ~CSndWrap()
Destructor.
virtual eC_Bool ResumeSnd(const SoundResource_t &eID)=0
virtual void LoadSnd(const eC_String &kPath, const SoundResource_t &eID, eC_UInt uiDeviceID=0)=0
virtual eC_Bool SetNOFSounds(eC_UInt uiNOFSounds)
virtual eC_Bool StopSnd(const SoundResource_t &eID)=0
virtual eC_Bool SetVolume(eC_UByte ubVolume)=0
CSndWrap()
Constructor.
virtual void UnloadSnd(const SoundResource_t &eID)=0
virtual eC_UByte GetVolume()=0
CSndWrap(const CSndWrap &kSource)
static void DeleteInstance()
Deletes the Sound-Wrapper instance.
virtual eC_UInt GetNOFSounds()
Definition: SndWrap.h:113
virtual eC_Bool PauseSnd(const SoundResource_t &eID)=0