Image is now resized according to the font size and also a new
globals.go files is added which contains all the globals.
the Image width can also be changed according to use by adding or
substracting pixels to it by changing the globals
IMAGE_WIDTH_EXTRA_X, IMAGE_WIDTH_EXTRA_Y
Also, now there is no need to specify where the music directory is
the mpd.conf file in `~/.config/mpd/` is automatically parsed for music
directory
As specified in #2 the image gets out of the preview box, the previous
commit solves the problem but the image placement in the box differs
from terminal to terminal it might need some extra padding so user can
define some extra padding in the render.go
the position is now calculated with the help of font_pixel_width and
font_pixel_height
font_pixel_width = Total X Pixels / Total Columns
font_pixel_height = Total Y Pixels / Total Rows
which is then multiplied to row and column co-ordinates of preview box to get it's
pixel position.
render.go : This File Contains the implementation for the Renderer which
is a channel that will receive strings to the path of decoded images)
the path is sent with the help of Send() method. The Start() method
starts the go routine OpenImage() this function blocks the image as it
keeps listening over the channel. which helps in not drawing the image
again and again.
imageUtils.go: This file contains the helper function for decoding
images.
`https://gitlab.com/diamondburned/ueberzug-go` is a go implementation of
ueberzug. Also The Cover Art is being retrived through the metadata
parser from `dhowden` called `tag`.
There are two ways the information is shown if the Node is a directory
then the relativePath is shown else the attributes of the song are
shown.
For this Layout ( song attributes ) We can divide the Screen three Part
| Title | Artist | Album |
| | | |
| | | |
| | | |
| | | |
~~~~~~~~~~~~~ Screen Width ~~~~~~~~~~~~~~~~~~~~~~
if the length of each of the attribute is less than ( Screen Width / 3 )
then we can add spaces to the end else we can shorten the string to
fit into the screen width
this functionality is done with the help of `getFormattedString()`
- Added A new Struct Application which has all the other components as
its fields
-- the `newApplication()` Function returns a pointer to the newly
created Application from which other fields can be accessed. The
fields are as follows
| App *tview.Application
| expandedView *tview.Table
| Navbar *tview.Table
| searchBar *tview.Table
| pBar *progressBar
- Minor changes to main.go