Skip to content

Commit 8540aa1

Browse files
committed
formatted
1 parent b0eea26 commit 8540aa1

17 files changed

Lines changed: 131 additions & 50 deletions

File tree

src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella
2222

2323
audioEngine = new AVAudioEngine();
2424
liveSpeechRequest = new SFSpeechAudioBufferRecognitionRequest();
25-
25+
2626
InitializeAvAudioSession(out _);
2727

2828
var node = audioEngine.InputNode;

src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace CommunityToolkit.Maui.Media;
99
public sealed partial class SpeechToTextImplementation
1010
{
1111
[MemberNotNull(nameof(audioEngine), nameof(recognitionTask), nameof(liveSpeechRequest), nameof(getRecognitionTaskCompletionSource))]
12+
[Obsolete]
1213
Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancellationToken)
1314
{
1415
speechRecognizer = new SFSpeechRecognizer(NSLocale.FromLocaleIdentifier(culture.Name));
@@ -22,7 +23,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella
2223

2324
audioEngine = new AVAudioEngine();
2425
liveSpeechRequest = new SFSpeechAudioBufferRecognitionRequest();
25-
26+
2627
InitializeAvAudioSession(out var audioSession);
2728

2829
var mode = audioSession.AvailableModes.Contains(AVAudioSession.ModeMeasurement)
@@ -52,7 +53,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella
5253
{
5354
throw new Exception(error.LocalizedDescription);
5455
}
55-
56+
5657
cancellationToken.ThrowIfCancellationRequested();
5758

5859
var currentIndex = 0;

src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuous
7777
OnRecognitionResultUpdated(args.Result.Text);
7878
}
7979

80-
Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken);
80+
Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken);
8181

