Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Melodica Audio Player - Enhanced Logging, Constants, and Playlist UI #1

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

zombocoder
Copy link
Owner

Description:
This PR introduces several improvements to the Melodica console-based audio player, enhancing its user experience and maintainability. The updates include enhanced logging functionality, better code organization through constants, improved user interface elements, and adjustments to the .gitignore and README.

Key Changes:

  1. Logging Improvements:

    • Added logging setup to direct all logs to a melodica.log file.
    • This change aids in tracking playback issues and debugging.
  2. Code Enhancements:

    • Introduced constants for audio settings:
      • SampleRate for audio playback.
      • ChannelNum for stereo settings.
      • BitDepthInBytes for 16-bit audio.
      • BufferSizeInBytes for audio playback buffering.
    • These constants replace hardcoded values, making the code more readable and easier to configure.
  3. User Interface Update:

    • Improved playlist UI by displaying track indices:
      • The playlist now displays tracks in the format [index] track_name, making it easier for users to navigate and identify songs.
    • This change improves the user experience by providing a clearer overview of the playlist.
  4. Configuration Updates:

    • Updated .gitignore to exclude:
      • Binary files, test binaries, coverage outputs, go.work files, and .env files.
      • Common log files like *.log.
    • This change helps keep the repository clean by excluding unnecessary files.
  5. Documentation Improvements:

    • Updated the README:
      • Corrected the installation command to go install github.com/zombocoder/melodica/cmd/melodica@latest.
      • Updated the "Screenshot" section formatting for consistency.
    • These adjustments ensure accurate information for users and contributors.
  6. Minor Adjustments:

    • Refined formatting in main.go for better readability.
    • Changed audio context setup to use constants, improving code clarity and maintainability.

Testing:

  • Verified that the updated logging writes to melodica.log.
  • Confirmed that the playlist displays track indices correctly.
  • Tested audio playback with the adjusted buffer and audio settings to ensure smooth operation.

Notes for Reviewers:

  • Pay special attention to the logging changes and how the constants impact audio playback.
  • Consider the improvements to the playlist UI for better user navigation.
  • The .gitignore updates aim to maintain a cleaner repository—feedback on any additional files to exclude is welcome.

Screenshots/Visuals:
image


This PR aims to improve the overall usability and maintainability of Melodica, offering a better experience for both users and developers. Feedback is appreciated!

@zombocoder zombocoder added the enhancement New feature or request label Nov 8, 2024
@zombocoder zombocoder merged commit 71205f4 into main Nov 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant