expand tabs
[platform/upstream/gstreamer.git] / ext / cdparanoia / gstcdparanoia.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __CDPARANOIA_H__
22 #define __CDPARANOIA_H__
23
24
25 #include <glib.h>
26 #include <gst/gst.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 #define size16 gint16
33 #define size32 gint32
34
35 #ifdef CDPARANOIA_HEADERS_IN_DIR
36   #include <cdda/cdda_interface.h>
37   #include <cdda/cdda_paranoia.h>
38 #else
39   #include <cdda_interface.h>
40   #include <cdda_paranoia.h>
41 #endif
42   
43
44
45 /*#define CDPARANOIA_BASEOFFSET 0xf1d2 */
46 #define CDPARANOIA_BASEOFFSET 0x0
47
48 #define GST_TYPE_CDPARANOIA \
49   (cdparanoia_get_type())
50 #define CDPARANOIA(obj) \
51   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CDPARANOIA,CDParanoia))
52 #define CDPARANOIA_CLASS(klass) \
53   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CDPARANOIA,CDParanoiaClass))
54 #define GST_IS_CDPARANOIA(obj) \
55   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CDPARANOIA))
56 #define GST_IS_CDPARANOIA_CLASS(obj) \
57   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CDPARANOIA))
58
59 /* NOTE: per-element flags start with 16 for now */
60 typedef enum {
61   CDPARANOIA_OPEN               = (GST_ELEMENT_FLAG_LAST << 0),
62
63   CDPARANOIA_FLAG_LAST          = (GST_ELEMENT_FLAG_LAST << 2),
64 } CDParanoiaFlags;
65
66 typedef struct _CDParanoia CDParanoia;
67 typedef struct _CDParanoiaClass CDParanoiaClass;
68
69 struct _CDParanoia {
70   GstElement element;
71   /* pads */
72   GstPad *srcpad;
73
74   /* Index */
75   GstIndex *index;
76   int index_id;
77   
78   gchar *device;
79   gchar *generic_device;
80   gint default_sectors;
81   gint search_overlap;
82   gint endian;
83   gint read_speed;
84   gint toc_offset;
85   gboolean toc_bias;
86   gint never_skip;
87   gboolean abort_on_skip;
88   gint paranoia_mode;
89   gchar *uri; /* URI caching */
90   gint uri_track;
91   gint seek_request;
92
93   cdrom_drive *d;
94   cdrom_paranoia *p;
95
96   gint cur_sector;
97   gint segment_start_sector;
98   gint segment_end_sector;
99
100   gint first_sector;
101   gint last_sector;
102
103   /* hacks by Gordon Irving */
104   gchar discid[20];
105   gint64 offsets[MAXTRK];
106   gint64 total_seconds;
107
108   gint prev_sec;
109   gboolean discont_sent;
110 };
111
112 struct _CDParanoiaClass {
113   GstElementClass parent_class;
114
115   /* signal callbacks */
116   void (*smilie_change)         (CDParanoia *cdparanoia, gchar *smilie);
117   void (*transport_error)       (CDParanoia *cdparanoia, gint offset);
118   void (*uncorrected_error)     (CDParanoia *cdparanoia, gint offset);
119 };
120
121 GType cdparanoia_get_type(void);
122
123 #ifdef __cplusplus
124 }
125 #endif /* __cplusplus */
126
127
128 #endif /* __CDPARANOIA_H__ */