ngfd-plugin
sinkinterface.h
Go to the documentation of this file.
1/*
2 * ngfd - Non-graphic feedback daemon
3 *
4 * Copyright (C) 2010 Nokia Corporation.
5 * Contact: Xun Chen <xun.chen@nokia.com>
6 *
7 * This work is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This work is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this work; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef N_SINK_INTERFACE_H
23#define N_SINK_INTERFACE_H
24
26typedef struct _NSinkInterface NSinkInterface;
27
28#include <ngf/request.h>
29#include <ngf/core.h>
30
31#define N_SINK_INTERFACE_TYPE_AUDIO "audio"
32#define N_SINK_INTERFACE_TYPE_VIBRATOR "vibra"
33#define N_SINK_INTERFACE_TYPE_LEDS "leds"
34
36typedef struct _NSinkInterfaceDecl
37{
39 const char *name;
40
43 const char *type;
44
49 int (*initialize) (NSinkInterface *iface);
50
54 void (*shutdown) (NSinkInterface *iface);
55
61 int (*can_handle) (NSinkInterface *iface, NRequest *request);
62
68 int (*prepare) (NSinkInterface *iface, NRequest *request);
69
75 int (*play) (NSinkInterface *iface, NRequest *request);
76
82 int (*pause) (NSinkInterface *iface, NRequest *request);
83
89 void (*stop) (NSinkInterface *iface, NRequest *request);
91
96void n_sink_interface_set_userdata (NSinkInterface *iface, void *userdata);
97
103
109
115
121
127
133
139
146
153
154#endif /* N_SINK_INTERFACE_H */
struct _NCore NCore
Internal core structure.
Definition core.h:26
struct _NRequest NRequest
Internal request structure.
Definition request.h:26
struct _NSinkInterface NSinkInterface
Internal sinkinterface structure.
Definition sinkinterface.h:26
void n_sink_interface_resynchronize(NSinkInterface *iface, NRequest *request)
Request resynchronization of other sinks.
void n_sink_interface_set_userdata(NSinkInterface *iface, void *userdata)
Stores userdata for the sink interface.
void n_sink_interface_set_resync_on_master(NSinkInterface *iface, NRequest *request)
Report that sink will resync to other sinks resynchronize requests.
const char * n_sink_interface_get_type(NSinkInterface *iface)
Get interface type.
void n_sink_interface_fail(NSinkInterface *iface, NRequest *request)
Report sink has failed the request.
void n_sink_interface_complete(NSinkInterface *iface, NRequest *request)
Report sink has completed playback of request.
void * n_sink_interface_get_userdata(NSinkInterface *iface)
Returns userdata stored to the sink interface.
NCore * n_sink_interface_get_core(NSinkInterface *iface)
Get core to which interface is associated to.
const char * n_sink_interface_get_name(NSinkInterface *iface)
Get interface name.
void n_sink_interface_synchronize(NSinkInterface *iface, NRequest *request)
Report sink is synchronized and ready to start the playback.
struct _NSinkInterfaceDecl NSinkInterfaceDecl
Interface declaration structure.
Interface declaration structure.
Definition sinkinterface.h:37
int(* pause)(NSinkInterface *iface, NRequest *request)
Pause function.
Definition sinkinterface.h:82
void(* shutdown)(NSinkInterface *iface)
Shutdown function.
Definition sinkinterface.h:54
const char * name
Name of the interface.
Definition sinkinterface.h:39
int(* initialize)(NSinkInterface *iface)
Initialization function.
Definition sinkinterface.h:49
int(* can_handle)(NSinkInterface *iface, NRequest *request)
Can_handle function.
Definition sinkinterface.h:61
int(* prepare)(NSinkInterface *iface, NRequest *request)
Prepare function.
Definition sinkinterface.h:68
void(* stop)(NSinkInterface *iface, NRequest *request)
Stop function.
Definition sinkinterface.h:89
int(* play)(NSinkInterface *iface, NRequest *request)
Play function.
Definition sinkinterface.h:75
const char * type
Type of the interface.
Definition sinkinterface.h:43