Commit Graph

62 Commits

Author SHA1 Message Date
aditya-K2
3effda228b Using utils.GetNetwork 2022-09-14 20:42:28 +05:30
aditya-K2
503701691b Change deleteSongFromPlaylist and clearPlaylist 2022-09-14 19:51:06 +05:30
aditya-K2
fdd390a731 Fixing Slow down of Playlists mentioned @ #20
As mentioned at https://github.com/aditya-K2/gomp/issues/20#issuecomment-1142443829

The Slow Down was caused due to constant calls to the MPD Server for
playlist info. Using Watcher to handle playlist event changes.

Also when In SearchView upon adding Artist/Album due to constant change
in playlists there was a slow down. Hence using CommandList for that.
2022-09-13 22:04:39 +05:30
aditya-K2
aee19c1e2f Seek Forward only when playback has been stopped. 2022-09-09 02:00:09 +05:30
aditya-K2
d2e625a4a4 Merge branch 'refactor' into seek 2022-09-09 01:33:28 +05:30
aditya-K2
ba1c6a6898 Rename: CONN -> Conn 2022-09-09 01:33:13 +05:30
aditya-K2
ea3fc105a4 simple seeking implementation 2022-09-09 01:31:51 +05:30
aditya-K2
b2c5575c8b Using fhs/gompd/v2 2022-09-09 00:47:26 +05:30
aditya-K2
7f4e1460b8 minor changes 2022-09-07 11:27:20 +05:30
aditya-K2
7e5df526c3 Removed some Connect Functions, some import cycles remain 2022-09-02 01:30:17 +05:30
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