summaryrefslogtreecommitdiff
path: root/src/lib/emix.c
blob: 2b6e518acf372f114a15eacba0ba9c992f8173c1 (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#include "emix.h"

#include <common.h>

typedef struct Context {
   Eina_List *backends_available;
   Emix_Backend *loaded;
} Context;

static int _init_count = 0;
static Context *ctx = NULL;

int EMIX_SINK_ADDED = 0;
int EMIX_SINK_CHANGED = 0;
int EMIX_SINK_DEFAULT = 0;
int EMIX_SINK_REMOVED = 0;
int EMIX_SINK_INPUT_ADDED = 0;
int EMIX_SINK_INPUT_CHANGED = 0;
int EMIX_SINK_INPUT_REMOVED = 0;
int EMIX_SOURCE_ADDED = 0;
int EMIX_SOURCE_CHANGED = 0;
int EMIX_SOURCE_REMOVED = 0;
int EMIX_SOURCE_INPUT_ADDED = 0;
int EMIX_SOURCE_INPUT_REMOVED = 0;
int EMIX_DISCONNECTED = 0;

void
emix_init(void)
{
   if (_init_count > 0)
      goto end;

   ctx = calloc(1, sizeof(Context));
   if (!ctx)
     {
        ERR("Could not create Epulse Context");
        return 0;
     }

   EMIX_DISCONNECTED = ecore_event_type_new();
   EMIX_SINK_ADDED = ecore_event_type_new();
   EMIX_SINK_CHANGED = ecore_event_type_new();
   EMIX_SINK_DEFAULT = ecore_event_type_new();
   EMIX_SINK_REMOVED = ecore_event_type_new();
   EMIX_SINK_INPUT_ADDED = ecore_event_type_new();
   EMIX_SINK_INPUT_CHANGED = ecore_event_type_new();
   EMIX_SINK_INPUT_REMOVED = ecore_event_type_new();
   EMIX_SOURCE_ADDED = ecore_event_type_new();
   EMIX_SOURCE_CHANGED = ecore_event_type_new();
   EMIX_SOURCE_REMOVED = ecore_event_type_new();
   EMIX_SOURCE_INPUT_ADDED = ecore_event_type_new();
   EMIX_SOURCE_INPUT_REMOVED = ecore_event_type_new();
  /* init(); */

 end:
   _init_count++;
   return _init_count;
}

void
emix_shutdown()
{
   if (_init_count == 0)
      return;

   _init_count--;
   if (_init_count > 0)
      return;

   free(ctx);
   ctx = NULL;
   /* shutdown(); */
}

const Emix_Volume *
emix_volume_get(Emix_Sink* sink)
{
   return NULL;
}

void
emix_volume_set(Emix_Sink* sink, Emix_Volume* volume)
{
}

Eina_Bool
emix_mute_get(Emix_Sink *sink)
{
   return EINA_TRUE;
}

void
emix_mute_set(Emix_Sink *sink, Eina_Bool mute)
{
}

Emix_Sink*
emix_sink_default_get(void)
{
   return NULL; //TODO load this from eet
}

void
emix_sink_default_set(Emix_Sink* sink)
{
   return; //TODO save this in eet
}

Emix_Source*
emix_source_default_get(void)
{
   return NULL; //TODO load this from eet
}

void
emix_source_default_set(Emix_Source* source)
{
   return; //TODO save this in eet
}

Eina_Bool
emix_change_sink_support(void)
{
   return EINA_FALSE;
}

void
emix_change_sink(Emix_Playback *playback, Emix_Sink *sink)
{
   /* ebackend_change_sink(playback, sink); */
}

Eina_Bool
emix_change_source_support(void)
{
   /* return ebackend_change_source_support(); */
   return EINA_FALSE;
}

void
emix_change_source(Emix_Playback *playback, Emix_Source *source)
{
   /* ebackend_change_source(playback, source); */
}