Commit Graph

52 Commits

Author SHA1 Message Date
aditya-K2 4ae005cbe7 No need to use globals as a separate package to avoid import cycles 2022-09-02 01:25:33 +05:30
aditya-K2 49c691e04e Fixes: Nil Reference when Sending Notifications
Also Handling illegal presses in specific Views (PlaylistView,
Searchview)
2022-09-01 00:15:38 +05:30
aditya-K2 ff74bf02ba Initial Implementation of Views 2022-08-31 23:42:15 +05:30
aditya-K2 5ff27748ae Merge branch 'master' into refactor 2022-08-31 15:19:13 +05:30
aditya-K2 d7be3e201d Added Functionality to Specify Different Type of Connections e.g a Unix Socket 2022-08-31 11:28:02 +05:30
aditya-K2 429db5b1e7 Moved notify package 2022-08-29 11:04:12 +05:30
aditya-K2 73982220a6 workaround for #26 2022-08-04 03:34:04 +05:30
aditya-K2 426e9eb919 Added Exception for j, k (down, up) in the playlist view 2022-04-05 23:32:29 +05:30
aditya-K2 43a7a5c010 Better Error Handling & Explanatory Notifications
fix: Earlier using the `showParentContent` function in playlist
view caused the whole view to freeze now it has been fixed.
2022-03-16 02:49:02 +05:30
aditya-K2 719a659df6 Better Error Handling 2021-12-31 15:48:58 +05:30
aditya-K2 09297a4974 Adding A new Field to the FileNode -> `Title`
Previously During Searching the Connection with mpd client was utilised
to get the title for the files this was slowing the search with large
number of files. Now after adding the Title field to the struct the
Field is accessed instead of querying the server this has lead to faster
searches.

[[ Please Note the Title of a Folder would be the last accessed
track from the FileMap. ]]
2021-12-28 10:32:48 +05:30
aditya-K2 a8ae5fb426 Adding more sensible defaults.
1. After Selection during navigating the folder can be added to the
   playlist now.
2. Also Binded Escape to quit the BuffSearchView
2021-12-26 19:23:58 +05:30
aditya-K2 175b694a4d Implementing Simple Buffer Searching
Searching the Global Database although is enough but I have felt a need to have a
quick and fast search option to search the current buffer.

Buffer Search is also one of the views It can be only turned on if the File Browser
has focus. ( Thinking of making it global ). The Searching is done
through the fuzzy module. FileNode now implements the Source Interface.
The Changed Function of the Search Bar checks for text changes and then
modifies the Matches Variable which is used by the Update Function to
Draw the Results. The Results have the Matching Characters Highlighted
Differently. Maximum of 15 results are displayed to avoid lag. Upon
Selecting the Result through the Search Bar navigation is possible and
selection of the item is done the same way it works for file Browser.
After Selection the Focus is returned Back to the File Browser. For The
Tracks only the title is used for searching.
2021-12-26 00:18:23 +05:30
aditya-K2 0118886d5e chore: Added More Informative Comments 2021-12-24 15:46:42 +05:30
aditya-K2 f56eb1cf1f Removing Globals
Globals are no longer needed instead I am connecting each part with (
what were previously ) globals. Also Renaming SetRenderer to
ConnectRenderer which describes the name more precisely
2021-12-23 20:20:27 +05:30
aditya-K2 b587f5acfd moving notification to notification package inside ui 2021-12-23 00:16:07 +05:30
aditya-K2 33603e1450 Better Focusing Model
Previously I was using the InsidePlaylist and InsideSearchView boolean
values which was a very hacky and unscalable way. Instead I am using a
focus map which can be queried to check which view has focus. Also the
Pages Implementation is kind of on hold because it has a lot of problems
for e.g resizing doesn't seem to work as I imagined. I am keeping that
Idea on hold right now.
2021-12-22 23:49:16 +05:30
aditya-K2 6390039ea9 moving lastfm.go render.go imageUtils.go to the new render package 2021-12-22 21:19:37 +05:30
aditya-K2 6b7fff82b7 minor changes in formatting 2021-12-22 20:42:05 +05:30
aditya-K2 0d9227e019 moving app.go progressbar.go to the new ui package 2021-12-22 20:39:01 +05:30
aditya-K2 a54bfc4948 moving client.go filebrowser.go to the new client package 2021-12-22 19:56:57 +05:30
aditya-K2 d1306f194f Making r (Renderer) Global RENDERER 2021-12-22 17:54:14 +05:30
aditya-K2 ae1b05c203 RENAME : goMP -> gomp
Renaming goMP to gomp as it feels kind of awkward to have two upper case
letters in a name of cli program.
2021-12-17 01:06:18 +05:30
aditya-K2 9b60cbc98e Moving utils.go to utils package 2021-12-13 01:35:40 +05:30
aditya-K2 10566d87a1 No Need to Load and Write Cache now. 2021-12-09 02:30:59 +05:30
aditya-K2 baa063a712 Implementing the library 2021-11-28 23:33:34 +05:30
aditya-K2 2a2e6336e4 Implementing the previous commit
In main.go we are setting the default image path.
and whenever we don't find the image through lastfm we pointhepath to
default image in render.go
2021-11-26 22:02:20 +05:30
aditya-K2 68ef09544c Doing Cache Related Initilisations and Setup 2021-11-20 21:47:29 +05:30
aditya-K2 7f1c3f7c55 Simple Implementation of Searching.
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.
2021-11-16 20:53:22 +05:30
aditya-K2 41c77722e9 Change in Formatting 2021-11-16 00:14:00 +05:30
aditya-K2 a5268a6754 Simple Implementation of Search 2021-11-15 16:32:59 +05:30
aditya-K2 eca4cc47f9 Rename notificationServer -> NOTIFICATION_SERVER
making notificationServer global as other services might need access to
it.
2021-11-14 12:02:36 +05:30
aditya-K2 8f995c2357 Minor changes 2021-11-14 01:31:17 +05:30
aditya-K2 b01deba484 Utilising the Notification Server
Following Changes have been made:

