Saturday, May 20, 2017

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 will traverse through the entire view and theme things accordingly.  It also allows me to specify different behaviors straight in the UI xml instead of in code.  (Example would be the the play/pause button using the accent color instead of the standard button color).



As of right now, a theme is defined by 6 different colors.  Primary, Primary Light, Primary Dark, Accent, Accent Dark, and Accent Light.  GMMP 3.0 will allow all 6 of these to be chosen by the user.  There will also be tons of predetermined themes available to select from for those who dont want to customize each color.

New Now Playing

The pictures above show the current state of the now playing screen.  The album art area will be where gestures are done.  I will also probably make an option to choose between having the album art extend all the way through the status bar, and having a standard colored toolbar with the album art underneath it.  The floating action button is just a placeholder currently but its purpose is going to be for quick actions.  The actions will be similar to the options available for the gesture actions.  I have not yet determined how they will be presented.

One option is the FAB to expand out to a bunch of smaller floating buttons like below:


It looks nice, but due to the location of the FAB it doesnt leave room for many buttons, so I may have to modify it to show both above and below the FAB or go down a different route all together.  The other thought i had was to make it expand out to a toolbar with buttons that sits on top of where the song information is shown.  I"ll have to prototype both to see which works better.

Below the album art is the metadata display which I will go into more detail later on in this post.  When single tapping the metadata area it will transition the UI to the queue.  I've had a lot of requests for easier queue access and it seems like this allows for that.  Perhaps a long press on that area would open up a popup with all the song details.  Finally the play/pause button will do a nice transition animation when pressed (the one where the play morphs into the pause).

Not everything mentioned here implemented yet, but that is what im shooting for.   I'll most likely do partial implementations of most of the UI views just to see how everything works together first before doing the full implementations.

Metadata View Customization

In GMMP 1.x/2.x, users were giving the option to choose from a long list of different metadata fields for each line or allowed the user to write there own custom lines using variables like %ar% (artist), %al% (album), etc.  I've greatly expanded upon this for 3.0.  There will still be presets that users can choose from if they dont want to mess with writing the lines themselves.

Fields

This has not changed.  %field% will be replaced by metadata from the tags.  The code was completely rewritten so its much more efficient this time around.  It actually parses each line instead of just doing a general replace for each field.

Formatting

Entire lines or specific words in a line can be wrapped with formatting tags (there will be examples later on)

  • <align> : Aligns the text left, right, or centered.  This applies to the entire line of text
  • <b> : Bold
  • <i> : Italics
  • <size> : Text/Font size
  • <typeface> : Choose the font to use
  • <u> : Underline

Functions

Inspired by foobar2000, I've put in a few functions to allow you to apply a little logic to the lines
  • $ifequal(val1, val2, text_if_equal, text_if_not) : Compares 2 integers (val1, val2) and if they are the same it will display [text_if_equal], otherwise show [text_if_not] or nothing if that field is not specified.  
  • $ifgreater(val1, val2, text_if_greater, text_if_not) : Compares 2 integers (val1, val2) and if val > val2 it will display [text_if_greater], otherwise show [text_if_not] or nothing if that field is not specified.  
  • $notempty(val1, val2, val3, etc) : Will display the first parameter that is not empty.
All of these parameters can contain fields (which is really the only way they are useful).  More functions will probably come later, but at least right now with these 3 you can do some nice things like:  
  • Hiding disc number or track number if its 0
  • Show composer or album artist if the field is set, otherwise show artist

Examples


"<align=center><typeface=sans-serif><size=24>%tr%"
"<align=center><typeface=sans-serif><size=20>%ar%"
"<align=center><typeface=sans-serif><size=20>%al%"


"<align=left><b><typeface=sans-serif><size=24>%tr%"
"<align=center><i><typeface=serif><size=20>%ar%"
"<align=right><u><typeface=monospace><size=20>%al%"

"<align=center><b><typeface=sans-serif><size=24>%tr%"
"<align=center><typeface=sans-serif><size=20><b>$notempty(%cp%,   ,%ar%)</b> - <i>%al%</i>"

Multiple alignments on a single line

The last customization that can be done is essentially splitting a single line into multiple segments that take up an equal percentage of the line (2 segments = 50% each or 3 segments is 33.3% each).  Each segment can get their own alignment

This is the java code representing above.  I will try to make this much more user friendly when creating lines in app

"<align=center><typeface=serif><size=24>%tr%"
new String[]
{
 "<align=left><typeface=serif><size=20>$ifequal(%yr%,0,No Year,%yr%)",
 "<align=center><typeface=serif><size=20>%br%",
 "<align=right><typeface=serif><size=20>%sr%",
}
new String[]
{
 "<align=center><typeface=serif><size=20>$ifequal(%yr%,0,No Year,%yr%)",
 "<align=center><typeface=serif><size=20>%sr%"
}

So thats it for now.  I will be doing more posts as things get developed

Friday, April 7, 2017

2.2.2

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

Saturday, March 11, 2017

2.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

Thursday, March 2, 2017

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.

This is the playback screen when in landscape 

Menu options

More menu options (Artists, Albums, and Genres are off by default but can be enabled by turning on the Full Android Auto Access option)

Queue with the icon next to the current playing track

Playlists menu combines both smart playlists and playlist files

All Artists

Auto has the option to filter by letter

Albums

View when outside of the music player in Auto.  It has widgets for each auto app


Changelog:
2.2.0 (03/02/2017):
New:
-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

