handmade.network » Forums » Work-in-Progress » (beebop music player) - Implemented basic (and slow for now) layout system
miked
Michael Dodis
6 posts / 1 project
#17392 (beebop music player) - Implemented basic (and slow for now) layout system
6 days, 12 hours ago Edited by Michael Dodis on Feb. 11, 2019, 7:32 p.m. Reason: Initial post

Hi everyone! I renamed my music player project from Tunedotsh to beebop, since it's going to drastically change in terms of presentation.

In my previous (and first) thread, mrmixer suggested that I should turn it from terminal ui into a lightweight GUI.
mrmixer
Why exactly do you want to make a terminal application if you want to have mouse support ? Wouldn't it be better to make a lightweight GUI ?


You were right. It is actually a lot easier now! I started by implementing a simple layout system, using a simple progress bar ui element for testing (I don't even know why I chose this). Here's a video of the layout system working:


Now, partitioning everything equally is very easy, so next up is having a way to require a max region percentage. This is my first time working on GUI and I really don't want to make it too complicated (I'm planning for base usage at the end of this month).
So any suggestions are welcome and thanks in advance!
mrmixer
Simon Anciaux
535 posts
#17393 (beebop music player) - Implemented basic (and slow for now) layout system
5 days, 13 hours ago Edited by Simon Anciaux on Feb. 12, 2019, 5:52 p.m. Reason: typo

One advice would be to build your UI functions when you specifically need them in your application. Otherwise it's easy to make something that doesn't do what you actually need, or an API that is hard to use for what you need.

Having some code that needs the UI allows you to write the usage code first to get a basic idea of what you need to do. After that writing the simplest code that solve the problem without caring about performance or "clean code" will give you more insight on what actually goes on to solve the problem (and often the simplest thing is good enough for some time).

You can then refine the code better when most of the variables are known. Don't expect to get everything right the first time, nobody does. But it should get better with every iteration.
miked
Michael Dodis
6 posts / 1 project
#17395 (beebop music player) - Implemented basic (and slow for now) layout system
5 days, 9 hours ago

Thanks, that makes a lot of sense! I'll try to setup the audio soon.