1. UI is now global
2. Simple Notifications are sent when some events are called.
2021-11-13 23:53:59 +05:30
aditya-K2 dbfc617037 Rename Application Fields 2021-11-13 16:57:54 +05:30
aditya-K2 e4ed3bbab7 Rename conn -> CONN ( Also made it Global )
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.
2021-11-13 11:32:00 +05:30
aditya-K2 4623f0d63c RENAME kMap -> FUNC_MAP
this naming makes more sense
2021-11-12 14:06:51 +05:30
aditya-K2 3492ec9349 Using the KEY_MAP map for handling events
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.
2021-11-11 23:30:40 +05:30
aditya-K2 602fc193fc minor changes 2021-11-11 22:30:14 +05:30
aditya-K2 1572a460b0 Making a config package for Generating keymappings
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.
2021-11-11 21:57:01 +05:30
aditya-K2 af9b9a1c0a Delete selected song from Playlist.
Now, Pressing d deletes the selected song.
2021-11-06 19:25:23 +05:30
aditya-K2 a365ca8c08 minor changes 2021-11-05 14:47:27 +05:30
aditya-K2 5ad7b90844 Added a config parser
Add a config.yml/config.toml file to $HOME/.config/goMP/ so that user
configurations are read.
2021-11-05 12:40:46 +05:30
aditya-K2 3ad3e58019 Image Previews Implementation 2021-10-24 13:26:10 +05:30
aditya-K2 46d721ffb4 pressing q now quits out of the application 2021-10-24 01:33:20 +05:30
aditya-K2 e137dc6c1e added Draw Function for expanded View
The Draw function is decided with the help of the InsidePlaylist boolean
value.
2021-10-18 12:18:51 +05:30
aditya-K2 e84e317079 Refactored the Startup Setup into A new Struct
- 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
2021-10-18 08:13:21 +05:30
aditya-K2 c6d2e8d8af Added Playlist Functionality
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
2021-10-18 07:51:57 +05:30
aditya-K2 11eb7c35b6 Working Prototype for the Files Navigation
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.
2021-10-17 22:30:57 +05:30
aditya-K2 0b08b284ab Refactoring of the Components
To Achieve focus functionality we need to separate each of this
Components so I have extracted the Components out.
2021-10-14 22:04:16 +05:30