Improved/Updated:
-Voice search refactoring/improvements
-More voice search accuracy improvements
-Added genre voice search
-Added unstructured voice search support
-Refactored data access layer
-Audiofocus is now persisted if the music service is restarted by the OS
-Playback will no longer auto resume after audiofocus loss (always play on plugin is not affected by this)
-Unlocker validation moved to the MusicService
-Updated crashlytics to 2.6.6
-Updated translations
-Improved sample rate, channel count, and duration detection
-GMMP should no longer auto resume when regaining audiofocus after a full loss (like using another player to play audio)
-Upgraded Glide to 3.7.0
-GMMP will now attempt to free up memory when the OS requests it

Fixed:
-The full length audio file associated with a cue will no longer show in the library views
-Fixed audioengine crash when changing tracks multiple times in a short period of time
-Fixed memory leak
-Other various minor bug fixes

Removed:
-Removed support for kitkat and below
-Removed any code specific to kitkat or below
-Removed music service timeout (interferes with a lot of functionality)

Friday, January 20, 2017

2.1.4

2.1.4 (01/14/2016):
-Music service will stay a foreground service to prevent it from being killed/restarted when show when paused is true and dismissable notifications are turned off
-Notification controls now properly update after changing tracks when paused/stopped
-Fixed tasker support
-Persist auto resume when music service restarts or is killed
-Fixed issue reading album art from APEv2 tags
-Improved APEv2 tag reading
-Upgraded google play services to 10.0.1
-Upgrade support library to 25.1.0

2.1.3 (12/01/2016):
-Added option to disable dismissable notification controls when paused (Android 5.0+)
-Disabled "Show in status bar" on Android 5.0+ due to google removing the capability in 5.0
-Fixed crash when trying to save playlists to a location where gmmp does not have access to write
-Fixed blank notification issue
-Composer no longer defaults to artist tag if composer tag is not present
-Other minor fixes

Tuesday, January 3, 2017

2017 Plans

I've been fairly quiet on here for the last few months but I wanted to give an update on the plans for this new year.

2.1.4: Tasker users are probably aware that the lastest version of tasker no longer works with gmmp due to an api change made by the tasker dev.  The next update will fix that along with another small annoyance I found regarding the auto resume not working if the OS restarts the music service (which seems to happen after not using gmmp for an hour or 2). This should be released in 2-3 weeks.

2.2: The next major update will add android auto support.  I have it working currently with limited access to gmmps content (just the queue so far).  Due to the guidelines android put out for auto, gmmp will only expose some thing by default like the queue,  top songs,  recently played, and other things like that.  The reason for this is so the update will get approved by the play store.  According to their docs they do manual testing of the auto support and everything must comply with their guidelines.  I will however,  add an option in the settings to expose the full library.

2.2 will also remove the support for kitkat in order to start the transition to some of the 5.0 apis that will really help out the app.  The first will be the switch to vector graphics which should reduce the size of the app by a fairly large amount.  In earlier versions of android i had to include images for every screen size for every icon / image.  Vector drawables allow me to just include one file for each icon and android will scale it to the appropriate screen size with no loss of quality.

The other big change will be a new aac decoder using the MediaCodec api.  A few manufacturers shipped their 6.0 updates with a completely broken  implementation of opensl (which is what gmmp uses for aac playback).  OnePlus is the big name that comes to mind but a few others have done it as well.  This new api should allow aac playback again in gmmps audioengine on those devices.

Betas with auto support should start being released in 3-4 weeks.  Final release wont be for a couple of months most likely.

3.0:
While working on 2.x i have also been doing some work on 3.0. Mainly a new theme engine for gmmp.  It will allow me to dynamically color the ui with any arbitrary color set and also switch color sets without restarting the UI.

Its coming along nicely in a demo app i wrote which i plan on showing some previews on here when i feel its ready.  Integration will gmmp wont happen until 2.2 is finished however. For those who did not read my other post about 3.0, it will mostly focus on rewriting the UI.  I will start from scratch leveraging all the material design animation libraries and other niceties added in 5.0+. The base of the current UI was from the gingerbread days so it really just needs a rewrite.

I would like to start pushing out early 3.0 betas in the late summer.  Betas will mostly continue throughout the rest of a year with a final release at the end of 2017 or early 2018. It really all depends how much time i get to work on gmmp this year.  Im changing positions at my day job next months so i will probably not be as burned out on coding as i have been these last 2 years (hence the slower progression in the app)

Wednesday, November 23, 2016

GMMP 2.1.2

2.1.2 (11/23/2016)
-Rewrote cast device discovery.  Should be much more accurate and responsive now
-Show notification when paused defaulted to true
-Notification controls can now be swiped away when music is paused/stopped
-Updated Slovak translation
-Added new command intents:
    gonemad.gmmp.command.NEXT_ALBUM
    gonemad.gmmp.command.PREV_ALBUM
    gonemad.gmmp.command.NEXT_FOLDER
    gonemad.gmmp.command.PREV_FOLDER
    gonemad.gmmp.command.NEXT_ALBUM_BY_ARTIST
    gonemad.gmmp.command.PREV_ALBUM_BY_ARTIST
    gonemad.gmmp.command.RANDOM_ALBUM
    gonemad.gmmp.command.RANDOM_TRACK
    gonemad.gmmp.command.RANDOM_TRACK_FROM_QUEUE
    gonemad.gmmp.command.STOP_AFTER_CURRENT
    gonemad.gmmp.command.TOGGLE_SHUFFLE
    gonemad.gmmp.command.TOGGLE_REPEAT