Local Media Player Notes

Goal: Create a full fledged music player from mostly scratch using Java.


Entries



12/12/2025

Its been a while since the last entry. Almost done with classes this semester and then I'll have a bit more time to work on this before I go back into the school grind again this spring. Today I'm writing because I ran into an interesting situation today. I was preparing to restrict the user's ability to add directories, by making it such that the only means to do so is through the application. Since I've transitioned to TDD I was thinking about edge cases, and came up with the case where the user removes a directory with songs in multiple playlists. Would I want those songs removed from the playlists as well? Well to do that I'd need to remove the associated songs from the main music library, and then I'd need to remove all the songs from each playlist that contained them. I could have each music item object keep track of what playlists they're in, and then after identifying all the music objects to be removed from the library, call a 'removeFromAllPlaylists' method for each song. However, this solution wouldn't scale to extremely large libraries with 100+ playlists. At this point I decided to look at MusicBee and Spotify to see how they manage playlists.

After testing, I determined that if a song is removed from the music library, in MusicBee, the playlist associated with the song still contains the song, and plays it with no issues. Both Spotify and MusicBee treat the playlists as separate and independent from the complete music library. That makes file relinking in the case of moves way easier. The only thing that matters are the paths. The playlists keeps the paths and when a song is played, test if the song still exists at the path specified: it doesn't? Send an error and flag the song as offline until the user relinks. It does? Then play.

Regarding the song's displayed name in the music player, keeping an internal name would be a lot more work than just reading and writing from the song's metadata only, as MusicBee seems to do.

Once again I have a clearer idea of where I need to go, and I'm also taking a different approach to the rest of the project. I'm going to study different music players to guide the design of this one. I think trying to go about it from complete scratch isn't a terrible idea but research is so useful and saves a lot of time. As I build my domain knowledge I guess it's called, I'll be able to make better decisions on what I want to keep/implement, what tradeoffs I want to make with different features, etc. For now, it's time to research!

11/30/2025

Thought more about what I want to leave with after completing this project and thought learning how to use JUnit and trying out TDD would be a good idea. I'm refactoring the project again, and once again, with a better idea of what needs to happen. Right now I'm going through and adding tests for all the methods I've got so far while also removing any I think I don't need or could be placed somewhere else. I've gotten a better handle on how the stream API works and got that working to check if any songs in a user's library have been unlinked, deleted, etc. Changed the structure of this wiki too. Will probably just use it mainly for entries, goals, and my design map. Everything else I've just been writing out on paper and keeping notes with me but it changes so often I don't want to keep updating it here.

I haven't really built out anything so far but I'm seriously starting to get an appreciation for the development of any large software systems in general. Coming from a motion design background, I had gotten to a point where I could look at projects and have some idea of how animations were done, or how I could replicate it. Programming, up until about 15 commits ago has felt kind of black boxish in comparison, even though I've taken multiple CS related classes. I've recently started watching streams of devs building out desktop applications, apps and websites over hours, planning and all, and I'm just now even beginning to develop any sort of "eye" or "taste" for software design. Not that I have any preferences yet, but I have a way clearer view of how much I don't know and need to learn.

11/26/2025

Changing the frequency of these entries to once a week or every couple sessions instead of EVERY session. The ideas I have about how to approach this project change on the daily and I feel like spending time documenting each change wouldn't be a good use of time. So I'm only gonna add one of these when I make a lot of changes or finish some feature. Today I tried implementing really basic config file functionality. That turned into reading about how Java I/O streams work and what buffered streams are. I can now add directories to a file, next up is reading from that config file and then going through each directory in the text file for music objects. Once again the code is getting messy so I'm going to refactor some of it when I logon next time. I changed the design plan for the music player a bit; instead of I'm just treating playlists as a different mechanism by which to sort music objects in the display area. In the same way the user will be able to sort by rating, artist, name, times played, etc, the playlist is just another means to sort the library. Before I was thinking of it as something separate but its just an order of paths at the end of the day. Also changing my approach to this project a bit. I think I have a decent layout for how things could go so I'm gonna spend a little less time planning everything out and just code to see what happens. Next time I write one of these will be when I've gotten to creating the Music class and/or MusicLibrary class.

11/20/2025

