Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUISoundResource.h
Go to the documentation of this file.
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 GUI_SOUND_RESOURCE__H_
11#define GUI_SOUND_RESOURCE__H_
12#include "eC_Types.h"
13#include <limits.h>
14
16//
17// DO NOT EDIT THIS FILE!!! Add your own IDS within UserXXXResource.h files!
18// DO NOT EDIT THIS FILE!!! Add your own IDS within UserXXXResource.h files!
19// DO NOT EDIT THIS FILE!!! Add your own IDS within UserXXXResource.h files!
20//
21
22// -----------------------------------------------------------------------------------------
24// Attention: If a sound ID is added, please also change the number of SND_START_TAG,
25// so that DUMMY_SOUND is always 0, which should guarantee that the user
26// ID numbers will not be affected when adding Guiliani IDs.
27// If you add a new Guiliani control you should add it in front of the enumeration
28// so that the other Guiliani IDs will not be shifted, i.e. add the
29// new Guiliani ID right after SND_START_TAG.
30
31//Add Guiliani-SoundResources here:
32#define SOUND_TABLE \
33ENTRY(DUMMY_SOUND, "DUMMY_SOUND", true)
34
35// Calculate the value for the START_TAG used in th enum definition below.
36#define ENTRY_ENUM(a) -1
37#define ENTRY(snd, snd_filename, snd_permanent) -1
39#undef ENTRY
40#undef ENTRY_ENUM
41
42#ifndef GUILIANI_GUILIANILIB
43#include "UserSoundResource.h"
44#endif
45
48{
49 SND_START_TAG = ciCalculatedSndStartTag,
50#define ENTRY_ENUM(a) a,
51#define ENTRY(snd, snd_filename, snd_permanent) snd,
53#ifndef GUILIANI_GUILIANILIB
54 USER_SOUND_TABLE
55#endif
56#undef ENTRY
57#undef ENTRY_ENUM
58 NOF_SOUNDRESOURCES,
59 GUILIANI_INTERNAL_SND = INT_MAX // Do not touch this. Required for ensuring consistent enum type size across libraries.
60};
61
62// Check if the DUMMY value is always 0. If not compile error!
63typedef int static_assert_something[(DUMMY_SOUND == 0) ? 1 : -1];
64
65
67#define MAP_SNDID_TO_ARRAY(SND_ID) static_cast<eC_UInt>(SND_ID-SND_START_TAG-1)
69#define UNMAP_SNDENTRY_TO_ARRAY(SND_ENTRY) static_cast<SoundResource_t>(SND_ENTRY+SND_START_TAG+1)
70// Amount of resources.
71extern const eC_UInt cuiNOFSoundResources;
72
73#endif
#define SOUND_TABLE
sound resources
Definition: GUISoundResource.h:32
int static_assert_something[(DUMMY_SOUND==0) ? 1 :-1]
Will throw compile error negative subscript if DUMMY_SOUND is NOT 0!
Definition: GUISoundResource.h:63
const int ciCalculatedSndStartTag
preprocessor generates for all entries of SOUND_TABLE: -1 -1 -1..., resulting in a mathematical expre...
Definition: GUISoundResource.h:38
const eC_UInt cuiNOFSoundResources
Used to contain the highest index cuiNOFXXXClasses = MAP_PROPID_TO_ARRAY(NOF_XXXCLASSES);.
SoundResource_t
List of sound resource ids.
Definition: GUISoundResource.h:48