summaryrefslogtreecommitdiff
path: root/soundman.h
blob: 320ac39ddb5da06358597b9fee62c23f95f2a9b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * sndctl  -  a plugin for the Video Disk Recorder
 *        file: soundman.h
 * description: header file for soundman.c
 *
 *      author: Thomas Hildebrandt <toxym@web.de>
 *
 * inspired by and reengineered from 'avolctl'
 * thanks to Martin Prochnow <nordlichtl@martins-kabuff.de>
 */

#ifndef SNDCTL_SOUNDMAN_H
#define SNDCTL_SOUNDMAN_H

#include "alsa.h"
#include "sndctl.h"
#include "soundset.h"

/*
 * cSoundMan
 * sound manager class definition
 */
class cSoundMan {
  private:
    string                  activeSoundSetID;
    time_t                  lastSet;
    bool                    lastWasUp;
    cMixer                 *mixer;
    cPluginSndctl          *plugin;
    bool                    soundflash;
    map<string,cSoundSet*>  soundsets;
    int                     volume;      // this is the VDR volume, 0..255
    int                     volumeCounter;

    void                    SoundFlash( void );

  public:
    cSoundMan( cPluginSndctl* );
    ~cSoundMan();

    void                    AudioTrack( const char* );
    string                  CreateSoundSet( void );
    string                  DefaultSoundSetID( string );
    bool                    DeleteSoundSet( string );
    string                  GetCurrentSoundSetID( void );
    cSoundSet              *GetSoundSet( string, bool = true );
    map<string,cSoundSet*> *GetSoundSets( void );
    int                     GetVolume( void );
    string                  SetSoundSet( string );
    int                     SetVolume( int = -1 );
    bool                    Store( cPluginSndctl* );
};

#endif //SNDCTL_SOUNDMAN_H