summaryrefslogtreecommitdiff
path: root/src/lib/emix.h
blob: 0a8d1ee2a2518d175370152676d859f19d90c820 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef EMIX_H
#define EMIX_H

#include <Eina.h>

EAPI extern int EMIX_DISCONNECTED;
EAPI extern int EMIX_SINK_ADDED;
EAPI extern int EMIX_SINK_CHANGED;
EAPI extern int EMIX_SINK_DEFAULT;
EAPI extern int EMIX_SINK_REMOVED;
EAPI extern int EMIX_SINK_INPUT_ADDED;
EAPI extern int EMIX_SINK_INPUT_CHANGED;
EAPI extern int EMIX_SINK_INPUT_REMOVED;
EAPI extern int EMIX_SOURCE_ADDED;
EAPI extern int EMIX_SOURCE_CHANGED;
EAPI extern int EMIX_SOURCE_REMOVED;
EAPI extern int EMIX_SOURCE_INPUT_ADDED;
EAPI extern int EMIX_SOURCE_INPUT_REMOVED;

typedef struct _Emix_Volume {
   int channel_count;
   // the index of the field is the id of the channel, the value the volume
   int* volumes;
} Emix_Volume;

typedef struct _Emix_Sink {
   const char *name;
   void *b_data;
} Emix_Sink;

typedef struct _Emix_Playback {
   const char *name;
   void *b_data;
} Emix_Playback;

typedef struct _Emix_Source {
   void *b_data;
   const char *name;
} Emix_Source;

typedef struct _Emix_Source_Input {
   const char *name;
   void *b_data;
} Emix_Source_Input;


typedef struct _Emix_Backend {
   void                  (*ebackend_init)(void);
   void                  (*ebackend_shutdown)(void);

   const Emix_Volume*    (*ebackend_volume_get)(Emix_Sink* sink);
   void                  (*ebackend_volume_set)(Emix_Sink* sink,
                                                   Emix_Volume volume);
   Eina_Bool             (*ebackend_mute_get)(Emix_Sink *sink);
   void                  (*ebackend_mute_set)(Emix_Sink *sink, Eina_Bool bool);

   Eina_Bool             (*ebackend_sink_default_support)(void);
   const Emix_Sink*      (*ebackend_sink_default_get)(void);
   void                  (*ebackend_sink_default_set)(Emix_Sink* sink);

   Eina_Bool             (*ebackend_source_default_support)(void);
   void                  (*ebackend_source_default_set)(Emix_Source* source);
   Eina_Bool             (*ebackend_change_sink_support)(void);
   void                  (*ebackend_change_sink)(Emix_Playback *playback,
                                                    Emix_Sink *sink);

   Eina_Bool             (*ebackend_change_source_support)(void);
   void                  (*ebackend_change_source)(Emix_Playback *playback,
                                                      Emix_Source *source);
} Emix_Backend;

EAPI void                emix_init(void);
EAPI void                emix_shutdown(void);

EAPI const Emix_Volume*  emix_volume_get(Emix_Sink* sink);
EAPI void                emix_volume_set(Emix_Sink* sink, Emix_Volume* volume);
EAPI Eina_Bool           emix_mute_get(Emix_Sink *sink);
EAPI void                emix_mute_set(Emix_Sink *sink, Eina_Bool);

EAPI Eina_Bool           emix_sink_default_support(void);
EAPI Emix_Sink*          emix_sink_default_get(void);
EAPI void                emix_sink_default_set(Emix_Sink* sink);

EAPI Eina_Bool           emix_source_default_support(void);
EAPI Emix_Source*        emix_source_default_get(void);
EAPI void                emix_source_default_set(Emix_Source* source);

EAPI Eina_Bool           emix_change_sink_support(void);
EAPI void                emix_change_sink(Emix_Playback *playback,
                                             Emix_Sink *sink);

EAPI Eina_Bool           emix_change_source_support(void);
EAPI void                emix_change_source(Emix_Playback *playback,
                                               Emix_Source *source);

#endif  /* EMIX_H */