Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReproductorSound

This project is designed just to help someone. It's a project with Java Swing, the UI is almost horrible, but the important part is the code. The comments are in spanish but it works perfectly.

This project have three classes:

  • SoundReproductor
  • This is the UI class that handler the interactions with the user. Like select the file, play music and stop it.

  • Reproductor
  • This one manage not just the playback of the wav file but also the volume. This class call SliderProgressBar in order to show the duration of the song, like every music reproductor like YouTube Music, Spotify ...

  • SliderProgressBar
  • As I said before, this class is in charge to move the slider to show wich is the actual duration of the file, so extends Thread to avoid blocking the whole application. This class work independently because it's easier to make it move every second until the final than get every time the actual precise duration of the file. To make this possible SoundReproductor change the maximum value of the slider to the total duration of the file.


    The UI looks like this:

    UI of the application

    As you can see, the Play and Stop buttons are disabled. This is because just when the file is correct the application allows you to do it.

    In addition, the text file change depending on the file. If the file is correct (so it's a wav) the color turns green otherwise it turns red. Like in the following example:

    Wrong file selected Correct file selected

    About

    This project is designed just to help someone. It's a project with Java Swing, the UI is almost horrible, but the important part is the code. The comments are in spanish but it works perfectly. For more info check README

    Resources

    Stars

    0 stars

    Watchers

    1 watching

    Forks

    Releases

    Packages

    Used by

    Contributors

    Languages