057428d3bbb8709fa59c91523538da4e1674406e
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / tests / old / testsuite / alsa / sinesrc.h
1 /*
2  * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
3  *
4  * sinesrc.h: Header file for sinesrc.c
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef __SINESRC_H__
22 #define __SINESRC_H__
23
24
25 #include <gst/gst.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30   
31
32 #define TYPE_SINESRC \
33   (sinesrc_get_type())
34 #define SINESRC(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST((obj),TYPE_SINESRC,SineSrc))
36 #define SINESRC_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST((klass),TYPE_SINESRC,SineSrcClass))
38 #define IS_SINESRC(obj) \
39   (G_TYPE_CHECK_INSTANCE_TYPE((obj),TYPE_SINESRC))
40 #define IS_SINESRC_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_TYPE((klass),TYPE_SINESRC))
42
43 typedef struct _SineSrc SineSrc;
44 typedef struct _SineSrcClass SineSrcClass;
45
46 typedef void (*PreGetFunc) (SineSrc *src);
47
48 typedef enum {
49   SINE_SRC_INT,
50   SINE_SRC_FLOAT
51 } SineSrcAudio;
52
53 struct _SineSrc {
54   GstElement element;
55
56   /* pads */
57   GstPad *src;
58
59   /* audio parameters */
60   SineSrcAudio type;
61   gint width; /* int + float */
62   gint depth; /* int */
63   gboolean sign; /* int */
64   gint endianness; /* int */
65   
66   gint rate;
67   gint channels; /* interleaved */
68   
69   gboolean newcaps;
70   
71   /* freaky stuff for testing */
72   PreGetFunc pre_get_func;
73 };
74
75 struct _SineSrcClass {
76   GstElementClass parent_class;
77 };
78
79 GType           sinesrc_get_type                (void);
80 GstElement *    sinesrc_new                     (void);
81
82 void            sinesrc_set_pre_get_func        (SineSrc *src, PreGetFunc func);
83
84 #ifdef __cplusplus
85 }
86 #endif /* __cplusplus */
87
88
89 #endif /* __GST_SINESRC_H__ */