Vortac
Vortac
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
Thanks!
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
I'm confused. My original switch statement used my own enum, which kept the implementation separate
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
Another thing is to access it inside my UI, it seems I need to modify my ISoundEngine interface to add
PlaybackState PlaybackState { get; }
PlaybackState PlaybackState { get; }
Which adds a dependency on SoundFlow to my Interface. Shouldn't I try to avoid that?
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
Saying it cannot resolve symbol
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
I had tried that, but then the switch case doesn't work:
case PlaybackState.Playing:
case PlaybackState.Playing:
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
On the switch statement, I'm getting a cannot resolve error on PlaybackState
switch (_player.PlaybackState)
switch (_player.PlaybackState)
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
Ahh, thank you!
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
private readonly MiniAudioEngine _soundEngine;
private SoundPlayer _player;
public string LastFileOpened { get; set; }

public PlaybackState? => _player?.PlaybackState;
private readonly MiniAudioEngine _soundEngine;
private SoundPlayer _player;
public string LastFileOpened { get; set; }

public PlaybackState? => _player?.PlaybackState;
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
.NET 8.0
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
I'm getting an unexpected token on the nullable ? and a Cannot resolve symbol '_player' error
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
I'd like to try and keep the UI separate from the implementation
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
I created the enum so I could manage the playbackstate from my UI
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
How can I expose the playback state to the UI? Right now, my UI class takes an IPlayer instance, with SoundEngine being the implementation. The actual player is a third-party library initialized inside SoundEngine
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
Enums
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
SoundEngine is accessed from a Terminal user interface controlled by a class called Tui
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
52 replies
CC#
Created by Vortac on 3/12/2025 in #help
Dependency Injection Question
Here's my SoundEngine class: https://paste.mozilla.org/PUT8LaoC
52 replies
CC#
Created by Vortac on 3/11/2025 in #help
IDisposable Constructor Injection
Thank you!
4 replies
CC#
Created by Vortac on 3/2/2025 in #help
Using IDisposable in private field
I have it working using a Windows-only sound library, but when I try to use a newer cross-platform library I don't get any playback
12 replies