Esempio n. 1
0
        public PDModule Play(string moduleName, GameObject source)
        {
            PDModule module = GetModule(moduleName, source);

            module.Play();
            return(module);
        }
Esempio n. 2
0
        public PDModule Play(string moduleName, GameObject source, float delay, SyncMode syncMode)
        {
            PDModule module = GetModule(moduleName, source);

            module.Play(delay, syncMode);
            return(module);
        }
Esempio n. 3
0
        public PDModule Play(string moduleName, string soundName, GameObject source, params AudioOption[] audioOptions)
        {
            PDModule module = GetModule(moduleName, source);

            module.AddAudioItem(GetAudioItem(moduleName, soundName, module.spatializer.Source, audioOptions));
            LimitVoices();
            module.Play();
            return(module);
        }
        public AudioItem Play(string moduleName, string instrumentName, int note, float velocity, object source, params AudioOption[] audioOptions)
        {
            PDModule          module     = player.generalSettings.PdPlayer.itemManager.GetModule(moduleName, source);
            SamplerInstrument instrument = GetInstrument(instrumentName);
            SingleAudioItem   audioItem  = GetPDSingleAudioItem(instrument, note, velocity, source);

            if (audioItem == null)
            {
                return(instrument);
            }

            if (module.State != AudioStates.Playing)
            {
                module.Initialize();
                module.Play();
            }

            audioItem.Play(audioOptions);
            module.AddAudioItem(audioItem);

            return(audioItem);
        }