This is a very simple Implementation of searching like playlist view
and file view there is an boolean value that is checked in the draw
function to check if whether or not to draw the Search view
Later on I am thinking of rewriting this whole mechanism with pages
which will make this more modular.
The Boolean values are set and unset by the navigation menu and the done
functions.
Following Changes have been made:
1. conn -> CONN
2. CONN is now a global as a lot of functions were requiring it and
passing them as a parameter didn't seem intuitive.
3. In progressBar.go now we are sending only the short path instead of
absolute path.
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 )