Example #1
0
            public ContainerWithEffect(string name, Color4 colour)
            {
                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                InternalChild = mixer = new DrawableAudioMixer
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new[]
                    {
                        background = new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = colour,
                            Alpha            = 0.2f
                        },
                        new SpriteText
                        {
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                            Text   = name,
                            Font   = FrameworkFont.Regular.With(size: 18)
                        },
                        content = new Container
                        {
                            RelativeSizeAxes = Axes.Both
                        }
                    }
                };
            }
            private void load(ITrackStore tracks, ISampleStore samples)
            {
                track  = new DrawableTrack(tracks.Get("sample-track.mp3"));
                sample = new DrawableSample(samples.Get("long.mp3"));

                if (withMixer)
                {
                    InternalChild = new DrawableAudioMixer {
                        Children = new Drawable[] { track, sample }
                    }
                }
                ;
                else
                {
                    InternalChildren = new Drawable[] { track, sample }
                };
            }