示例#1
0
        public SampleChannel GetChannel(SampleManager manager)
        {
            var channel = manager.Get($"Gameplay/{Bank}-{Name}");

            channel.Volume.Value = Volume / 100.0;
            return(channel);
        }
示例#2
0
        public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
        {
            SampleChannel channel = null;

            if (resourceNamespace != null)
            {
                channel = manager.Get($"Gameplay/{resourceNamespace}/{Bank}-{Name}");
            }

            // try without namespace as a fallback.
            if (channel == null)
            {
                channel = manager.Get($"Gameplay/{Bank}-{Name}");
            }

            if (channel != null)
            {
                channel.Volume.Value = Volume / 100.0;
            }

            return(channel);
        }
示例#3
0
        /// <summary>
        /// Hook up the effect controller to playback events
        /// </summary>
        /// <param name="playback"></param>
        public void Initializer(BeatmapPlayback playback, AudioTrack track, SampleManager sampleManager)
        {
            Debug.Assert(this.playback == null); // Only do this once, or dispose first
            this.sampleManager          = sampleManager;
            this.playback               = playback;
            this.track                  = track;
            playback.ObjectActivated   += PlaybackOnObjectActivated;
            playback.ObjectDeactivated += PlaybackOnObjectDeactivated;
            beatmap = playback.Beatmap;

            laserSlamSample = sampleManager.Get("laser_slam0.wav");

            // TODO: Pass in to this function as PlaybackContext
            context = new PlaybackContext
            {
                Playback = playback,
                Track    = track,
            };
        }
 public string Get()
 {
     return(sampleManager.Get());
 }
示例#5
0
 public override SampleChannel GetSample(string sampleName) => samples.Get(getPathForFile(sampleName.Split('/').Last()));