Guiliani  Version 2.5 revision 7293 (documentation build 13)
SndWrapALSA.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 __SNDWRAPALSA_H__
11#define __SNDWRAPALSA_H__
12
13#include "SndWrapWAVBase.h"
14
15#define ALSA_PCM_NEW_HW_PARAMS_API
16#include <alsa/asoundlib.h>
17
19
25// @guiliani_doxygen limitations CSndWrapALSA
29// @endguiliani_doxygen
35{
36public:
42 static void CreateInstance(const eC_UInt uiNOFPeriods = 2, const eC_UInt uiStackSize = 100, const ThreadPriority_t kThreadPriority = GUITHREAD_PRIORITY_NOT_SET);
43 eC_Bool SetVolume(eC_UByte ubVolume = 0xff);
44 eC_UByte GetVolume();
45
46protected:
52 CSndWrapALSA(const eC_UInt uiNOFPeriods, const eC_UInt uiStackSize, const ThreadPriority_t kThreadPriority);
53
54private:
56
60 class CPlayThread: public CSndWrapWAVBase::CPlayThreadBase
61 {
62 public:
68 CPlayThread(const eC_UInt uiNOFPeriods, const eC_UInt uiStackSize, const ThreadPriority_t kThreadPriority);
69
71 ~CPlayThread();
72
76 void Play(const CSndWrapWAVBase::CSound& kSound);
77
79 void Pause();
80
82 void Resume();
83
85 void Stop();
86
87 private:
91 void Execute(void *pArg);
92
93 eC_Bool m_bPlay;
94 eC_Bool m_bPause;
95 snd_pcm_t* m_pPCMHandle;
96 eC_UInt m_uiNOFPeriods;
97 };
98
105 eC_Bool PrepareMixerElement(snd_mixer_t* pkHandle, snd_mixer_elem_t*& pkMixerElement, long& lMin, long& lMax);
106};
107#endif //#ifndef __SNDWRAPALSA_H__
ALSA implementation of the Sound Wrapper.
Definition: SndWrapALSA.h:35
eC_UByte GetVolume()
static void CreateInstance(const eC_UInt uiNOFPeriods=2, const eC_UInt uiStackSize=100, const ThreadPriority_t kThreadPriority=GUITHREAD_PRIORITY_NOT_SET)
eC_Bool SetVolume(eC_UByte ubVolume=0xff)
CSndWrapALSA(const eC_UInt uiNOFPeriods, const eC_UInt uiStackSize, const ThreadPriority_t kThreadPriority)
This class handles the playing of sound files.
Definition: SndWrapWAVBase.h:124
This class represents a sound file with filepointer, WAVE header and Sound Resource ID.
Definition: SndWrapWAVBase.h:52
This class is the base implementation for playing WAV files using low-level interfaces.
Definition: SndWrapWAVBase.h:24