ngfd-plugin: /build/ngfd/src/ngfd-1.4.1/src/include/ngf/sinkinterface.h Source File

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
26 typedef 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
36 typedef 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);
90} NSinkInterfaceDecl;
91
96 void n_sink_interface_set_userdata (NSinkInterface *iface, void *userdata);
97
102 void* n_sink_interface_get_userdata (NSinkInterface *iface);
103
108 NCore* n_sink_interface_get_core (NSinkInterface *iface);
109
114 const char* n_sink_interface_get_name (NSinkInterface *iface);
115
120 const char* n_sink_interface_get_type (NSinkInterface *iface);
121
126 void n_sink_interface_set_resync_on_master (NSinkInterface *iface, NRequest *request);
127
132 void n_sink_interface_resynchronize (NSinkInterface *iface, NRequest *request);
133
138 void n_sink_interface_synchronize (NSinkInterface *iface, NRequest *request);
139
145 void n_sink_interface_complete (NSinkInterface *iface, NRequest *request);
146
152 void n_sink_interface_fail (NSinkInterface *iface, NRequest *request);
153
154#endif /* N_SINK_INTERFACE_H */
core.h
NCore
struct _NCore NCore
Internal core structure.
Definition core.h:26
request.h
NRequest
struct _NRequest NRequest
Internal request structure.
Definition request.h:26
NSinkInterface
struct _NSinkInterface NSinkInterface
Internal sinkinterface structure.
Definition sinkinterface.h:26
n_sink_interface_resynchronize
void n_sink_interface_resynchronize(NSinkInterface *iface, NRequest *request)
Request resynchronization of other sinks.
n_sink_interface_set_userdata
void n_sink_interface_set_userdata(NSinkInterface *iface, void *userdata)
Stores userdata for the sink interface.
n_sink_interface_set_resync_on_master
void n_sink_interface_set_resync_on_master(NSinkInterface *iface, NRequest *request)
Report that sink will resync to other sinks resynchronize requests.
n_sink_interface_get_type
const char * n_sink_interface_get_type(NSinkInterface *iface)
Get interface type.
n_sink_interface_fail
void n_sink_interface_fail(NSinkInterface *iface, NRequest *request)
Report sink has failed the request.
n_sink_interface_complete
void n_sink_interface_complete(NSinkInterface *iface, NRequest *request)
Report sink has completed playback of request.
n_sink_interface_get_userdata
void * n_sink_interface_get_userdata(NSinkInterface *iface)
Returns userdata stored to the sink interface.
n_sink_interface_get_core
NCore * n_sink_interface_get_core(NSinkInterface *iface)
Get core to which interface is associated to.
n_sink_interface_get_name
const char * n_sink_interface_get_name(NSinkInterface *iface)
Get interface name.
n_sink_interface_synchronize
void n_sink_interface_synchronize(NSinkInterface *iface, NRequest *request)
Report sink is synchronized and ready to start the playback.
NSinkInterfaceDecl
struct _NSinkInterfaceDecl NSinkInterfaceDecl
Interface declaration structure.
_NSinkInterfaceDecl
Interface declaration structure.
Definition sinkinterface.h:37
_NSinkInterfaceDecl::pause
int(* pause)(NSinkInterface *iface, NRequest *request)
Pause function.
Definition sinkinterface.h:82
_NSinkInterfaceDecl::shutdown
void(* shutdown)(NSinkInterface *iface)
Shutdown function.
Definition sinkinterface.h:54
_NSinkInterfaceDecl::name
const char * name
Name of the interface.
Definition sinkinterface.h:39
_NSinkInterfaceDecl::initialize
int(* initialize)(NSinkInterface *iface)
Initialization function.
Definition sinkinterface.h:49
_NSinkInterfaceDecl::can_handle
int(* can_handle)(NSinkInterface *iface, NRequest *request)
Can_handle function.
Definition sinkinterface.h:61
_NSinkInterfaceDecl::prepare
int(* prepare)(NSinkInterface *iface, NRequest *request)
Prepare function.
Definition sinkinterface.h:68
_NSinkInterfaceDecl::stop
void(* stop)(NSinkInterface *iface, NRequest *request)
Stop function.
Definition sinkinterface.h:89
_NSinkInterfaceDecl::play
int(* play)(NSinkInterface *iface, NRequest *request)
Play function.
Definition sinkinterface.h:75
_NSinkInterfaceDecl::type
const char * type
Type of the interface.
Definition sinkinterface.h:43