[PR #23] [MERGED] Separate out internal code more cleanly #57

Open
opened 2026-01-30 21:23:12 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aaru-dps/RedBookPlayer/pull/23
Author: @mnadareski
Created: 6/30/2021
Status: Merged
Merged: 6/30/2021
Merged by: @claunia

Base: develHead: player-separation


📝 Commits (10+)

  • 14ce896 Add Windows and Linux build scripts
  • 6f7095a Further separation of code
  • 258b3e9 Fix boundary issues on read
  • ef7cdcb Make console opening Windows + Debug only
  • 06dcf0e Simplify condition check
  • 3755b16 Add build files to solution
  • 8c2a74c Build both debug and release in scripts
  • 0207448 Move GUI code to own namespace
  • 3018b37 Remove unneeded code
  • 93709b8 Fix Settings

📊 Changes

25 files changed (+1184 additions, -1127 deletions)

View changed files

📝 Aaru (+1 -1)
📝 RedBookPlayer.sln (+7 -0)
📝 RedBookPlayer/App.xaml.cs (+1 -0)
RedBookPlayer/Discs/CompactDisc.cs (+406 -0)
RedBookPlayer/Discs/OpticalDisc.cs (+166 -0)
RedBookPlayer/Discs/OpticalDiscFactory.cs (+80 -0)
📝 RedBookPlayer/GUI/MainWindow.xaml (+2 -1)
📝 RedBookPlayer/GUI/MainWindow.xaml.cs (+35 -10)
📝 RedBookPlayer/GUI/PlayerView.xaml (+3 -3)
📝 RedBookPlayer/GUI/PlayerView.xaml.cs (+60 -172)
📝 RedBookPlayer/GUI/PlayerViewModel.cs (+17 -24)
📝 RedBookPlayer/GUI/SettingsWindow.xaml (+1 -1)
📝 RedBookPlayer/GUI/SettingsWindow.xaml.cs (+25 -13)
📝 RedBookPlayer/Hardware/DeEmphasisFilter.cs (+1 -1)
RedBookPlayer/Hardware/Player.cs (+293 -0)
📝 RedBookPlayer/Hardware/PlayerSource.cs (+1 -1)
📝 RedBookPlayer/Hardware/SoundOutput.cs (+69 -62)
RedBookPlayer/HiResTimer.cs (+0 -116)
RedBookPlayer/HiResTimerElapsedEventArgs.cs (+0 -11)
RedBookPlayer/PlayableDisc.cs (+0 -699)

...and 5 more files

📄 Description

This PR does a few major things:

  • Remove as many references as possible to the currently loaded disc from the UI code. This means that nearly all instances where the disc is accessed, it will go through the Player code instead. This is an extension to the previous PR.
  • Separate out audio handling code from the Player code into a new class called SoundOutput. There is only one type of output right now, but either an abstract class or an interface can be created later to make adding different audio handlers possible (fixes #21)
  • Organized classes into more accurate namespaces, named Discs, GUI, and Hardware
    • Discs is the namespace for all supported media, including what used to be PlayableDisc. PlayableDisc has been separated into a base class called OpticalDisc and a specific implementation called CompactDisc
    • GUI is the namespace for all current UI. The intent is that the existing UI may not be the only way that this player can be interacted with in the future. A better solution when that day comes is to separate out the code into separate libraries, not just namespaces
    • Hardware is for "hardware mimicking" parts of the code. This includes player and sound output code currently. If other pieces come in the future, such as the ability to have multiple outputs or effects, they would likely go here.

Aside from the above, the PR also does the following:

  • Add Windows and Linux build scripts while simplifying the csproj a bit
  • Fix more issues found during regression testing, mainly around reading
  • Use the sector size from the current image (fixes #11)
  • Remove the unused HiResTimer class
  • Use the TOC generation code from the latest version of Aaru
  • Enable drag and drop support, which loads the first valid file dropped onto the UI (fixes #9)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aaru-dps/RedBookPlayer/pull/23 **Author:** [@mnadareski](https://github.com/mnadareski) **Created:** 6/30/2021 **Status:** ✅ Merged **Merged:** 6/30/2021 **Merged by:** [@claunia](https://github.com/claunia) **Base:** `devel` ← **Head:** `player-separation` --- ### 📝 Commits (10+) - [`14ce896`](https://github.com/aaru-dps/RedBookPlayer/commit/14ce896567656a083f59ad74c21b4b72b2e4ed68) Add Windows and Linux build scripts - [`6f7095a`](https://github.com/aaru-dps/RedBookPlayer/commit/6f7095a13fd4d87964cf96e3ce2129929aac7fd3) Further separation of code - [`258b3e9`](https://github.com/aaru-dps/RedBookPlayer/commit/258b3e9feea7d0521fd9e3f3cb7f98122b1c5204) Fix boundary issues on read - [`ef7cdcb`](https://github.com/aaru-dps/RedBookPlayer/commit/ef7cdcb2e14e9ee45ce88d99d9e6d5115d1b3060) Make console opening Windows + Debug only - [`06dcf0e`](https://github.com/aaru-dps/RedBookPlayer/commit/06dcf0e0e9070bb0ea9a1d9a7c40cc8eb886bd83) Simplify condition check - [`3755b16`](https://github.com/aaru-dps/RedBookPlayer/commit/3755b168ff75155bc674ee50e05fa98e86b9bba1) Add build files to solution - [`8c2a74c`](https://github.com/aaru-dps/RedBookPlayer/commit/8c2a74c1005c00926df33f2ae619fb8ff730778a) Build both debug and release in scripts - [`0207448`](https://github.com/aaru-dps/RedBookPlayer/commit/0207448d7629036f7a4ebd38083e3d62d1f5fd8a) Move GUI code to own namespace - [`3018b37`](https://github.com/aaru-dps/RedBookPlayer/commit/3018b374ab533f83667c6a269851740edc3754fd) Remove unneeded code - [`93709b8`](https://github.com/aaru-dps/RedBookPlayer/commit/93709b8d286c835d04f673bd890a2e147106bd29) Fix Settings ### 📊 Changes **25 files changed** (+1184 additions, -1127 deletions) <details> <summary>View changed files</summary> 📝 `Aaru` (+1 -1) 📝 `RedBookPlayer.sln` (+7 -0) 📝 `RedBookPlayer/App.xaml.cs` (+1 -0) ➕ `RedBookPlayer/Discs/CompactDisc.cs` (+406 -0) ➕ `RedBookPlayer/Discs/OpticalDisc.cs` (+166 -0) ➕ `RedBookPlayer/Discs/OpticalDiscFactory.cs` (+80 -0) 📝 `RedBookPlayer/GUI/MainWindow.xaml` (+2 -1) 📝 `RedBookPlayer/GUI/MainWindow.xaml.cs` (+35 -10) 📝 `RedBookPlayer/GUI/PlayerView.xaml` (+3 -3) 📝 `RedBookPlayer/GUI/PlayerView.xaml.cs` (+60 -172) 📝 `RedBookPlayer/GUI/PlayerViewModel.cs` (+17 -24) 📝 `RedBookPlayer/GUI/SettingsWindow.xaml` (+1 -1) 📝 `RedBookPlayer/GUI/SettingsWindow.xaml.cs` (+25 -13) 📝 `RedBookPlayer/Hardware/DeEmphasisFilter.cs` (+1 -1) ➕ `RedBookPlayer/Hardware/Player.cs` (+293 -0) 📝 `RedBookPlayer/Hardware/PlayerSource.cs` (+1 -1) 📝 `RedBookPlayer/Hardware/SoundOutput.cs` (+69 -62) ➖ `RedBookPlayer/HiResTimer.cs` (+0 -116) ➖ `RedBookPlayer/HiResTimerElapsedEventArgs.cs` (+0 -11) ➖ `RedBookPlayer/PlayableDisc.cs` (+0 -699) _...and 5 more files_ </details> ### 📄 Description This PR does a few major things: - Remove as many references as possible to the currently loaded disc from the UI code. This means that nearly all instances where the disc is accessed, it will go through the `Player` code instead. This is an extension to the previous PR. - Separate out audio handling code from the `Player` code into a new class called `SoundOutput`. There is only one type of output right now, but either an abstract class or an interface can be created later to make adding different audio handlers possible (fixes #21) - Organized classes into more accurate namespaces, named `Discs`, `GUI`, and `Hardware` - `Discs` is the namespace for all supported media, including what used to be `PlayableDisc`. `PlayableDisc` has been separated into a base class called `OpticalDisc` and a specific implementation called `CompactDisc` - `GUI` is the namespace for all current UI. The intent is that the existing UI may not be the only way that this player can be interacted with in the future. A better solution when that day comes is to separate out the code into separate libraries, not just namespaces - `Hardware` is for "hardware mimicking" parts of the code. This includes player and sound output code currently. If other pieces come in the future, such as the ability to have multiple outputs or effects, they would likely go here. Aside from the above, the PR also does the following: - Add Windows and Linux build scripts while simplifying the csproj a bit - Fix more issues found during regression testing, mainly around reading - Use the sector size from the current image (fixes #11) - Remove the unused `HiResTimer` class - Use the TOC generation code from the latest version of Aaru - Enable drag and drop support, which loads the first valid file dropped onto the UI (fixes #9) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-30 21:23:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/RedBookPlayer#57