Skip to main content


Showing posts from 2017

3.0 Work in Progress 13: Cuesheet improvements

Most of the work I've done since the last post has been behind the scenes so there is not too much to show.  I rewrote the audioengine management piece (what handles the interaction with gonemads audioengine, android media player, and chromecast), rewrote the crossfade code, and cuesheet handling.

Cuesheets are something that the majority of gmmp's user base probably does not use, but they are a nice feature.  For those who do not know, a cue sheet allows you to listen to a single large audio file as if it was split up into tracks for each song.  GMMP has always had decent support for CUE files (they would appear as individual tracks in the library views), however in the folder browser they would just appear as a .cue file and the single mp3 / audio file. 

In 3.0, the folder browser will actually extract and list the individual tracks in a CUE instead of the single file.

Below is what the actual folder on disk looks like.  Th…

3.0 Work in Progress 12: File Browser UI

Next up on the new UI list is the file/folder browser.  I also rewrote the file/playlist handling on the backend to be much more streamlined.  A lot used to go on when playing folders and i've greatly simplified that.  As always, the file browser will show anything on the file system and does not care if its in the database or not.  This is great for navigating, but caused a lot of issues when a user went to play a file or folder.  I am sure some were familiar with the issue where songs would "disappear" from the queue after reloading GMMP.  This was because the user played a file that was not scanned into the database.  GMMP would play the file fine in the queue, but when the queue was persisted to the database those files were lost.  In 2.x GMMP would try its best to get everything scanned in by running silent scans of folders as you navigate into them.  While being pretty inefficient, it worked for the most part.  The big issue happened when a user would select a fold…

3.0 Work in Progress 11: Bookmarks, Chrome OS, and Permissions

I recently picked up one of the new Google Pixelbooks and I will say it a pretty awesome development device.  It runs Chrome OS, Android, and Linux all at the same time and has pretty good specs (i5 cpu, 8 gb ram, 128 gb ssd) for running Android Studio.  I am able to code and deploy GMMP right on the same device which makes development really convenient when not at home.   Android apps also run in their own window which can be resized which makes UI testing on different size screens super easy.

