Esempio n. 1
0
 public HitSoundInfo(HitObjectSoundType SoundType, SampleSet SampleSet, CustomSampleSet CustomSampleSet, int Volume, SampleSet SampleSetAdditions = SampleSet.None)
 {
     this.SoundType          = SoundType;
     this.SampleSet          = SampleSet;
     this.SampleSetAdditions = SampleSetAdditions;
     this.CustomSampleSet    = CustomSampleSet;
     this.Volume             = Volume;
 }
Esempio n. 2
0
 internal ControlPoint(double offset, double beatLength, TimeSignatures timeSignature, SampleSet sampleSet,
                       CustomSampleSet customSamples, int volume, bool timingChange, EffectFlags effectFlags)
 {
     this.Offset        = offset;
     this.BeatLength    = beatLength;
     this.TimeSignature = timeSignature;
     this.SampleSet     = sampleSet == SampleSet.None ? SampleSet.Soft : sampleSet;
     this.CustomSamples = customSamples;
     this.Volume        = volume;
     this.TimingChange  = timingChange;
     this.EffectFlags   = effectFlags;
 }
Esempio n. 3
0
        internal void PlaySound(ControlPoint controlPoint, HitObjectSoundType soundType, SampleSet sampleSet, SampleSet sampleSetAdditions)
        {
            SampleSet       ss  = sampleSet == Audio.SampleSet.None ? controlPoint.SampleSet : sampleSet;
            CustomSampleSet css = CustomSampleSet == CustomSampleSet.Default ? controlPoint.CustomSamples : CustomSampleSet;
            int             vol = SampleVolume != 0 ? SampleVolume : controlPoint.Volume;

            HitSoundInfo hitSoundInfo = HitSoundInfo.GetLayered(soundType, ss, css, vol, ss == Audio.SampleSet.None ? ss : sampleSetAdditions);

            HitObjectManager.OnHitSound(hitSoundInfo);

            if (SampleAddr != -1)
            {
                AudioEngine.PlaySample(SampleAddr, vol, PositionalSound, true);
            }
            else
            {
                AudioEngine.PlayHitSamples(hitSoundInfo, PositionalSound, true);
            }
        }
Esempio n. 4
0
        private HitSoundInfo GetSampleset()
        {
            SampleSet       ss     = SampleSet.None;
            CustomSampleSet css    = CustomSampleSet.Default;
            int             volume = 100;

            if (resetSampleSettings)
            {
                if (listSampleset.SelectedItem == null)
                {
                    ss = SampleSet.None;
                }
                else
                {
                    ss = (SampleSet)Enum.Parse(typeof(SampleSet), listSampleset.SelectedItem.ToString());
                }
                if (sampleCustom.Checked)
                {
                    css = CustomSampleSet.Custom1;
                }
            }
            else
            {
                ss  = AudioEngine.ActiveControlPoint.SampleSet;
                css = AudioEngine.ActiveControlPoint.CustomSamples;
            }

            if (resetVolumeSettings)
            {
                volume = volume1.Value;
            }
            else
            {
                volume = AudioEngine.ActiveControlPoint.Volume;
            }

            return(new HitSoundInfo(HitObjectSoundType.None, ss, css, volume));
        }
