Following Changes have been made:
1. Using GenerateMappings() function
2. Using the KEY_MAP map to handle events which shortens the code
and adds modularity.
Following changes have been made:
1. Moving the getMusicDirectory() to config package
2. Moving the config.go to config package
3. Generating a Function Map that will be used for Generating keymappings in main.go
4. Using the config packge in main.go
5. First we are reading the user configuration values with
config.ReadConfig() and then we are reading the mappings with
config.ReadMappings() with the help of Function Map that is
generated.
- 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
Using Switch case for mappings and removed Cycling
The Feature of Cycling through all the windows now seems useless instead
I am assigning each of the windows a number and one can cycle through
them using the number keys.
Also now the default window is the playlist window instead of the files
tab. The mappings are separated with the help of the global boolean value
InPlaylist
Heavy Refactoring is needed for this. The Required Mappings have been
added and the Delay in keyboard input has been fixed. The Delay in
keyboard input was due to Queueing the events ( although it was a go
routine ). The Solution was to use just Draw() Method from tview.Application.
Decided to Go with tview package for building TUIs and
just added the basic layout of the app.
The Idea is to have a side menu to navigate between the other options.
Just like spotify-tui ( Which has taken inspiration from the orignal
spotify Client) and Having a progress bar at bottom ( Still figuring out
how to implement this )