Пример #1
0
        void Load(string FilePath)
        {
            this.FilePath = FilePath;

            //try
            //{
            if (Player != null)
            {
                Player.Dispose();
            }
            if (ReverseDecoder != null)
            {
                ReverseDecoder.Dispose();
            }
            if (ReverbEffect != null)
            {
                ReverbEffect = null;
            }

            ReverseDecoder = new ReverseDecoder(new FileDecoder(FilePath))
            {
                Reverse = false
            };

            Player = new TempoPlayer(ReverseDecoder);

            ReverbEffect = new ReverbEffect(Player)
            {
                IsActive = false
            };

            Ready = true;

            Reverse = false;

            Title.Content = Path.GetFileNameWithoutExtension(FilePath);

            OnPropertyChanged("Duration");
            OnPropertyChanged("Position");

            BPlay.Content = "/Resources/Play.png";

            Frequency = 44100;
            Balance   = Pitch = Tempo = 0;

            Player.MediaEnded += (s, t) => Dispatcher.Invoke(() =>
            {
                Status.Content = "Stopped";
                Position       = Reverse ? Duration : 0;
                ProgressBarTimer.Stop();
                BPlay.Content = "/Resources/Play.png";
            });

            if (MusicLoaded != null)
            {
                MusicLoaded();
            }
            //}
            //catch { Error(); }
        }
Пример #2
0
            internal static unsafe void Invoke(IntPtr obj, ReverbEffect InReverbEffect, float WetLevel, float DryLevel)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = InReverbEffect;
                *((float *)(b + 8))  = WetLevel;
                *((float *)(b + 12)) = DryLevel;
                Main.GetProcessEvent(obj, SetSettingsWithReverbEffect_ptr, new IntPtr(p));;
            }
        }
Пример #3
0
 ///<summary>Set Settings with Reverb Effect</summary>
 public void SetSettingsWithReverbEffect(ReverbEffect InReverbEffect, float WetLevel, float DryLevel)  => 
     SubmixEffectReverbPreset_methods.SetSettingsWithReverbEffect_method.Invoke(ObjPointer, InReverbEffect, WetLevel, DryLevel);