Esempio n. 5
0
        private void SongSetup_Load(object sender, EventArgs e)
        {
            combos = new[] { combo1, combo2, combo3, combo4,
                             combo5, combo6, combo7, combo8 };

            List <String> files = (BeatmapManager.Current.InOszContainer) ?
                                  new List <string>(BeatmapManager.Current.Package.MapFiles) : null;

            //Restrict anything that can alter the filename of the difficulty when we are in the editor with a overridden difficulty
            //unless we are using the save as dialog.
            bool fRestrict = files != null && !newDifficulty &&
                             files.Exists((f) => f.EndsWith(Path.GetFileName(BeatmapManager.Current.Filename)));

            version.Enabled = !fRestrict;

            title.Text          = !string.IsNullOrEmpty(BeatmapManager.Current.TitleUnicode) ? BeatmapManager.Current.TitleUnicode : BeatmapManager.Current.Title;
            titleRomanised.Text = string.IsNullOrEmpty(BeatmapManager.Current.Title) ? GeneralHelper.AsciiOnly(BeatmapManager.Current.TitleUnicode) : BeatmapManager.Current.Title;

            artist.Text          = !string.IsNullOrEmpty(BeatmapManager.Current.ArtistUnicode) ? BeatmapManager.Current.ArtistUnicode : BeatmapManager.Current.Artist;
            artistRomanised.Text = string.IsNullOrEmpty(BeatmapManager.Current.Artist) ? GeneralHelper.AsciiOnly(BeatmapManager.Current.ArtistUnicode) : BeatmapManager.Current.Artist;

            creator.Text = (BeatmapManager.Current.Creator.Length > 0
                                ? BeatmapManager.Current.Creator
                                : ConfigManager.sUsername.Value);
            source.Text = BeatmapManager.Current.Source;
            if (creator.Text == ConfigManager.sUsername || fRestrict)
            {
                creator.Enabled = false;
            }
            version.Text = BeatmapManager.Current.Version;

            coopmode.Checked = BeatmapManager.Current.PlayMode == PlayModes.OsuMania && BeatmapManager.Current.DifficultyCircleSize >= 10;

            // extend the trackbar a little to avoid resetting .osuhaxed values
            setDifficulty(hpDrainRate, BeatmapManager.Current.DifficultyHpDrainRate, DRAIN_MIN, DRAIN_MAX, 10.0);

            if (allowedModes.SelectedIndex == 3)
            {
                setDifficulty(circleSize, BeatmapManager.Current.DifficultyCircleSize / (coopmode.Checked ? 2 : 1), CS_MIN_MANIA, CS_MAX_MANIA, 1.0); // Mania doesn't support any decimal circle size
            }
            else
            {
                setDifficulty(circleSize, BeatmapManager.Current.DifficultyCircleSize, CS_MIN, CS_MAX, 10.0);
            }

            setDifficulty(approachRate, BeatmapManager.Current.DifficultyApproachRate, AR_MIN, AR_MAX, 10.0);
            setDifficulty(overallDifficulty, BeatmapManager.Current.DifficultyOverall, OD_MIN, OD_MAX, 10.0);

            // in the case where there's only one sampleset, this works.
            // when there isn't, the control is hidden anyway.
            listSampleset.SelectedItem = AudioEngine.CurrentSampleSet.ToString();
            tags.Text               = BeatmapManager.Current.Tags;
            source.Text             = BeatmapManager.Current.Source;
            sampleCustom.Checked    = AudioEngine.CustomSamples == CustomSampleSet.Custom1;
            checkEpilepsy.Checked   = BeatmapManager.Current.EpilepsyWarning;
            udCountdownOffset.Value = BeatmapManager.Current.CountdownOffset;

            stackLeniency.Value = (int)Math.Max(2, Math.Round(BeatmapManager.Current.StackLeniency * 10));

            allowedModes.SelectedIndex = (int)BeatmapManager.Current.PlayMode;
            originMode = BeatmapManager.Current.PlayMode;

            volume1.Value = BeatmapManager.Current.SampleVolume;

            if (BeatmapManager.Current.AudioPresent)
            {
                checkSamplesMatchPlaybackRate.Checked = BeatmapManager.Current.SamplesMatchPlaybackRate;
            }
            else
            {
                checkSamplesMatchPlaybackRate.Checked = true;
                checkSamplesMatchPlaybackRate.Enabled = false;
            }

            checkCountdown.Checked     = BeatmapManager.Current.Countdown != Countdown.Disabled;
            checkLetterbox.Checked     = BeatmapManager.Current.LetterboxInBreaks;
            checkWidescreen.Checked    = BeatmapManager.Current.WidescreenStoryboard || newDifficulty;
            checkStoryOverFire.Checked = !BeatmapManager.Current.StoryFireInFront;

            if (BeatmapManager.Current.Countdown == Countdown.Disabled)
            {
                countdownNormal.Checked = true;
            }
            else
            {
                countdownDouble.Checked = BeatmapManager.Current.Countdown == Countdown.DoubleSpeed;
                countdownHalf.Checked   = BeatmapManager.Current.Countdown == Countdown.HalfSpeed;
                countdownNormal.Checked = BeatmapManager.Current.Countdown == Countdown.Normal;
            }

            SkinManager.InitializeSkinList();
            foreach (string s in SkinManager.Skins)
            {
                skinPreference.Items.Add(s);
            }

            if (!string.IsNullOrEmpty(BeatmapManager.Current.SkinPreference))
            {
                skinPreference.Text = BeatmapManager.Current.SkinPreference;
            }
            else
            {
                skinPreference.SelectedIndex = 0;
            }



            panelCountdownRate.Enabled = checkCountdown.Checked;

            if (AudioEngine.ControlPoints.Count > 0)
            {
                SampleSet       def    = AudioEngine.ControlPoints[0].SampleSet;
                CustomSampleSet cus    = AudioEngine.ControlPoints[0].CustomSamples;
                int             volume = AudioEngine.ControlPoints[0].Volume;


                foreach (ControlPoint p in AudioEngine.ControlPoints)
                {
                    if (p.SampleSet != def || p.CustomSamples != cus || p.CustomSamples >= CustomSampleSet.Custom2)
                    {
                        hideSampleSettings.Visible = true;
                        resetSampleSettings        = false;
                    }
                    if (p.Volume != volume)
                    {
                        hideSampleVolume.Visible = true;
                        resetVolumeSettings      = false;
                    }
                }

                volume1.Value = volume;
            }

            List <System.Drawing.Color> colours = new List <System.Drawing.Color>(4);

            for (int x = 0; x < SkinManager.MAX_COLOUR_COUNT; x++)
            {
                System.Drawing.Color c = OsuMathHelper.CConvert(SkinManager.LoadColour("Combo" + (x + 1).ToString()));
                if (x < 2 || c.A > 0)
                {
                    colours.Add(c);
                }
            }

            while (colours.Count < 2)
            {
                colours.Add(System.Drawing.Color.FromArgb(240, 240, 240));
            }

            colours.Add(colours[0]);
            colours.RemoveAt(0);

            int y;

            for (y = 0; y < colours.Count; y++)
            {
                combos[y].SwatchColor = colours[y];
                combos[y].Visible     = true;
                combos[y].Visible2    = true;
            }

            for (; y < 8; y++)
            {
                combos[y].Visible  = false;
                combos[y].Visible2 = false;
            }

            backgroundColour.SwatchColor = OsuMathHelper.CConvert(EventManager.backgroundColour);

            updateCheckedColours();
            customColour.Checked    = BeatmapManager.Current.CustomColours;
            cb_maniaSpecial.Checked = BeatmapManager.Current.SpecialStyle;

            if (newDifficulty || fRestrict)
            {
                version.Text = string.Empty;
                version.Select();

                artist.Enabled = false;
                title.Enabled  = false;
            }
            else
            {
                artist.Select();
            }

            changesMade = false;
        }
