Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / diskimage / plugins / cue / cue.h
blob070be3c18098462cb54d624e2804df1fd19e0960
1 /* Copyright 2007-2012 Fredrik Wikstrom. All rights reserved.
2 **
3 ** Redistribution and use in source and binary forms, with or without
4 ** modification, are permitted provided that the following conditions
5 ** are met:
6 **
7 ** 1. Redistributions of source code must retain the above copyright
8 ** notice, this list of conditions and the following disclaimer.
9 **
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
14 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
15 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 ** POSSIBILITY OF SUCH DAMAGE.
27 #ifndef CUE_H
28 #define CUE_H
30 #ifndef EXEC_TYPES_H
31 #include <exec/types.h>
32 #endif
34 #define MAX_ARGS 32
35 #define LINE_BUFFER_SIZE 512
37 typedef struct _AUDIO_STREAM {
38 ULONG length;
39 void (*close)(struct _AUDIO_STREAM *stream);
40 LONG (*read)(struct _AUDIO_STREAM *stream, APTR buffer, ULONG offset, ULONG length);
41 } AUDIO_STREAM;
43 #define AUDIO_close(stream) (stream)->close(stream)
44 #define AUDIO_read(stream,buffer,offset,length) (stream)->read(stream,buffer,offset,length)
46 struct CUEFile {
47 struct CUEFile *next;
48 LONG type;
49 LONG refcount;
50 union {
51 struct {
52 BPTR file;
53 QUAD file_size;
54 } bin;
55 struct {
56 AUDIO_STREAM *stream;
57 } aud;
58 } f;
61 enum {
62 FILE_BINARY,
63 FILE_MOTOROLA,
64 FILE_AIFF,
65 FILE_FLAC,
66 FILE_MP3,
67 FILE_VORBIS,
68 FILE_WAVE,
69 FILE_WAVPACK
72 struct CUETrack {
73 struct CUETrack *next;
74 UBYTE track_num;
75 UBYTE audio;
76 UWORD sector_size;
77 UBYTE sync_size;
78 UQUAD offset;
79 UQUAD length;
80 UQUAD sectors;
81 struct CUEFile *file;
82 LONG index0;
83 LONG index1;
84 LONG index2;
87 struct CUEImage {
88 struct CUEFile *files;
89 UBYTE first_track;
90 UBYTE last_track;
91 UBYTE num_tracks;
92 #ifndef USE_MPG123
93 UBYTE uses_mp3;
94 #endif
95 struct CUETrack *tracks;
96 ULONG block_size;
97 ULONG total_blocks;
98 #ifndef USE_MPG123
99 WORD *pcm[MPEGA_MAX_CHANNELS];
100 struct CUEFile *file_in_pcm;
101 LONG first_sample_in_pcm;
102 LONG samples_in_pcm;
103 struct Library *mpegabase;
104 #endif
105 UBYTE *out_buf;
106 ULONG out_size;
109 #endif