Made some decent progress today I think. I thought some more about the system design and started writing very early class descriptions. As I was thinking about everything I'd need to implement today it dawned on me....this is an insane first project. I'm not letting that stop me though I fully intend on getting it completed EVENTUALLY. There are a lot of moving parts here and I haven't even begun to think about audio playback or device management, volume control, etc. I want to try and see if I can write some of those myself without a library. Good opportunity to get familiar with how audio programming even works when we cross that line eventually. I'm definitely going to have to use serialization here. It was brought up for like one class in my CS2 class a year ago and I remember asking the professor the use case for it. I can store objects and all the data they hold in a file, so then I don't have to recreate it each time I launch the program. That's going to be incredibly important for loading the user's MusicLibrary whenever the program launches each time. I reorganized the wiki page and added a system design map to the document. That was also really helpful in organizing my thoughts and how I'm thinking about the program at the moment. I'll be updating it whenever I make adjustments so it'll be possible to see a progression through the git commits. I said this session I'd be working on the config retrieval but I ended up doing more planning, so next time WE ARE coding. I actually really really REALLY want to code now but I want to get some complete draft first. We're almost there though and once that's completed we can really get started and see how completely wrong we were.

11/19/2025

Started fleshing out the system design for the program a bit. I wasn't sure how to start, so I made up a scenario of a first time use. What would need to happen? What files need to be created? How will different objects and classes interact with each other? Writing out a scenario and detailing what would be happening in the background has made it a lot more clear what I need to do. I was thinking about the program earlier in the day and I think, along with cool visualizations, I also want to have a mode for slick animations that play whenever we get to the next song. Something that allows me to use my motion graphic skills and also because at least in my head right now it seems like a sick idea. I also have ideas for UI that suit my specific tastes at the very least. Once again these will be further down the line but I have some ways I can make this music player stand out a little bit. There's still some more planning to do but the next thing I want to implement is just storing my directory in a file and reading from it when I launch the program again. That'll be the beginning and where we really start from. When going about writing the background details in the scenario I created, I was thinking this may be an opportunity to use Java serialization? I need a way to store the user's Music Library and load it up everytime. I'll have to look into caching and see how that's done because I think loading the whole library every time we launch would be pretty slow and extra work for no reason.

11/16/2025

Completed the music file retrieval process today. The Files and Path classes are super helpful. I think most of what I'll need for directory access will be there. Now that this part of the program is done I think the next part is figuring out the actual structure I want to have for this program. Once again I'm not worrying about UI yet, at this point, I'm just working out how the data is gonna be manipulated and stored. I'll just be adding more to the TASKS section of this document and also create a new SYSTEM design section next session. Before I close off tonight gonna try to clean up the code I have written since it's getting a bit messy. Gonna be looking at a few music players I've got on my PC to figure out what kind of absolute basic features I want to have before expanding to the cooler stuff down the line, like visualizations.

11/11/2025

Alright a little more complicated than we thought. I'm trying to "stretch my capacity" and do things a little differently this time around by trying to use AI as little as possible. I'm reading documentation only then testing and adjusting based on what screws up. Today I figured out how to validate whether a given string is a valid directory. I'm immediately getting a better hands-on understanding of how OOP works. I needed to convert the string into a Path, so that I could use that Path in the Files method that returns a boolean if the Path is a directory. Noticed I was copy and pasting a lot so I made methods for those. Its only Day 1 of actually coding it out and I already just want to keep going. I didn't consider the case where someone inputs a string with spaces in between the characters, so I'm going to add a check for that later. Of course, when I get to the UI part, then this feature I'm implementing will be a popup box where they just click and choose a directory as in normal programs. I'm just getting the basic functionality down, seeing what data I'll need and how it needs to be processed, and THEN, when everything is solid, I'll start the UI design. It's getting late so I have to stop here.



Current Tasks



PENDING


IN PROGRESS


COMPLETED




Design Thoughts



Design Map (as of 11.26.2025)

Scenarios


Launching Music Player First Time

  1. Open the program for the first time and link my local music directory to the program
  2. See entire music library in viewport
  3. I click on a song and play it.
  4. From the viewport, I create a new playlist from one of the songs in my library.
  5. Sort my music library
  6. Close the program