Esempio n. 6
0
        internal override HitCircle CreateHitCircle(Vector2 startPosition, int startTime, bool newCombo, HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            WarpSpacing(ref startPosition, startTime);

            HitCircleFruits h = new HitCircleFruits(hitObjectManager, startPosition, startTime, newCombo, soundType, GetNextFruit());

            h.Type              |= HitObjectType.NewCombo; //because sorting colours needs this to make each fruit a different colour.
            h.SampleSet          = sampleSet;
            h.SampleSetAdditions = addSet;
            h.CustomSampleSet    = customSampleSet;
            h.SampleVolume       = volume;
            h.ProcessSampleFile(sampleFile);
            return(h);
        }
Esempio n. 7
0
        internal override Slider CreateSlider(Vector2 startPosition, int startTime, bool newCombo, HitObjectSoundType soundType, CurveTypes curveType, int repeatCount, double sliderLength,
                                              List <Vector2> sliderPoints, List <HitObjectSoundType> soundTypes, int comboOffset, SampleSet sampleSet, SampleSet addSet,
                                              List <SampleSet> sampleSets, List <SampleSet> sampleSetAdditions, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            SliderFruits sf = new SliderFruits(hitObjectManager, startPosition, startTime, newCombo, soundType, curveType, repeatCount, sliderLength, sliderPoints, soundTypes, GetNextFruit());

            lastStartX    = sliderPoints[sliderPoints.Count - 1].X;
            lastStartTime = sf.EndTime;

            sf.SampleSet             = sampleSet;
            sf.SampleSetAdditions    = addSet;
            sf.SampleSetList         = sampleSets;
            sf.SampleSetAdditionList = sampleSetAdditions;
            sf.CustomSampleSet       = customSampleSet;
            sf.SampleVolume          = volume;
            sf.ProcessSampleFile(sampleFile);
            return(sf);
        }
