wmSMPmon: Solaris support
[dockapps.git] / AlsaMixer.app / AMixer / AMixer.h
blob16c29608f8e32e2012cf68473cf714b25b1a0ccc
1 // AMixer.h, Petr Hlavka, 2004
3 #ifndef AMIXER_H
4 #define AMIXER_H
6 #include "AItem.h"
8 #include <alsa/asoundlib.h>
10 #define MIXER_ITEMS 3
13 class AItem;
15 class AMixer {
16 private:
17 snd_mixer_t *mixerHandle;
18 AItem *mixerItems[MIXER_ITEMS];
19 char *cardName;
21 void error(const char *errorString, int errorCode);
23 public:
24 AMixer(const char *card); // ctor
25 ~AMixer(); // dtor
27 bool opened();
28 void handleEvents();
29 AItem *attachItem(unsigned int itemNumber, const char *itemName);
30 bool itemOK(unsigned int itemNumber);
31 int itemGetVolume(unsigned int itemNumber);
32 void itemSetVolume(unsigned int itemNumber, unsigned int volume);
33 int itemIsMuted(unsigned int itemNumber);
34 void itemToggleMute(unsigned int itemNumber);
35 void reInit();
37 static bool mixerElemsChanged();
38 static bool mixerChanged();
39 static char* convertIDToCard(const char* cardId);
42 #endif