comparison ALmixer.h @ 12:bfe90b4f3d87

Bug fixes to FadeIn. Documentation fixes Minor API changes w.r.t. return types. (ALboolean instead of ALint)
author Eric Wing <ewing . public |-at-| gmail . com>
date Fri, 05 Nov 2010 20:59:13 -0700
parents 8cb13d89451a
children 9365e714fc4b 58f03008ea05
comparison
equal deleted inserted replaced
11:eca6f008fad0 12:bfe90b4f3d87
166 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 166 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
167 167
168 168
169 169
170 /* Needed for OpenAL types since altypes.h was removed in 1.1 */ 170 /* Needed for OpenAL types since altypes.h was removed in 1.1 */
171 #include "al.h" 171 #ifdef ANDROID_NDK
172 #include <AL/al.h>
173 #else
174 #include "al.h"
175 #endif
172 176
173 /* Set up for C function definitions, even when using C++ */ 177 /* Set up for C function definitions, even when using C++ */
174 #ifdef __cplusplus 178 #ifdef __cplusplus
175 extern "C" { 179 extern "C" {
176 #endif 180 #endif
937 extern ALMIXER_DECLSPEC ALuint ALMIXER_CALL ALmixer_GetSource(ALint which_channel); 941 extern ALMIXER_DECLSPEC ALuint ALMIXER_CALL ALmixer_GetSource(ALint which_channel);
938 942
939 /** 943 /**
940 * This function will look up the channel for the corresponding source. 944 * This function will look up the channel for the corresponding source.
941 * @param al_source The source id you want to find the corresponding channel number for. 945 * @param al_source The source id you want to find the corresponding channel number for.
942 * If -1 is supplied, it will try to return the first channel not in use. 946 * If 0 is supplied, it will try to return the first channel not in use.
943 * Returns -1 on error, or the channel. 947 * Returns -1 on error, or the channel.
944 */ 948 */
945 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_GetChannel(ALuint al_source); 949 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_GetChannel(ALuint al_source);
946 950
947 /** 951 /**
1035 /** 1039 /**
1036 * Rewinds the sound to the beginning for a given data. 1040 * Rewinds the sound to the beginning for a given data.
1037 * Rewinds the actual data, but the effect 1041 * Rewinds the actual data, but the effect
1038 * may not be noticed until the currently buffered data is played. 1042 * may not be noticed until the currently buffered data is played.
1039 * @param almixer_data The data to rewind. 1043 * @param almixer_data The data to rewind.
1040 * @returns 0 on success or -1 on error. 1044 * @returns true on success or false on error.
1041 */ 1045 */
1042 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_RewindData(ALmixer_Data* almixer_data); 1046 extern ALMIXER_DECLSPEC ALboolean ALMIXER_CALL ALmixer_RewindData(ALmixer_Data* almixer_data);
1043 1047
1044 /** 1048 /**
1045 * Rewinds the sound to the beginning that is playing on a specific channel. 1049 * Rewinds the sound to the beginning that is playing on a specific channel.
1046 * If decoded all, rewind will instantly rewind it. Data is not 1050 * If decoded all, rewind will instantly rewind it. Data is not
1047 * affected, so it will start at the "Seek"'ed positiond. 1051 * affected, so it will start at the "Seek"'ed positiond.
1048 * Streamed data will rewind the actual data, but the effect 1052 * Streamed data will rewind the actual data, but the effect
1049 * may not be noticed until the currently buffered data is played. 1053 * may not be noticed until the currently buffered data is played.
1050 * @param which_channel The channel to rewind or -1 to rewind all channels. 1054 * @param which_channel The channel to rewind or -1 to rewind all channels.
1051 * @returns 0 on success or -1 on error. 1055 * @return The actual number of channels rewound on success or -1 on error.
1052 */ 1056 */
1053 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_RewindChannel(ALint which_channel); 1057 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_RewindChannel(ALint which_channel);
1054 /** 1058 /**
1055 * Rewinds the sound to the beginning that is playing on a specific source. 1059 * Rewinds the sound to the beginning that is playing on a specific source.
1056 * If decoded all, rewind will instantly rewind it. Data is not 1060 * If decoded all, rewind will instantly rewind it. Data is not
1057 * affected, so it will start at the "Seek"'ed positiond. 1061 * affected, so it will start at the "Seek"'ed positiond.
1058 * Streamed data will rewind the actual data, but the effect 1062 * Streamed data will rewind the actual data, but the effect
1059 * may not be noticed until the currently buffered data is played. 1063 * may not be noticed until the currently buffered data is played.
1060 * @param al_source The source to rewind or 0 to rewind all sources. 1064 * @param al_source The source to rewind or 0 to rewind all sources.
1061 * @returns 1 on success or 0 on error. 1065 * @return The actual number of sources rewound on success or -1 on error.
1062 */ 1066 */
1063 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_RewindSource(ALuint al_source); 1067 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_RewindSource(ALuint al_source);
1064 1068
1065 /** 1069 /**
1066 * Seek the sound for a given data. 1070 * Seek the sound for a given data.
1067 * Seeks the actual data to the given millisecond. It 1071 * Seeks the actual data to the given millisecond. It
1068 * may not be noticed until the currently buffered data is played. 1072 * may not be noticed until the currently buffered data is played.
1069 * @param almixer_data 1073 * @param almixer_data The data to seek on.
1070 * @param msec_pos The time position to seek to in the audio in milliseconds. 1074 * @param msec_pos The time position to seek to in the audio in milliseconds.
1071 * @returns 0 on success or -1 on error. 1075 * @returns true on success or false on error.
1072 */ 1076 */
1073 extern ALMIXER_DECLSPEC ALint ALMIXER_CALL ALmixer_SeekData(ALmixer_Data* almixer_data, ALuint msec_pos); 1077 extern ALMIXER_DECLSPEC ALboolean ALMIXER_CALL ALmixer_SeekData(ALmixer_Data* almixer_data, ALuint msec_pos);
1074 1078
1075 /** 1079 /**
1076 * Pauses playback on a channel. 1080 * Pauses playback on a channel.
1077 * Pauses playback on a channel. Should have no effect on channels that aren't playing. 1081 * Pauses playback on a channel. Should have no effect on channels that aren't playing.
1078 * @param which_channel The channel to pause or -1 to pause all channels. 1082 * @param which_channel The channel to pause or -1 to pause all channels.
1456 /** 1460 /**
1457 * Returns the number of allocated channels. 1461 * Returns the number of allocated channels.
1458 * This is just a convenience alias to ALmixer_AllocateChannels(-1). 1462 * This is just a convenience alias to ALmixer_AllocateChannels(-1).
1459 * @see ALmixer_AllocateChannels 1463 * @see ALmixer_AllocateChannels
1460 */ 1464 */
1461 ALint ALmixer_CountTotalChannels(void); 1465 ALuint ALmixer_CountTotalChannels(void);
1462 #else 1466 #else
1463 #define ALmixer_CountTotalChannels() ALmixer_AllocateChannels(-1) 1467 #define ALmixer_CountTotalChannels() ALmixer_AllocateChannels(-1)
1464 #endif 1468 #endif
1465 1469
1466 1470
1467 1471
1468 1472
1469 #ifdef DOXYGEN_ONLY 1473 #ifdef DOXYGEN_ONLY
1470 /** 1474 /**
1471 * Returns the number of allocated channels. 1475 * Returns the number of reserved channels.
1472 * This is just a convenience alias to ALmixer_ReserveChannels(-1). 1476 * This is just a convenience alias to ALmixer_ReserveChannels(-1).
1473 * @see ALmixer_ReserveChannels 1477 * @see ALmixer_ReserveChannels
1474 */ 1478 */
1475 ALint ALmixer_CountReservedChannels(void); 1479 ALuint ALmixer_CountReservedChannels(void);
1476 #else 1480 #else
1477 #define ALmixer_CountReservedChannels() ALmixer_ReserveChannels(-1) 1481 #define ALmixer_CountReservedChannels() ALmixer_ReserveChannels(-1)
1478 #endif 1482 #endif
1479 1483
1480 1484