Esempio n. 8
0
 internal override Spinner CreateSpinner(int startTime, int endTime, HitObjectSoundType soundType, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
 {
     return(new SpinnerTaiko(hitObjectManager, startTime, endTime, soundType));
 }
Esempio n. 9
0
        internal override HitCircle CreateHitCircle(Vector2 startPosition, int startTime, bool newCombo,
                                                    HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            ControlPoint cp   = hitObjectManager.Beatmap.ControlPointAt(startTime + 5);
            bool         kiai = cp != null ? cp.KiaiMode : false;

            return(new HitCircleTaiko(hitObjectManager, startPosition, startTime, newCombo, soundType, kiai));
        }
Esempio n. 10
0
 internal abstract Slider CreateSlider(Vector2 startPosition, int startTime, bool newCombo,
                                       HitObjectSoundType soundType, CurveTypes curveType, int repeatCount, double sliderLength, List <Vector2> sliderPoints, List <HitObjectSoundType> soundTypes, int comboOffset,
                                       SampleSet sampleSet, SampleSet addSet, List <SampleSet> sampleSets, List <SampleSet> sampleSetAdditions, CustomSampleSet customSampleSet, int volume, string sampleFile);
Esempio n. 11
0
        internal override HitCircle CreateSpecial(Vector2 startPosition, int startTime, int endTime, bool newCombo,
                                                  HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            //notice:this type of note is ONLY generated by bms converter or future editor version
            HitCircleManiaHold h = new HitCircleManiaHold(hitObjectManager, hitObjectManager.ManiaStage.ColumnAt(startPosition), startTime, endTime, soundType);

            h.SampleSet          = sampleSet;
            h.SampleSetAdditions = addSet;
            h.CustomSampleSet    = customSampleSet;
            //    h.LoadSample();
            h.SampleVolume = volume;
            h.ProcessSampleFile(sampleFile);
            record(startPosition, endTime);
            densityUpdate(endTime);
            return(h);
        }
Esempio n. 12
0
        internal override Spinner CreateSpinner(int startTime, int endTime, HitObjectSoundType soundType, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            SpinnerMania s;

            s                    = new SpinnerMania(hitObjectManager, startTime, endTime, soundType, ManiaConvertType.ForceNotStack, prevRow);
            s.SampleSet          = sampleSet;
            s.SampleSetAdditions = addSet;
            s.CustomSampleSet    = customSampleSet;
            s.SampleVolume       = volume;
            s.GenerateHitObjects();

            s.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile));
            record(new Vector2(256, 192), endTime);
            densityUpdate(endTime);
            return(s);
        }
