Merge pull request #19500 from andy840119/remove-nullable-disable-in-the-audio-namespace

Remove nullable disable annotation in audio namespace
This commit is contained in:
Salman Ahmed 2022-08-01 15:59:19 +03:00 committed by GitHub
commit 49ee78babb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 10 additions and 28 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using NUnit.Framework;
using osu.Game.Audio;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Diagnostics;
using ManagedBass.Fx;
using osu.Framework.Audio.Mixing;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
namespace osu.Game.Audio
{
/// <summary>

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic;
namespace osu.Game.Audio

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Skinning;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
@ -18,15 +16,15 @@ namespace osu.Game.Audio
/// Invoked when this <see cref="PreviewTrack"/> has stopped playing.
/// Not invoked in a thread-safe context.
/// </summary>
public event Action Stopped;
public event Action? Stopped;
/// <summary>
/// Invoked when this <see cref="PreviewTrack"/> has started playing.
/// Not invoked in a thread-safe context.
/// </summary>
public event Action Started;
public event Action? Started;
protected Track Track { get; private set; }
protected Track? Track { get; private set; }
private bool hasStarted;
@ -58,7 +56,7 @@ namespace osu.Game.Audio
/// </summary>
public bool IsRunning => Track?.IsRunning ?? false;
private ScheduledDelegate startDelegate;
private ScheduledDelegate? startDelegate;
/// <summary>
/// Starts playing this <see cref="PreviewTrack"/>.
@ -106,6 +104,6 @@ namespace osu.Game.Audio
/// <summary>
/// Retrieves the audio track.
/// </summary>
protected abstract Track GetTrack();
protected abstract Track? GetTrack();
}
}

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
@ -20,9 +18,9 @@ namespace osu.Game.Audio
private readonly BindableDouble muteBindable = new BindableDouble();
private ITrackStore trackStore;
private ITrackStore trackStore = null!;
protected TrackManagerPreviewTrack CurrentTrack;
protected TrackManagerPreviewTrack? CurrentTrack;
public PreviewTrackManager(IAdjustableAudioComponent mainTrackAdjustments)
{
@ -89,8 +87,8 @@ namespace osu.Game.Audio
public class TrackManagerPreviewTrack : PreviewTrack
{
[Resolved(canBeNull: true)]
public IPreviewTrackOwner Owner { get; private set; }
[Resolved]
public IPreviewTrackOwner? Owner { get; private set; }
private readonly IBeatmapSetInfo beatmapSetInfo;
private readonly ITrackStore trackManager;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using System.Collections;
using System.Collections.Generic;
@ -34,7 +32,7 @@ namespace osu.Game.Audio
Volume);
}
public bool Equals(SampleInfo other)
public bool Equals(SampleInfo? other)
=> other != null && sampleNames.SequenceEqual(other.sampleNames);
public override bool Equals(object obj)