public List<FmodEvent> loadEventsFromFile(string assetPath, string assetName, FmodEventAsset asset) { FMOD.EventGroup eventgroup = null; FMOD.RESULT result = FMOD.RESULT.OK; List<FmodEvent> events = new List<FmodEvent>(); List<FmodEventGroup> eventGroups = new List<FmodEventGroup>(); int numGroups = 0; FmodEventGroup toAdd = null; FMOD.EVENT_LOADINFO loadInfo = new FMOD.EVENT_LOADINFO(); FMOD.EventProject project = null; _loadFile(assetPath, assetName, ref loadInfo, ref project); _getSoundBankNames(asset); FMOD.EVENT_PROJECTINFO projectInfo = new FMOD.EVENT_PROJECTINFO(); project.getInfo(ref projectInfo); asset.setProjectName(new string(projectInfo.name)); result = project.getNumGroups(ref numGroups); ERRCHECK(result); for (int i = 0; i < numGroups; i++) { result = project.getGroupByIndex(i, false, ref eventgroup); ERRCHECK(result); toAdd = FmodEventGroup.CreateInstance("FmodEventGroup") as FmodEventGroup; toAdd.Initialize(eventgroup, null, asset); eventGroups.Add(toAdd); events.AddRange(toAdd.getAllEvents()); } asset.setEventGroups(eventGroups); loadReverbsFromFile(asset); return (events); }
private static extern RESULT FMOD_EventSystem_Load(IntPtr eventsystem, string name_or_data, ref EVENT_LOADINFO loadinfo, ref IntPtr project);
public FMOD.RESULT loadEventFromFile(FmodEventAudioSource src) { FmodEvent evt = src.getSource(); FmodEventAsset asset = evt.getAsset(); FMOD.RESULT result = FMOD.RESULT.OK; FMOD.EVENT_LOADINFO loadInfo = new FMOD.EVENT_LOADINFO(); FMOD.EventProject project = null; FMOD.Event fmodEvent = null; _loadFile(asset.getMediaPath(), asset.getName(), ref loadInfo, ref project); _loadEventGroup(evt); result = _loadEvent(evt, ref fmodEvent); ERRCHECK(result); if (result == FMOD.RESULT.OK) { src.SetEvent(fmodEvent); } return (result); }
// FEV load/unload. public RESULT load(string name_or_data, ref EVENT_LOADINFO loadinfo, ref EventProject project) { RESULT result = RESULT.OK; IntPtr eventprojectraw = new IntPtr(); EventProject eventprojectnew = null; try { result = FMOD_EventSystem_Load(eventsystemraw, name_or_data, ref loadinfo, ref eventprojectraw); } catch { result = RESULT.ERR_INVALID_PARAM; } if (result != RESULT.OK) { return result; } if (project == null) { eventprojectnew = new EventProject(); eventprojectnew.setRaw(eventprojectraw); project = eventprojectnew; } else { project.setRaw(eventprojectraw); } return result; }