Esempio n. 13
0
        internal override Slider CreateSlider(Vector2 startPosition, int startTime, bool newCombo,
                                              HitObjectSoundType soundType, CurveTypes curveType, int repeatCount, double sliderLength, List <Vector2> sliderPoints, List <HitObjectSoundType> soundTypes, int comboOffset,
                                              SampleSet sampleSet, SampleSet addSet, List <SampleSet> sampleSets, List <SampleSet> sampleSetAdditions, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            SliderMania s;

            if (hitObjectManager.Beatmap.PlayMode == PlayModes.OsuMania)
            {
                s                    = new SliderMania(hitObjectManager, startPosition, startTime, soundType, repeatCount, sliderLength, sliderPoints, soundTypes, ManiaConvertType.NotChange, prevRow);
                s.SampleSet          = sampleSet;
                s.SampleSetAdditions = addSet;
                s.CustomSampleSet    = customSampleSet;
                s.SampleVolume       = volume;
                s.GenerateHitObjects();

                s.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile));
                record(startPosition, s.EndTime);
            }
            else
            {
                ControlPoint     cp    = hitObjectManager.Beatmap.ControlPointAt(startTime);
                ManiaConvertType ctype = ManiaConvertType.None;
                if (cp != null && !cp.KiaiMode)
                {
                    ctype = ManiaConvertType.LowProbability;
                }
                s                       = new SliderMania(hitObjectManager, startPosition, startTime, soundType, repeatCount, sliderLength, sliderPoints, soundTypes, ctype, prevRow);
                s.SampleSet             = sampleSet;
                s.SampleSetAdditions    = addSet;
                s.SampleSetList         = sampleSets;
                s.SampleSetAdditionList = sampleSetAdditions;
                s.CustomSampleSet       = customSampleSet;
                s.SampleVolume          = volume;
                s.GenerateHitObjects();

                prevRow = new bool[hitObjectManager.ManiaStage.Columns.Count];
                if (s.HitObjects.Count > 1)
                {
                    foreach (HitCircleMania hb in s.HitObjects.FindAll(h => h.EndTime == s.EndTime))
                    {
                        prevRow[hb.LogicalColumn] = true;
                    }
                }
                else
                {
                    prevRow[s.HitObjects[0].LogicalColumn] = true;
                }
                s.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile));
                int intv = (s.EndTime - startTime) / repeatCount;
                while (repeatCount-- >= 0)
                {
                    record(startPosition, startTime);
                    densityUpdate(startTime);
                    startTime += intv;
                }
            }
            return(s);
        }
Esempio n. 14
0
        internal override HitCircle CreateHitCircle(Vector2 startPosition, int startTime, bool newCombo,
                                                    HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            HitCircleManiaRow r = null;

            if (hitObjectManager.Beatmap.PlayMode == PlayModes.OsuMania)
            {
                r                    = new HitCircleManiaRow(hitObjectManager, startPosition, startTime, soundType, ManiaConvertType.NotChange, prevRow);
                r.SampleSet          = sampleSet;
                r.SampleSetAdditions = addSet;
                r.CustomSampleSet    = customSampleSet;
                r.SampleVolume       = volume;
                r.GenerateHitObjects();

                r.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile));
                record(startPosition, startTime);
            }
            else
            {
                densityUpdate(startTime);//update before generate notes
                int              delta    = startTime - prevTime;
                double           beatIntv = hitObjectManager.Beatmap.BeatLengthAt(startTime, false);
                ManiaConvertType ctype    = ManiaConvertType.None;
                if (delta <= 80)// more than 187bpm
                {
                    ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.KeepSingle;
                }
                else if (delta <= 95)  //more than 157bpm
                {
                    ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.KeepSingle | currentStair;
                }
                else if (delta <= 105)//140bpm
                {
                    ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.LowProbability;
                }
                else if (delta <= 125)//120bpm
                {
                    ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.None;
                }
                else
                {
                    float        deltaPos = (startPosition - prevPos).Length();
                    ControlPoint cp       = hitObjectManager.Beatmap.ControlPointAt(startTime);
                    if (delta <= 135 && deltaPos < 20)  //111bpm
                    {
                        ctype = ManiaConvertType.Cycle | ManiaConvertType.KeepSingle;
                    }
                    else if (delta <= 150 && deltaPos < 20)  //100bpm stream, forceStack
                    {
                        ctype = ManiaConvertType.ForceStack | ManiaConvertType.LowProbability;
                    }
                    else if (deltaPos < 20 && noteDensity >= beatIntv / 2.5)
                    {
                        ctype = ManiaConvertType.Reverse | ManiaConvertType.LowProbability;
                    }
                    else if (noteDensity < beatIntv / 2.5 || (cp != null && cp.KiaiMode))  //high note density
                    {
                        ctype = ManiaConvertType.None;
                    }
                    else   //low note density
                    {
                        ctype = ManiaConvertType.LowProbability;
                    }
                }
                r                    = new HitCircleManiaRow(hitObjectManager, startPosition, startTime, soundType, ctype, prevRow);
                r.SampleSet          = sampleSet;
                r.SampleSetAdditions = addSet;
                r.CustomSampleSet    = customSampleSet;
                r.SampleVolume       = volume;
                r.GenerateHitObjects();

                prevRow = new bool[hitObjectManager.ManiaStage.Columns.Count];
                foreach (HitCircleMania note in r.HitObjects)
                {
                    prevRow[note.LogicalColumn] = true;
                    if ((ctype & ManiaConvertType.Stair) > 0 && note.LogicalColumn == hitObjectManager.ManiaStage.Columns.Count - 1)
                    {
                        currentStair = ManiaConvertType.ReverseStair;
                    }
                    else if ((ctype & ManiaConvertType.ReverseStair) > 0 && note.LogicalColumn == hitObjectManager.ManiaStage.RandomStart)
                    {
                        currentStair = ManiaConvertType.Stair;
                    }
                    note.ProcessSampleFile(sampleFile);
                }
                record(startPosition, startTime);
            }
            return(r);
        }
