public TestSceneTauPlayfield() { TauBeatmap beatmap; AddStep("set beatmap", () => { Beatmap.Value = CreateWorkingBeatmap(beatmap = new TauBeatmap()); beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 }); Beatmap.Value.Track.Start(); }); AddStep("Load playfield", () => SetContents(_ => new TauPlayfield(Beatmap.Value.BeatmapInfo.Difficulty) { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(0.6f), FillAspectRatio = 1, FillMode = FillMode.Fit })); DllResourceStore dllResourceStore = new DllResourceStore(DynamicCompilationOriginal.GetType().Assembly); foreach (var resource in dllResourceStore.GetAvailableResources()) { Console.WriteLine(resource); } }
public override void SetUp() { using (var resources = new DllResourceStore(typeof(TestResources).Assembly)) using (var archive = resources.GetStream("Resources/Archives/241526 Soleily - Renatus.osz")) using (var reader = new ZipArchiveReader(archive)) reader.GetStream("Soleily - Renatus (Gamu) [Insane].osu").CopyTo(beatmapStream); }
private void load(AudioManager audio) { var dllStore = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll"); metricsSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore <byte[]>(dllStore, "Resources/metrics_skin"), audio, true); defaultSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore <byte[]>(dllStore, "Resources/default_skin"), audio, false); specialSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore <byte[]>(dllStore, "Resources/special_skin"), audio, true); }
public TrackBassTest() { Architecture.SetIncludePath(); // Initialize bass with no audio to make sure the test remains consistent even if there is no audio device. Bass.Init(0); resources = new DllResourceStore("osu.Framework.Tests.dll"); }
private void load(AudioManager audio, SkinManager skinManager) { var dllStore = new DllResourceStore(typeof(SkinnableTestScene).Assembly); metricsSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore <byte[]>(dllStore, "Resources/metrics_skin"), audio, true); defaultSkin = skinManager.GetSkin(DefaultLegacySkin.Info); specialSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore <byte[]>(dllStore, "Resources/special_skin"), audio, true); oldSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore <byte[]>(dllStore, "Resources/old_skin"), audio, true); }
public void Setup() { // Initialize bass with no audio to make sure the test remains consistent even if there is no audio device. Bass.Init(0); resources = new DllResourceStore(typeof(TrackBassTest).Assembly); track = new TrackBass(resources.GetStream("Resources.Tracks.sample-track.mp3")); updateTrack(); }
public void Setup() { // Initialize bass with no audio to make sure the test remains consistent even if there is no audio device. Bass.Init(0); resources = new DllResourceStore(typeof(TrackBassTest).Assembly); sampleFactory = new SampleBassFactory(resources.Get("Resources.Tracks.sample-track.mp3")); sample = sampleFactory.CreateSample(); updateSample(); }
public TrackBassTest() { Architecture.SetIncludePath(); // Initialize bass with no audio to make sure the test remains consistent even if there is no audio device. Bass.Init(0); var resources = new DllResourceStore("osu.Framework.Tests.dll"); var fileStream = resources.GetStream("Resources.Tracks.sample-track.mp3"); track = new TrackBass(fileStream); }
private void load(AudioManager audio, SkinManager skinManager, OsuGameBase game) { var dllStore = new DllResourceStore(DynamicCompilationOriginal.GetType().Assembly); metricsSkin = new TestLegacySkin(new SkinInfo { Name = "metrics-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/metrics_skin"), audio, true); defaultSkin = new DefaultLegacySkin(new NamespacedResourceStore <byte[]>(game.Resources, "Skins/Legacy"), audio); specialSkin = new TestLegacySkin(new SkinInfo { Name = "special-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/special_skin"), audio, true); oldSkin = new TestLegacySkin(new SkinInfo { Name = "old-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/old_skin"), audio, true); }
public BassTestComponents(bool init = true) { if (init) { Init(); } Mixer = CreateMixer(); Resources = new DllResourceStore(typeof(TrackBassTest).Assembly); TrackStore = new TrackStore(Resources, Mixer); SampleStore = new SampleStore(Resources, Mixer); Add(TrackStore, SampleStore); }
private void load(AudioManager audio, SkinManager skinManager) { var dllStore = new DllResourceStore(GetType().Assembly); metricsSkin = new TestLegacySkin(new SkinInfo { Name = "metrics-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/metrics_skin"), audio, true); defaultSkin = skinManager.GetSkin(DefaultLegacySkin.Info); specialSkin = new TestLegacySkin(new SkinInfo { Name = "special-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/special_skin"), audio, true); oldSkin = new TestLegacySkin(new SkinInfo { Name = "old-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/old_skin"), audio, true); }
private void load() { var dllStore = new DllResourceStore(DynamicCompilationOriginal.GetType().Assembly); metricsSkin = new TestLegacySkin(new SkinInfo { Name = "metrics-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/metrics_skin"), this, true); defaultSkin = new DefaultLegacySkin(this); specialSkin = new TestLegacySkin(new SkinInfo { Name = "special-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/special_skin"), this, true); oldSkin = new TestLegacySkin(new SkinInfo { Name = "old-skin" }, new NamespacedResourceStore <byte[]>(dllStore, "Resources/old_skin"), this, true); }
public void Setup() { if (RuntimeInfo.OS == RuntimeInfo.Platform.Linux) { // required for the time being to address libbass_fx.so load failures (see https://github.com/ppy/osu/issues/2852) Library.Load("libbass.so", Library.LoadFlags.RTLD_LAZY | Library.LoadFlags.RTLD_GLOBAL); } // Initialize bass with no audio to make sure the test remains consistent even if there is no audio device. Bass.Init(0); resources = new DllResourceStore(typeof(TrackBassTest).Assembly); track = new TrackBass(resources.GetStream("Resources.Tracks.sample-track.mp3")); updateTrack(); }
private static Skin getSkinFromResources(SkinManager skins, string name) { using (var storage = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll")) { var tempName = Path.GetTempFileName(); File.Delete(tempName); Directory.CreateDirectory(tempName); var files = storage.GetAvailableResources().Where(f => f.StartsWith($"Resources/{name}")); foreach (var file in files) { using (var stream = storage.GetStream(file)) using (var newFile = File.Create(Path.Combine(tempName, Path.GetFileName(file)))) stream.CopyTo(newFile); } return(skins.GetSkin(skins.Import(tempName).Result)); } }
public void Setup() { try { // Make sure that the audio device is not initialised. if (RuntimeInfo.OS != RuntimeInfo.Platform.Linux) { Bass.CurrentDevice = 0; Bass.Free(); } } catch { } resources = new DllResourceStore(typeof(TrackBassTest).Assembly); sampleFactory = new SampleBassFactory(resources.Get("Resources.Tracks.sample-track.mp3")); sample = sampleFactory.CreateSample(); updateSample(); Bass.Init(0); }