Skip to content

Commit be97a04

Browse files
authored
OggStreamer refactor (MonoGame#8747)
I've noticed that ```OpenALSoundController``` had useless references to ```OggStreamer``` (likely from an old refactor). I also moved ```OggStream``` to the Media folder since it is only related to ```Song.NVorbis``` and renamed it to ```OggStream.NVorbis``` to make it more clear what goes with what.
1 parent 338f75d commit be97a04

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
</PackageReference>
2626
<PackageReference Include="MonoGame.Library.SDL" Version="2.32.2.1" />
2727
<PackageReference Include="MonoGame.Library.OpenAL" Version="1.23.1.10" />
28-
<PackageReference Include="NVorbis" Version="0.10.4" />
2928
</ItemGroup>
3029

3130
<ItemGroup>
@@ -45,10 +44,16 @@
4544
<ItemGroup>
4645
<Compile Remove="Graphics\GraphicsAdapter.cs" />
4746
</ItemGroup>
47+
48+
<!-- Song support with Vorbis, depends on OpenAL -->
49+
<ItemGroup>
50+
<PackageReference Include="NVorbis" Version="0.10.4" />
51+
<Compile Include="Platform\Media\OggStream.NVorbis.cs" />
52+
<Compile Include="Platform\Media\Song.NVorbis.cs" />
53+
</ItemGroup>
4854

4955
<ItemGroup>
5056
<Compile Include="Platform\TitleContainer.Desktop.cs" />
51-
<Compile Include="Platform\Audio\OggStream.cs" />
5257
<Compile Include="Platform\Audio\Xact\WaveBank.Default.cs" />
5358
<Compile Include="Platform\Graphics\OpenGL.Common.cs" />
5459
<Compile Include="Platform\Graphics\Texture2D.StbSharp.cs" />
@@ -62,7 +67,6 @@
6267
<Compile Include="Platform\Utilities\ReflectionHelpers.Default.cs" />
6368
<Compile Include="Platform\Media\MediaLibrary.Default.cs" />
6469
<Compile Include="Platform\Media\MediaPlayer.Default.cs" />
65-
<Compile Include="Platform\Media\Song.NVorbis.cs" />
6670
<Compile Include="Platform\Media\VideoPlayer.Default.cs" />
6771
<Compile Include="Platform\Media\Video.Default.cs" />
6872
<Compile Include="Platform\Input\GamePad.SDL.cs" />

MonoGame.Framework/Platform/Audio/OpenALSoundController.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ internal sealed class OpenALSoundController : IDisposable
9292
private const int DEFAULT_FREQUENCY = 48000;
9393
private const int DEFAULT_UPDATE_SIZE = 512;
9494
private const int DEFAULT_UPDATE_BUFFER_COUNT = 2;
95-
#elif DESKTOPGL
96-
private static OggStreamer _oggstreamer;
9795
#endif
9896
private List<int> availableSourcesCollection;
9997
private List<int> inUseSourcesCollection;
@@ -270,9 +268,6 @@ Now use OpenSL ES to create an AudioPlayer with PCM buffer queue data locator.
270268
#endif
271269

272270
_context = Alc.CreateContext(_device, attribute);
273-
#if DESKTOPGL
274-
_oggstreamer = new OggStreamer();
275-
#endif
276271

277272
AlcHelper.CheckError("Could not create OpenAL context");
278273

@@ -386,10 +381,6 @@ void Dispose(bool disposing)
386381
{
387382
if (disposing)
388383
{
389-
#if DESKTOPGL
390-
if(_oggstreamer != null)
391-
_oggstreamer.Dispose();
392-
#endif
393384
for (int i = 0; i < allSourcesArray.Length; i++)
394385
{
395386
AL.DeleteSource(allSourcesArray[i]);
File renamed without changes.

0 commit comments

Comments
 (0)