Esempio n. 15
0
        public static HitSoundInfo GetLayered(HitObjectSoundType SoundType, SampleSet SampleSet, CustomSampleSet CustomSampleSet, int Volume, SampleSet SampleSetAdditions = SampleSet.None)
        {
            if (SoundType == HitObjectSoundType.None || (SkinManager.Current != null && SkinManager.Current.LayeredHitSounds && BeatmapManager.Current != null && BeatmapManager.Current.PlayMode != PlayModes.OsuMania))
            {
                SoundType |= HitObjectSoundType.Normal;
            }

            return(new HitSoundInfo(SoundType, SampleSet, CustomSampleSet, Volume, SampleSetAdditions));
        }
Esempio n. 16
0
        internal override HitCircle CreateHitCircle(Vector2 startPosition, int startTime, bool newCombo,
                                                    HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            HitCircleOsu c = new HitCircleOsu(hitObjectManager, startPosition, startTime, newCombo, soundType, comboOffset);

            c.SampleSet          = sampleSet;
            c.SampleSetAdditions = addSet;
            c.CustomSampleSet    = customSampleSet;
            c.SampleVolume       = volume;
            c.ProcessSampleFile(sampleFile);
            return(c);
        }
Esempio n. 17
0
 internal abstract HitCircle CreateHitCircle(Vector2 startPosition, int startTime, bool newCombo,
                                             HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile);
Esempio n. 18
0
        internal override Slider CreateSlider(Vector2 startPosition, int startTime, bool newCombo,
                                              HitObjectSoundType soundType, CurveTypes curveType, int repeatCount, double sliderLength, List <Vector2> sliderPoints, List <HitObjectSoundType> soundTypes, int comboOffset,
                                              SampleSet sampleSet, SampleSet addSet, List <SampleSet> sampleSets, List <SampleSet> sampleSetAdditions, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            SliderOsu s = new SliderOsu(hitObjectManager, startPosition, startTime, newCombo, soundType, curveType, repeatCount, sliderLength, sliderPoints, soundTypes, comboOffset);

            s.SampleSet          = sampleSet;
            s.SampleSetAdditions = addSet;

            s.SampleSetList         = sampleSets;
            s.SampleSetAdditionList = sampleSetAdditions;
            s.CustomSampleSet       = customSampleSet;
            s.SampleVolume          = volume;
            s.ProcessSampleFile(sampleFile);

            if (s.sliderStartCircle != null)
            {
                HitSoundInfo hitsoundInfo = s.GetHitSoundInfo(0);
                s.sliderStartCircle.SampleSet          = hitsoundInfo.SampleSet;
                s.sliderStartCircle.SampleSetAdditions = hitsoundInfo.SampleSetAdditions;
            }

            return(s);
        }
Esempio n. 19
0
 internal abstract Spinner CreateSpinner(int startTime, int endTime, HitObjectSoundType soundType, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile);
Esempio n. 20
0
        internal override Spinner CreateSpinner(int startTime, int endTime, HitObjectSoundType soundType, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            SpinnerOsu p = new SpinnerOsu(hitObjectManager, startTime, endTime, soundType);

            p.SampleSet          = sampleSet;
            p.SampleSetAdditions = addSet;
            p.CustomSampleSet    = customSampleSet;
            p.SampleVolume       = volume;
            p.ProcessSampleFile(sampleFile);
            return(p);
        }
