00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #import "fmod.hpp"
00011 #import "fmod_errors.h"
00012 #import <Foundation/Foundation.h>
00013
00014
00015
00016
00017 #define AM_DEBUG_PARSER 1 // Show parser debug information.
00018 #define AM_DEBUG_SCHEDULER 1 // Show scheduler debug information.
00019 #define AM_DEBUG_ANIMATION 1 // Show animation debug information.
00020 #define AM_DEBUG_CORE 1 // Show core objects debug information.
00021 #define AM_FMOD_CHECKS 1 // Active FMOD functions error checking.
00022
00023 #ifdef DEBUG
00024 #define AM_LOG(f, ...) printf("%s\n", [[NSString stringWithFormat:(@"ARIA: %-16s : " f), [NSStringFromClass([self class]) cStringUsingEncoding:NSUTF8StringEncoding], ##__VA_ARGS__] cStringUsingEncoding:NSUTF8StringEncoding])
00025 #define AM_LOGC(f, ...) printf("%s\n", [[NSString stringWithFormat:(@"ARIA: %-16s : " f), __FUNCTION__, ##__VA_ARGS__] cStringUsingEncoding:NSUTF8StringEncoding])
00026 #else
00027 #define AM_LOG(...)
00028 #define AM_LOGC(f, ...)
00029 #endif
00030
00031 #ifdef AM_DEBUG_CORE
00032 #define AM_LOG_CORE(f, ...) AM_LOG(f, ##__VA_ARGS__)
00033 #else
00034 #define AM_LOG_CORE(...)
00035 #endif
00036
00037 #ifdef AM_DEBUG_PARSER
00038 #define AM_LOG_PARSER(f, ...) AM_LOG(f, ##__VA_ARGS__)
00039 #else
00040 #define AM_LOG_PARSER(...)
00041 #endif
00042
00043 #ifdef AM_DEBUG_SCHEDULER
00044 #define AM_LOG_SCHEDULER(f, ...) AM_LOG(f, ##__VA_ARGS__)
00045 #else
00046 #define AM_LOG_SCHEDULER(...)
00047 #endif
00048
00049 #ifdef AM_DEBUG_ANIMATION
00050 #define AM_LOG_ANIMATION(f, ...) AM_LOG(f, ##__VA_ARGS__)
00051 #else
00052 #define AM_LOG_ANIMATION(...)
00053 #endif
00054
00055
00056
00057 #define AM_CONTROLS_INITIAL_CAPACITY 1
00058 #define AM_DEFAULT_TEMPO 120
00059 #define AM_TEMPO_RESOLUTION 384
00060 #define AM_TIME_SEP_INTERVAL 1.0
00061 #define UNDEFINED_UID 0
00064
00065
00066 #define ARC4RANDOM_MAX 0x100000000LL
00067 #define RAND(x) (((double)arc4random() / ARC4RANDOM_MAX) * (x))
00068 #define RAND_INT(x) ((int)(floorf(((double)arc4random() / ARC4RANDOM_MAX) * (x))))
00069
00070
00071
00072 #define AM_PLAYABLE_BEGIN_SUFFIX @".begin"
00073 #define AM_PLAYABLE_END_SUFFIX @".end"
00074 #define AM_PLAYABLE_REPEAT_SUFFIX @".repeat"
00075 #define AM_EVENT_OBJECT_DEFAULT_KEY @"value"
00076
00077
00078
00080 typedef long long UID;
00081
00083 typedef struct {
00084 float x;
00085 float y;
00086 float z;
00087 } AMVec3;
00088
00089
00090
00094 enum AMPickType {
00095 AM_PT_ORDERED = 0,
00096 AM_PT_RANDOM,
00097 AM_PT_OMIT_MOST_RECENT,
00098 AM_PT_REVERSED,
00099 AM_PT_FIXED
00100 };
00101
00105 enum AMFadeInType {
00106 AM_FIT_NONE = 0,
00107 AM_FIT_SIMPLEFADE
00108 };
00109
00113 enum AMFadeOutType {
00114 AM_FOT_NONE = 0,
00115 AM_FOT_SIMPLEFADE,
00116 AM_FOT_CROSSFADE
00117 };
00118
00122 enum AMRetriggerType {
00123 AM_RT_AUTO = 0,
00124 AM_RT_ALWAYS,
00125 AM_RT_NEVER
00126 };
00127
00131 enum AMActionType {
00132 AM_ACT_NONE = 0,
00133 AM_ACT_START,
00134 AM_ACT_STOP,
00135 AM_ACT_SET,
00136 AM_ACT_ENABLE,
00137 AM_ACT_DISABLE,
00138 AM_ACT_SET_ACTIVE
00139 };
00140
00144 enum AMFillType {
00145 AM_FIL_REMOVE = 0,
00146 AM_FIL_FREEZE,
00147 };
00148
00152 enum AMAccumulationType {
00153 AM_ACC_NONE = 0,
00154 AM_ACC_SUM,
00155 };
00156
00157
00158
00159
00160 void ERRCHECK(FMOD_RESULT result);
00161 long long GenerateUniqueID();