Example #1
0
        // private List<Sound> m_SFXList;
        /// <summary>
        /// Class constructor.
        /// </summary>
        public SoundManager()
        {
            //Empties variable
            m_System		= null;
            m_BGM			= null;
            m_BGMChannel	= null;

            //Create FMOD system
            CheckError(Factory.System_Create(ref m_System));

            //Check version
            uint Version = 0;
            CheckError(m_System.getVersion(ref Version));
            if (Version < VERSION.number) throw new System.Exception(Global.FMODVERSION_ERROR);

            //Check driver
            CheckDriver();
        }
Example #2
0
        public RESULT getSystemObject(ref System system)
        {
            RESULT result         = RESULT.OK;
            IntPtr systemraw      = new IntPtr();
            System systemnew      = null;

            try
            {
                result = FMOD_SoundGroup_GetSystemObject(soundgroupraw, ref systemraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (system == null)
            {
                systemnew = new System();
                systemnew.setRaw(systemraw);
                system = systemnew;
            }
            else
            {
                system.setRaw(systemraw);
            }

            return result;
        }
Example #3
0
        public static RESULT System_Create(ref System system)
        {
            #if WIN64
            if (IntPtr.Size != 8)
            {
                /* Attempting to use 64-bit FMOD dll with 32-bit application.*/

                return RESULT.ERR_FILE_BAD;
            }
            #else
            if (IntPtr.Size != 4)
            {
                /* Attempting to use 32-bit FMOD dll with 64-bit application. A likely cause of this error
                 * is targetting platform 'Any CPU'. You cannot link to unmanaged dll with 'Any CPU'
                 * target.
                 *
                 * For 32-bit applications: set the platform to 'x86'.
                 *
                 * For 64-bit applications:
                 * 1. set the platform to x64
                 * 2. add the conditional complication symbol WIN64
                 * 3. download the win64 fmod release
                 * 4. copy the fmodex64.dll to the location of the .exe file for your application */

                return RESULT.ERR_FILE_BAD;
            }
            #endif

            RESULT result           = RESULT.OK;
            IntPtr      systemraw   = new IntPtr();
            System      systemnew   = null;

            result = FMOD_System_Create(ref systemraw);
            if (result != RESULT.OK)
            {
                return result;
            }

            systemnew = new System();
            systemnew.setRaw(systemraw);
            system = systemnew;

            return result;
        }