Esempio n. 21
0
        internal override Slider CreateSlider(Vector2 startPosition, int startTime, bool newCombo,
                                              HitObjectSoundType soundType, CurveTypes curveType, int repeatCount, double sliderLength, List <Vector2> sliderPoints,
                                              List <HitObjectSoundType> soundTypes, int comboOffset, SampleSet sampleSet, SampleSet addSet, List <SampleSet> sampleSets, List <SampleSet> sampleSetAdditions, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            ControlPoint cp   = hitObjectManager.Beatmap.ControlPointAt(startTime + 5);
            bool         kiai = cp != null ? cp.KiaiMode : false;

            return(new SliderTaiko(hitObjectManager, startPosition, startTime, newCombo, soundType, curveType, repeatCount, sliderLength, sliderPoints, soundTypes, kiai));
        }
Esempio n. 22
0
        internal override HitCircle CreateSpecial(Vector2 startPosition, int startTime, int endTime, bool newCombo,
                                                  HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
        {
            HitCircleHold h = new HitCircleHold(hitObjectManager, startPosition, startTime, newCombo, (soundType & HitObjectSoundType.Whistle) > 0, (soundType & HitObjectSoundType.Finish) > 0,
                                                (soundType & HitObjectSoundType.Clap) > 0, 0);

            h.SampleSet          = sampleSet;
            h.SampleSetAdditions = addSet;
            h.CustomSampleSet    = customSampleSet;
            h.EndTime            = endTime;
            h.SampleVolume       = volume;
            h.ProcessSampleFile(sampleFile);
            return(h);
        }
Esempio n. 23
0
 internal override HitCircle CreateSpecial(Vector2 startPosition, int startTime, int endTime, bool newCombo,
                                           HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile)
 {
     return(null);
 }
Esempio n. 24
0
        internal EventTriggerHitSound(string description)
        {
            string remainingDescription = description;

            // Main and additions sample sets
            SampleSet parsedSampleSet;

            if (EnumHelper.TryParseStartsWith(remainingDescription, out parsedSampleSet) &&
                parsedSampleSet != SampleSet.None)
            {
                SampleSet            = parsedSampleSet;
                MainSampleSetDefined = true;
                remainingDescription = remainingDescription.Substring(SampleSet.ToString().Length,
                                                                      remainingDescription.Length - SampleSet.ToString().Length);

                // Additions

                if (EnumHelper.TryParseStartsWith(remainingDescription, out parsedSampleSet) &&
                    parsedSampleSet != SampleSet.None)
                {
                    SampleSetAdditions        = parsedSampleSet;
                    AdditionsSampleSetDefined = true;
                    remainingDescription      = remainingDescription.Substring(SampleSetAdditions.ToString().Length,
                                                                               remainingDescription.Length - SampleSetAdditions.ToString().Length);
                }
            }

            // Sound type
            HitObjectSoundType parsedSoundType;

            if (EnumHelper.TryParseStartsWith(remainingDescription, out parsedSoundType) &&
                parsedSoundType != HitObjectSoundType.None && parsedSoundType != HitObjectSoundType.Normal)
            {
                SoundType            = parsedSoundType;
                remainingDescription = remainingDescription.Substring(SoundType.ToString().Length,
                                                                      remainingDescription.Length - SoundType.ToString().Length);
            }

            // Custom sample set
            int parsedSampleSetIndex;

            if (Int32.TryParse(remainingDescription, out parsedSampleSetIndex))
            {
                CustomSampleSet      = (CustomSampleSet)parsedSampleSetIndex;
                CheckCustomSampleSet = true;
            }

            // Make trigger descriptions have more intuitive results:
            // - HitSoundDrumWhistle refers to the whistle addition being from the drum sampleset,
            //   if you'd wanted a trigger on a drum sampleset + any whistle addition (uncommon), you'd use HitSoundDrumAllWhistle
            if (SoundType != HitObjectSoundType.None && MainSampleSetDefined && !AdditionsSampleSetDefined)
            {
                SampleSetAdditions = SampleSet;
                SampleSet          = SampleSet.All;

                MainSampleSetDefined      = false;
                AdditionsSampleSetDefined = true;
            }

            // Check that the description is valid
            if (!ToString().Equals(BaseTriggerGroup.ToString() + description))
            {
                throw new Exception("Invalid hitsound trigger description after " + ToString());
            }
        }