Mercurial > sdl-ios-xcode
comparison src/cdrom/macosx/AudioFilePlayer.h @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
comparison
equal
deleted
inserted
replaced
1667:1fddae038bc8 | 1668:4da1ee79c9af |
---|---|
34 | 34 |
35 #include <AudioUnit/AudioUnit.h> | 35 #include <AudioUnit/AudioUnit.h> |
36 | 36 |
37 #include "SDL_error.h" | 37 #include "SDL_error.h" |
38 | 38 |
39 const char *AudioFilePlayerErrorStr (OSStatus error); | 39 const char *AudioFilePlayerErrorStr(OSStatus error); |
40 | 40 |
41 /* | 41 /* |
42 void ThrowResult (OSStatus result, const char *str); | 42 void ThrowResult (OSStatus result, const char *str); |
43 | 43 |
44 #define THROW_RESULT(str) \ | 44 #define THROW_RESULT(str) \ |
72 void (*SetStopFrame) (struct S_AudioFilePlayer * afp, int frame); /* set limit in the file */ | 72 void (*SetStopFrame) (struct S_AudioFilePlayer * afp, int frame); /* set limit in the file */ |
73 int (*Connect) (struct S_AudioFilePlayer * afp); | 73 int (*Connect) (struct S_AudioFilePlayer * afp); |
74 void (*Disconnect) (struct S_AudioFilePlayer * afp); | 74 void (*Disconnect) (struct S_AudioFilePlayer * afp); |
75 void (*DoNotification) (struct S_AudioFilePlayer * afp, OSStatus inError); | 75 void (*DoNotification) (struct S_AudioFilePlayer * afp, OSStatus inError); |
76 int (*IsConnected) (struct S_AudioFilePlayer * afp); | 76 int (*IsConnected) (struct S_AudioFilePlayer * afp); |
77 AudioUnit (*GetDestUnit) (struct S_AudioFilePlayer * afp); | 77 AudioUnit(*GetDestUnit) (struct S_AudioFilePlayer * afp); |
78 void (*Print) (struct S_AudioFilePlayer * afp); | 78 void (*Print) (struct S_AudioFilePlayer * afp); |
79 | 79 |
80 /*private:*/ | 80 /*private:*/ |
81 AudioUnit mPlayUnit; | 81 AudioUnit mPlayUnit; |
82 SInt16 mForkRefNum; | 82 SInt16 mForkRefNum; |
99 int (*OpenFile) (struct S_AudioFilePlayer * afp, const FSRef * inRef, | 99 int (*OpenFile) (struct S_AudioFilePlayer * afp, const FSRef * inRef, |
100 SInt64 * outFileSize); | 100 SInt64 * outFileSize); |
101 } AudioFilePlayer; | 101 } AudioFilePlayer; |
102 | 102 |
103 | 103 |
104 AudioFilePlayer *new_AudioFilePlayer (const FSRef * inFileRef); | 104 AudioFilePlayer *new_AudioFilePlayer(const FSRef * inFileRef); |
105 void delete_AudioFilePlayer (AudioFilePlayer * afp); | 105 void delete_AudioFilePlayer(AudioFilePlayer * afp); |
106 | 106 |
107 | 107 |
108 | 108 |
109 #pragma mark __________ AudioFileManager | 109 #pragma mark __________ AudioFileManager |
110 typedef struct S_AudioFileManager | 110 typedef struct S_AudioFileManager |
112 /*public:*/ | 112 /*public:*/ |
113 /* this method should NOT be called by an object of this class | 113 /* this method should NOT be called by an object of this class |
114 as it is called by the parent's Disconnect() method */ | 114 as it is called by the parent's Disconnect() method */ |
115 void (*Disconnect) (struct S_AudioFileManager * afm); | 115 void (*Disconnect) (struct S_AudioFileManager * afm); |
116 int (*DoConnect) (struct S_AudioFileManager * afm); | 116 int (*DoConnect) (struct S_AudioFileManager * afm); |
117 OSStatus (*Read) (struct S_AudioFileManager * afm, char *buffer, | 117 OSStatus(*Read) (struct S_AudioFileManager * afm, char *buffer, |
118 UInt32 * len); | 118 UInt32 * len); |
119 const char *(*GetFileBuffer) (struct S_AudioFileManager * afm); | 119 const char *(*GetFileBuffer) (struct S_AudioFileManager * afm); |
120 const AudioFilePlayer *(*GetParent) (struct S_AudioFileManager * afm); | 120 const AudioFilePlayer *(*GetParent) (struct S_AudioFileManager * afm); |
121 void (*SetPosition) (struct S_AudioFileManager * afm, SInt64 pos); /* seek/rewind in the file */ | 121 void (*SetPosition) (struct S_AudioFileManager * afm, SInt64 pos); /* seek/rewind in the file */ |
122 int (*GetByteCounter) (struct S_AudioFileManager * afm); /* return actual bytes streamed to audio hardware */ | 122 int (*GetByteCounter) (struct S_AudioFileManager * afm); /* return actual bytes streamed to audio hardware */ |
123 void (*SetEndOfFile) (struct S_AudioFileManager * afm, SInt64 pos); /* set the "EOF" (will behave just like it reached eof) */ | 123 void (*SetEndOfFile) (struct S_AudioFileManager * afm, SInt64 pos); /* set the "EOF" (will behave just like it reached eof) */ |
147 SInt64 mReadFilePosition; | 147 SInt64 mReadFilePosition; |
148 int mWriteToFirstBuffer; | 148 int mWriteToFirstBuffer; |
149 int mFinishedReadingData; | 149 int mFinishedReadingData; |
150 | 150 |
151 /*protected:*/ | 151 /*protected:*/ |
152 OSStatus (*Render) (struct S_AudioFileManager * afm, | 152 OSStatus(*Render) (struct S_AudioFileManager * afm, |
153 AudioBuffer * ioData); | 153 AudioBuffer * ioData); |
154 OSStatus (*GetFileData) (struct S_AudioFileManager * afm, | 154 OSStatus(*GetFileData) (struct S_AudioFileManager * afm, |
155 void **inOutData, UInt32 * inOutDataSize); | 155 void **inOutData, UInt32 * inOutDataSize); |
156 void (*AfterRender) (struct S_AudioFileManager * afm); | 156 void (*AfterRender) (struct S_AudioFileManager * afm); |
157 | 157 |
158 /*public:*/ | 158 /*public:*/ |
159 /*static */ | 159 /*static */ |
160 OSStatus (*FileInputProc) (void *inRefCon, | 160 OSStatus(*FileInputProc) (void *inRefCon, |
161 AudioUnitRenderActionFlags inActionFlags, | 161 AudioUnitRenderActionFlags inActionFlags, |
162 const AudioTimeStamp * inTimeStamp, | 162 const AudioTimeStamp * inTimeStamp, |
163 UInt32 inBusNumber, AudioBuffer * ioData); | 163 UInt32 inBusNumber, AudioBuffer * ioData); |
164 } AudioFileManager; | 164 } AudioFileManager; |
165 | 165 |
166 | 166 |
167 AudioFileManager *new_AudioFileManager (AudioFilePlayer * inParent, | 167 AudioFileManager *new_AudioFileManager(AudioFilePlayer * inParent, |
168 SInt16 inForkRefNum, | 168 SInt16 inForkRefNum, |
169 SInt64 inFileLength, | 169 SInt64 inFileLength, |
170 UInt32 inChunkSize); | 170 UInt32 inChunkSize); |
171 | 171 |
172 void delete_AudioFileManager (AudioFileManager * afm); | 172 void delete_AudioFileManager(AudioFileManager * afm); |
173 | 173 |
174 #endif | 174 #endif |
175 /* vi: set ts=4 sw=4 expandtab: */ | 175 /* vi: set ts=4 sw=4 expandtab: */ |