8282
async Task<string> InternalListenAsync(CultureInfo culture, IProgress<string>? recognitionResult, CancellationToken cancellationToken)
8383
{

src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.macios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static ValueTask<Stream> GetImageStream(IList<PointF> points, Size imageS
8383
{
8484
throw new InvalidOperationException("Unable to generate image. No Lines Found");
8585
}
86-
86+
8787
return GetUIImage(points, (context, offset) =>
8888
{
8989
foreach (var line in lines)

src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.macios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public override void ViewDidDisappear(bool animated)
6363
overlayView.RemoveFromSuperview();
6464
overlayView.Dispose();
6565
}
66-
66+
6767
base.ViewDidDisappear(animated);
6868
}
6969

src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public MapHandlerWindows() : base(Mapper, CommandMapper)
4040

4141
/// <inheritdoc/>
4242

43+
[Obsolete]
4344
protected override FrameworkElement CreatePlatformView()
4445
{
4546
if (string.IsNullOrEmpty(MapsKey))

src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ namespace CommunityToolkit.Maui.Core.Views;
1212
/// </summary>
1313
public class MauiMediaElement : CoordinatorLayout
1414
{
15+
[Obsolete]
1516
readonly StyledPlayerView playerView;
1617

1718
/// <summary>
1819
/// Initializes a new instance of the <see cref="MauiMediaElement"/> class.
1920
/// </summary>
2021
/// <param name="context">The application's <see cref="Context"/>.</param>
2122
/// <param name="playerView">The <see cref="StyledPlayerView"/> that acts as the platform media player.</param>
23+
[Obsolete]
2224
public MauiMediaElement(Context context, StyledPlayerView playerView) : base(context)
2325
{
2426
this.playerView = playerView;

src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void Dispose()
4242
/// </summary>
4343
protected virtual void Dispose(bool disposing)
4444
{
45-
if(isDisposed)
45+
if (isDisposed)
4646
{
4747
return;
4848
}

src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CommunityToolkit.Maui.Core.Views;
1515

16+
[Obsolete]
1617
public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
1718
{
1819
readonly SemaphoreSlim seekToSemaphoreSlim = new(1, 1);
@@ -25,13 +26,15 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
2526
/// <summary>
2627
/// The platform native counterpart of <see cref="MediaElement"/>.
2728
/// </summary>
29+
[Obsolete]
2830
protected StyledPlayerView? PlayerView { get; set; }
2931

3032
/// <summary>
3133
/// Creates the corresponding platform view of <see cref="MediaElement"/> on Android.
3234
/// </summary>
3335
/// <returns>The platform native counterpart of <see cref="MediaElement"/>.</returns>
3436
/// <exception cref="NullReferenceException">Thrown when <see cref="Android.Content.Context"/> is <see langword="null"/> or when the platform view could not be created.</exception>
37+
[Obsolete]
3538
public (PlatformMediaElement platformView, StyledPlayerView PlayerView) CreatePlatformView()
3639
{
3740
ArgumentNullException.ThrowIfNull(MauiContext.Context);
@@ -56,6 +59,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
5659
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
5760
/// While this method does not seem to have any references, it's invoked at runtime.
5861
/// </remarks>
62+
[Obsolete]
5963
public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters)
6064
{
6165
if (playbackParameters is null)
@@ -78,6 +82,7 @@ public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters)
7882
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
7983
/// While this method does not seem to have any references, it's invoked at runtime.
8084
/// </remarks>
85+
[Obsolete]
8186
public void OnPlayerStateChanged(bool playWhenReady, int playbackState)
8287
{
8388
if (Player is null || MediaElement.Source is null)
@@ -126,6 +131,7 @@ or PlaybackStateCompat.StateSkippingToQueueItem
126131
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
127132
/// While this method does not seem to have any references, it's invoked at runtime.
128133
/// </remarks>
134+
[Obsolete]
129135
public void OnPlaybackStateChanged(int playbackState)
130136
{
131137
if (MediaElement.Source is null)
@@ -160,6 +166,7 @@ public void OnPlaybackStateChanged(int playbackState)
160166
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
161167
/// While this method does not seem to have any references, it's invoked at runtime.
162168
/// </remarks>
169+
[Obsolete]
163170
public void OnPlayerError(PlaybackException? error)
164171
{
165172
var errorMessage = string.Empty;
@@ -251,6 +258,7 @@ protected virtual partial void PlatformPause()
251258
Player.Pause();
252259
}
253260

261+
[Obsolete]
254262
protected virtual async partial Task PlatformSeek(TimeSpan position, CancellationToken token)
255263
{
256264
if (Player is null)
@@ -290,6 +298,7 @@ protected virtual partial void PlatformStop()
290298
MediaElement.Position = TimeSpan.Zero;
291299
}
292300

301+
[Obsolete]
293302
protected virtual partial void PlatformUpdateSource()
294303
{
295304
var hasSetSource = false;
@@ -355,6 +364,7 @@ protected virtual partial void PlatformUpdateSource()
355364
}
356365
}
357366

367+
[Obsolete]
358368
protected virtual partial void PlatformUpdateAspect()
359369
{
360370
if (PlayerView is null)
@@ -471,6 +481,7 @@ protected virtual partial void PlatformUpdateShouldMute()
471481
Player.Volume = MediaElement.ShouldMute ? 0 : volumeBeforeMute;
472482
}
473483

484+
[Obsolete]
474485
protected virtual partial void PlatformUpdateShouldLoopPlayback()
475486
{
476487
if (Player is null)
@@ -483,26 +494,49 @@ protected virtual partial void PlatformUpdateShouldLoopPlayback()
483494

484495
#region IPlayer.IListener implementation method stubs
485496

497+
[Obsolete]
486498
public void OnAudioAttributesChanged(AudioAttributes? audioAttributes) { }
487499
public void OnAudioSessionIdChanged(int audioSessionId) { }
500+
501+
[Obsolete]
488502
public void OnAvailableCommandsChanged(IPlayer.Commands? availableCommands) { }
503+
504+
[Obsolete]
489505
public void OnCues(CueGroup? cueGroup) { }
506+
507+
[Obsolete]
490508
public void OnCues(List<Cue> cues) { }
509+
510+
[Obsolete]
491511
public void OnDeviceInfoChanged(Com.Google.Android.Exoplayer2.DeviceInfo? deviceInfo) { }
492512
public void OnDeviceVolumeChanged(int volume, bool muted) { }
513+
514+
[Obsolete]
493515
public void OnEvents(IPlayer? player, IPlayer.Events? events) { }
494516
public void OnIsLoadingChanged(bool isLoading) { }
495517
public void OnIsPlayingChanged(bool isPlaying) { }
496518
public void OnLoadingChanged(bool isLoading) { }
497519
public void OnMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) { }
520+
521+
[Obsolete]
498522
public void OnMediaItemTransition(MediaItem? mediaItem, int transition) { }
523+
524+
[Obsolete]
499525
public void OnMediaMetadataChanged(MediaMetadata? mediaMetadata) { }
526+
527+
[Obsolete]
500528
public void OnMetadata(Metadata? metadata) { }
501529
public void OnPlaybackSuppressionReasonChanged(int playbackSuppressionReason) { }
530+
531+
[Obsolete]
502532
public void OnPlayerErrorChanged(PlaybackException? error) { }
533+
534+
[Obsolete]
503535
public void OnPlaylistMetadataChanged(MediaMetadata? mediaMetadata) { }
504536
public void OnPlayWhenReadyChanged(bool playWhenReady, int reason) { }
505537
public void OnPositionDiscontinuity(int reason) { }
538+
539+
[Obsolete]
506540
public void OnPositionDiscontinuity(IPlayer.PositionInfo oldPosition, IPlayer.PositionInfo newPosition, int reason) { }
507541
public void OnRenderedFirstFrame() { }
508542
public void OnRepeatModeChanged(int repeatMode) { }
@@ -511,9 +545,17 @@ public void OnSeekForwardIncrementChanged(long seekForwardIncrementMs) { }
511545
public void OnShuffleModeEnabledChanged(bool shuffleModeEnabled) { }
512546
public void OnSkipSilenceEnabledChanged(bool skipSilenceEnabled) { }
513547
public void OnSurfaceSizeChanged(int width, int height) { }
548+
549+
[Obsolete]
514550
public void OnTimelineChanged(Timeline? timeline, int reason) { }
551+
552+
[Obsolete]
515553
public void OnTracksChanged(Tracks? tracks) { }
554+
555+
[Obsolete]
516556
public void OnTrackSelectionParametersChanged(TrackSelectionParameters? trackSelectionParameters) { }
557+
558+
[Obsolete]
517559
public void OnVideoSizeChanged(VideoSize? videoSize) { }
518560

519561
#endregion

src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public MediaManager(IMauiContext context, IMediaElement mediaElement, IDispatche
6363
/// <summary>
6464
/// The platform-specific media player.
6565
/// </summary>
66+
[Obsolete]
6667
protected PlatformMediaElement? Player { get; set; }
6768
#endif
6869

0 commit comments

Comments
 (0)