summaryrefslogtreecommitdiff
path: root/include/mm_ipc.h
blob: 0e9ae002cebbb0b7b75e73a33cce2acbddb9fc90 (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
/*
 * libmm-sound
 *
 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __MM_SOUND_IPC_H__
#define __MM_SOUND_IPC_H__

#include <stdio.h>
#include <unistd.h>

#define FILE_PATH 512

typedef enum {
    MM_IPC_SUCCESS,
    MM_IPC_WARNING,
    MM_IPC_ERROR,
    MM_IPC_PROCESS,
} mm_ipc_async_state;

typedef struct
{
	/* Recieve data */
	int msgid;
	int msgtype;
	int code;
	
	/* Send data */
	int keytone;
	int repeat;
	int tone;
	double volume;
	int memptr;
	int memsize;
	int sharedkey;
	char filename[FILE_PATH];

	/* Common data */
	int handle;
	void *callback;
	void *cbdata;
	int samplerate;
	int channels;
	int volume_table;
	int session_type;
	int priority;
	int handle_route;
} mmsound_ipc_t;

typedef struct
{
	long msg_type;
	mmsound_ipc_t sound_msg;
} mm_ipc_msg_t;

typedef void (*mm_ipc_callback_t)(int code, int size);

int MMSoundGetTime(char *position);
int MMIpcCreate(const int key);
int MMIpcDestroy(const int key);
int MMIpcSendMsg(const int key, mm_ipc_msg_t *msg);
int MMIpcRecvMsg(const int key, mm_ipc_msg_t *msg);

int MMIpcSendMsgAsync(const char *ipcname, mm_ipc_msg_t *msg, mm_ipc_callback_t callback);
int MMIpcRecvMsgAsync(const char *ipcname, mm_ipc_msg_t **msg, mm_ipc_callback_t callback);
int MMIpcRecvData(const char *ipcname, void *data, int *size);
int MMIpcSendDataAsync(const char *ipcname, void *data, int size, mm_ipc_callback_t callback);
int __mm_sound_lock(void);
int __mm_sound_unlock(void);

#endif  /* __MM_SOUND_IPC_H__ */