In order to support the free form resizing of the app window, I updated the target SDK level to 27 (android 8.1).  GMMP 2.x was still on 21 (android 5.0).  The target SDK update should see some performance improvement in newer devices (although i do not know by how much).  I also added support for the android permission system they added back in 5.1.  GMMP should only ask for storage permission and possibly phone state permission (if you want to use the auto resume after a phone call finishes f…

3.0 Work in Progress 10: Multiple Artists and Genres Per Track

In the last few weeks I've been mostly doing backend work so there arent too many UI changes to show off.  The music service refactor / rewrite has caused me to rewrite a few of the other backend systems (and there will probably be a bunch more that need it to).  Since I was already making so many changes to the data access layer, I decided now would be the best time to basically clean up the whole data model and make the necessary changes to support some of the highest requested features like supporting multiple artists and multiple genres.  These changes led me to rewrite the scanner entirely (I had to do it anyway due to the data access layer changes).  Now the scanner will recognize artists and genres that are delimited by a specific character (";" by default) and set them up in the database accordingly.  Since fields with the ";" in it are a bit ugly.. i do plan on adding some functionality to replace that with "and" or "&" or reall…

3.0 Work in Progress 9: Shuffle and Notifications

The last update I showed off the new queue ui which did involve a complete rewrite of the underlying queue backend code.  Due to that and switching to the new data model (Room-based), I ended up taking the plunge and rewriting the MusicService.  It seemed like a waste to try to hack it up to use all the new stuff I added when I eventually planned on rewriting it anyway.  Due to that I dont have too much to show UI wise, but I did make some queue improvements and redid how shuffle works.

One of the largest complaints I've gotten over the years was the inability to skip back/forward while shuffled and get a consistent track order.  Once you skipped back, the next track would be chosen at random.  My response was always that I understood the frustration but without rewriting shuffle / music service entirely there was not much i could do.  Since I am rewriting the music service and queue, this seemed like the perfect opportunity to fix this issue.

In the video below, it shows off the …

3.0 Work in Progress 8: Queue

Its been awhile since I've posted a new update but I spent a few weeks working on 2.2.4/2.2.5 and now I am back working on 3.0.  This next update focuses on the queue.  Its not finished but it is working enough that I can show it off.

The queue involved a bunch more work than the previous views since I had to rewrite the actual backing queue data structure.  Previously the Queue class would retain its own copy of the tracks and it was in charge of persisting all changes into the database.  This time around I made it much simpler by just keeping everything straight in the database, so the queue and db no longer have to stay in sync.

The queue features drag and drop like the previous version of gmmp, however it is done a bit differently (at least for now pending feedback).  Instead of having the "handle" on the left on each list item that you press to start dragging, dragging is now started via a long press.  The reasoning behind the behavior.. honestly.. is the drag and…


I was finally able to work out some of the sdcard write issues.  I could only reproduce issues when creating playlists, so hopefully that was the only problem.  I also tested with android O (the emulator) and didnt experience any issues, so GMMP should be good to go for 8.0

2.2.4 (08/29/2017):
-Updated google services to 11.0.4
-Updated support libraries to 26.0.0
-Updated compile sdk to Android O
-Fixed bug where keyboard would not show when using a gesture to jump to search
-Play next/prev album now orders by album name instead of by artist (use next/prev album by artist for other behavior)
-Reset anything set to next/prev album to next/prev album by artist
-Notification will now properly update state when queue completes with on queue completion set to default or stop
-Audio focus is now only abandoned when the music service is destroyed
-Fixed audioengine startup race condition deadlock
-Fixed creating new files on sdcard (playlists / downloaded album art)
-Fixed issue where some …

3.0 Work in Progress 7: Fast Scroll & Gestures

The last 2 weeks I added in fast scroll (scroll through long lists fast by dragging down the bar on the right with the letter / number indicator to show where you are in the list) and gestures on now playing and the mini player.

The first up is fast scroll.  This rendition of fast scroll SHOULD be a bit more consistent than the old one in 2.0.  There was a random bug that was very difficult to reproduce that would cause the letters to not match what was showing on the screen.  The fast scroll code is much simpler this time around so i dont expect that bug to be an issue.  The video is a big laggy and the fast scroll in general is not as smooth as i'd like it to be, but that will be worked on once 3.0 gets to beta.

The second feature is the addition of gestures.  All the previous gestures have returned (swipe left right up down / tap / double tap / long press) plus I added in a few more.  New gestures are 2 finger tap/double tap/long press, and a 2 finger pan.  The pan is considere…

3.0 Work in Progress 6: Mini Player

This update mainly focuses on the addition of the mini player to the bottom of the library view (and will also be on other views where it makes sense) but I did also make some improvements in the play / pause animation.

Above shows the new mini player.  Just like every other view so far, the metadata portion will be customizable and you will be able to choose how many buttons are shown.   Right now you can choose between prev track, play/pause, and next track.  I may open it up to some of the other media actions like shuffle / repeat but i havent decided on that yet.

In the WIP4 post I had shown off a little chunk of the code that added a bunch of "behaviors" to a view.  The behaviors contain all the common code for a particular behavior of a UI view.  This allows me to rewrite the same (or very similar) chunks of code for different UIs.  GMMP 1/2.x was loaded with repeated code despite my best efforts to refactor.  Anyway, since the mini player shares a lot of the same abi…

3.0 Work in Progress 5: Library view

In this update I added a library view similar to the one in the old UI.  I also added in an artist list, genre list, and track list tabs.

The big difference with this one is the toolbar will collapse when you scroll down and if you scroll up it will become visible again

Here is a video of it in action

The plan with the library view is to allow the user to choose which views to add to the library (others will end up in the side navigation view if they are not in the library), the title of those views, and their order.  Below is the chunk of code responsible for building the library, its "hardcoded" currently but will be fairly simple to hook up to the preferences.

v.setupAdapter(listOf(BaseFragmentEntry("Artists", ArtistListFragment::class)
                                  , BaseFragmentEntry("Albums", AlbumListFragment::class)
                                  , BaseFragmentEntry("Genres", GenreListFragment::class)

3.0 Work in Progress 4: MultiSelect, Overflow Menu, and Sort

For those who havent noticed, I am trying to do post progess updates every 2 weeks.  This iteration doesnt have too much to actually show off, however a lot of work was done under the hood.  Everything has been wired for easily adding multi select (and its action menu), the overflow menu, and sort.   By "wired" I mean that the majority of the code was written and for each new view I only have to write a few lines of code to add the capabilities and then write the code to handle the actual selected actions.


This is in the album list view's presenter code (couldnt figure out a way to post code so the formatting is a bit weird).  As you can see its not much code at all to add a lot of functionality

override fun onViewAttached() { super.onViewAttached() view?.let {addBehavior(MenuBehavior::class, ViewModeMenuBehavior(, state)) addBehavior(MenuBehavior::class, GridSizeMenuBehavior(, state)) …

3.0 Work in Progress 3: Album Details + Album Grid transitions

The last 2 weeks I've been working on the album details view along with learning how to do transitions between different views.  As mentioned before I'm currently just focusing on the code portion so the actual UIs themselves are not final and still need a lot of work.

This is the current state of the album details view.  Its using the CoordinaterLayout with a collapseable toolbar, so when you scroll up the album art will basically collapse into the toolbar at the top.  I currently like how the album title moves while you scroll up and eventually becomes the title in the toolbar, but im not 100% sure if that is the direction i will go.

Below is a video that shows the transitions between selecting an album from the album grid and opening the album details.  This was recorded on an old galaxy s3 running Lineage OS (7.1.2) so it appears the actual recording is a bit glitchy.  The Image showing over half of the floating action button doesnt actually happen on the device.


3.0 Work in Progress 2: Album Grid

Before I talk about my latest progress I want to reiterate that this is just a work in progress / prototype so nothing shown in the screenshots will be final.  I havent spent too much time on the UIs themselves, but have been focusing on the underlying UI code (presenters / data access / adapters / etc).  I encourage people to give feedback, however just because something is not being shown, does not mean I am getting rid of it.

Recently, google announced a bunch of new architecture libraries and since I was in the middle of some major rework, I decided to go ahead and start adapting GMMP to use these new libs.

Room is going to greatly simplify access GMMP's database.LiveData combined with Room makes it super simple for my UI to get access to the data and get notified on changes to the databaseViewModel allows me to maintain UI state between orientation changesLifecycle gives my presenters access to the fragment/…

3.0 Work In Progress 1: New theme engine and now playing

I'd like to start off by saying that GMMP 3.0 is a long long way from being complete, but I have made some progress so I wanted to share whats been done so far.

New Theme Engine In 2.x, GMMP had 2 main theme types: Holo and Material.  The holo themes leveraged a library called HoloAccent which reimplemented all of the UI elements in a dynamically color-able holo style.  The material themes used the android compatibility library and required each theme to be predefined in xml.  I generated roughly 1000 or so different color combinations and thats what was available to choose from.  On top of that, a lot of custom code had to be placed through out the UI code to make sure everything colored properly.
GMMP 3.0 will feature a new theme engine that will do the dynamic coloring of Material themes.  That unfortunately means there will no longer be any holo themes.  Google keeps releasing updates that break parts of that holo accent library, so I decided to drop it.  Anyway the new engine…


2.2.2 (04/05/2017):
-Fixed m4a crossfade bug
-Updated crashlytics to 2.6.7
-Updated support library to 25.3.1
-Updated google services to 10.2.1


2.2.1 (03/09/2017):
-Fixed crash when executing a search with nothing but blank spaces
-New m4a decoder is now available to lollipop devices
-Fixed issue loading embedded album art when the "prefer embedded art" option was off
-Effects view now shows the correct effects when the custom audioengine is disabled
-Fixed crash on the Lenovo A6000 when raising volume above the "safe media volume"
-Other various fixes

2.2 Released - Android Auto support & On Sale for $0.99 USD through March 12th

2.2 is finally ready to go.  Major updates were the additional of Android Auto support, a new m4a decoder (a lot of devices shipped their 6.0+ updates with broken opensl decoders, which gmmp previously used for m4a playback), and a lot of voice search improvements.  Also included are a few nice bug fixes that should improve stability.

One other thing to note is GMMP 2.2 (and 3.0 hopefully later this year) requires an android device running at least 5.0 or higher.  5.0+ represents about 80% of the active installs, so it was time to increase the minimum to take full advantage of the newer apis.

2.2.0 (03/02/2017):
-Added Android Auto support
-Added Full Android Auto Access option in Prefs -> Library to allow access to all artists, albums, and genres
-Added new m4a/aac decoder to replace opensl on android 6.0+
-Added support for .oga extension (ogg audio)
-Added support for opus files with the .ogg or .oga extension

-Voice search refactoring/improveme…