aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-02-12 08:50:15 -0800
committerScott Jackson <daneren2005@gmail.com>2016-02-12 08:50:15 -0800
commitb6f9b9c650f02803b69949afb5180b45af4de779 (patch)
tree3881bc66a1748da23277c3543a8aa3de80a8a0a2
parent005097f45e46655c28ae7bdba1eabd9603b19105 (diff)
parent64ff9af045466fef4ed0443d0bb311781c9abba2 (diff)
downloaddsub-b6f9b9c650f02803b69949afb5180b45af4de779.tar.gz
dsub-b6f9b9c650f02803b69949afb5180b45af4de779.tar.bz2
dsub-b6f9b9c650f02803b69949afb5180b45af4de779.zip
Merge remote-tracking branch 'origin/master'
-rw-r--r--app/src/main/AndroidManifest.xml4
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java28
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadService.java4
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java5
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Constants.java1
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Util.java37
-rw-r--r--app/src/main/res/values/strings.xml2
-rw-r--r--app/src/main/res/xml/changelog.xml24
-rw-r--r--app/src/main/res/xml/settings_cast.xml6
9 files changed, 86 insertions, 25 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 083f24bf..0aa3afc6 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="github.daneren2005.dsub"
android:installLocation="internalOnly"
- android:versionCode="172"
- android:versionName="5.1.4">
+ android:versionCode="173"
+ android:versionName="5.1.5 Beta">
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="github.daneren2005.dsub"
diff --git a/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java b/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java
index bc54f486..c2007139 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java
@@ -62,6 +62,8 @@ public class ChromeCastController extends RemoteController {
private boolean error = false;
private boolean ignoreNextPaused = false;
private String sessionId;
+ private boolean isStopping = false;
+ private Runnable afterUpdateComplete = null;
private ServerProxy proxy;
private String rootLocation;
@@ -247,18 +249,38 @@ public class ChromeCastController extends RemoteController {
}
}
- void startSong(DownloadFile currentPlaying, boolean autoStart, int position) {
+ void startSong(final DownloadFile currentPlaying, final boolean autoStart, final int position) {
if(currentPlaying == null) {
try {
- if (mediaPlayer != null && !error) {
- mediaPlayer.stop(apiClient);
+ if (mediaPlayer != null && !error && !isStopping) {
+ isStopping = true;
+ mediaPlayer.stop(apiClient).setResultCallback(new ResultCallback<RemoteMediaPlayer.MediaChannelResult>() {
+ @Override
+ public void onResult(RemoteMediaPlayer.MediaChannelResult mediaChannelResult) {
+ isStopping = false;
+
+ if(afterUpdateComplete != null) {
+ afterUpdateComplete.run();
+ afterUpdateComplete = null;
+ }
+ }
+ });
}
} catch(Exception e) {
// Just means it didn't need to be stopped
}
downloadService.setPlayerState(PlayerState.IDLE);
return;
+ } else if(isStopping) {
+ afterUpdateComplete = new Runnable() {
+ @Override
+ public void run() {
+ startSong(currentPlaying, autoStart, position);
+ }
+ };
+ return;
}
+
downloadService.setPlayerState(PlayerState.PREPARING);
MusicDirectory.Entry song = currentPlaying.getSong();
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
index d35a522c..e21e7c34 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
@@ -1704,6 +1704,10 @@ public class DownloadService extends Service {
nextPlayingTask.cancel();
nextPlayingTask = null;
}
+
+ if(nextPlayerState != IDLE) {
+ setNextPlayerState(IDLE);
+ }
}
if(remoteState == LOCAL) {
diff --git a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
index 75023ec0..7a2edf79 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
@@ -947,10 +947,9 @@ public class RESTMusicService implements MusicService {
StringBuilder builder = new StringBuilder(getRestUrl(context, "stream"));
builder.append("&id=").append(song.getId());
- // If we are doing mp3 to mp3, just specify raw so that stuff works better
- if("mp3".equals(song.getSuffix()) && (song.getTranscodedSuffix() == null || "mp3".equals(song.getTranscodedSuffix())) && ServerInfo.checkServerVersion(context, "1.9", getInstance(context))) {
+ // Allow user to specify to stream raw formats if available
+ if(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_CAST_STREAM_ORIGINAL, true) && ("mp3".equals(song.getSuffix()) || "flac".equals(song.getSuffix()) || "wav".equals(song.getSuffix()) || "aac".equals(song.getSuffix())) && ServerInfo.checkServerVersion(context, "1.9", getInstance(context))) {
builder.append("&format=raw");
- builder.append("&estimateContentLength=true");
} else {
builder.append("&maxBitRate=").append(maxBitrate);
}
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Constants.java b/app/src/main/java/github/daneren2005/dsub/util/Constants.java
index 88b87481..9aebef83 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Constants.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Constants.java
@@ -171,6 +171,7 @@ public final class Constants {
public static final String PREFERENCES_KEY_RESUME_PLAY_QUEUE_NEVER = "neverResumePlayQueue";
public static final String PREFERENCES_KEY_BATCH_MODE = "batchMode";
public static final String PREFERENCES_KEY_CAST_GAPLESS_PLAYBACK = "castingGaplessPlayback";
+ public static final String PREFERENCES_KEY_CAST_STREAM_ORIGINAL = "castStreamOriginal";
public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount";
public static final String OFFLINE_SCROBBLE_ID = "scrobbleID";
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java
index be9536ed..435c33c0 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -1245,32 +1245,35 @@ public final class Util {
}
showDetailsDialog(context, context.getResources().getString(title), headerStrings, details);
}
- public static void showDetailsDialog(Context context, String title, List<String> headers, List<String> details) {
+ public static void showDetailsDialog(Context context, String title, List<String> headers, final List<String> details) {
ListView listView = new ListView(context);
listView.setAdapter(new DetailsAdapter(context, R.layout.details_item, headers, details));
listView.setDivider(null);
listView.setScrollbarFadingEnabled(false);
- // Let the user long-click on a row to copy its value to the clipboard
- final Context contextRef = context;
- listView.setOnItemLongClickListener(new ListView.OnItemLongClickListener() {
- @Override
- public boolean onItemLongClick(AdapterView<?> parent, View view, int pos, long id) {
+ // Let the user long-click on a row to copy its value to the clipboard
+ final Context contextRef = context;
+ listView.setOnItemLongClickListener(new ListView.OnItemLongClickListener() {
+ @Override
+ public boolean onItemLongClick(AdapterView<?> parent, View view, int pos, long id) {
+ TextView nameView = (TextView) view.findViewById(R.id.detail_name);
+ TextView detailsView = (TextView) view.findViewById(R.id.detail_value);
+ if(nameView == null || detailsView == null) {
+ return false;
+ }
- TextView nameView = (TextView) view.findViewById(R.id.detail_name);
- TextView detailsView = (TextView) view.findViewById(R.id.detail_value);
- CharSequence name = nameView.getText();
- CharSequence value = detailsView.getText();
+ CharSequence name = nameView.getText();
+ CharSequence value = detailsView.getText();
- ClipboardManager clipboard = (ClipboardManager) contextRef.getSystemService(Context.CLIPBOARD_SERVICE);
- ClipData clip = ClipData.newPlainText(name, value);
- clipboard.setPrimaryClip(clip);
+ ClipboardManager clipboard = (ClipboardManager) contextRef.getSystemService(Context.CLIPBOARD_SERVICE);
+ ClipData clip = ClipData.newPlainText(name, value);
+ clipboard.setPrimaryClip(clip);
- toast(contextRef, "Copied " + name + " to clipboard");
+ toast(contextRef, "Copied " + name + " to clipboard");
- return true;
- }
- });
+ return true;
+ }
+ });
new AlertDialog.Builder(context)
// .setIcon(android.R.drawable.ic_dialog_info)
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b4d6f41b..e783d641 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -481,6 +481,8 @@
<string name="settings.shuffle_by_album">Shuffle By Album</string>
<string name="settings.shuffle_by_album.true">Shuffle order of albums</string>
<string name="settings.shuffle_by_album.false">Shuffle all songs together</string>
+ <string name="settings.casting_stream_original">Stream original</string>
+ <string name="settings.casting_stream_original_summary">Stream original files where supported by cast device</string>
<string name="shuffle.title">Shuffle By</string>
<string name="shuffle.startYear">Start Year:</string>
diff --git a/app/src/main/res/xml/changelog.xml b/app/src/main/res/xml/changelog.xml
index 81ea22b8..9ec84bcf 100644
--- a/app/src/main/res/xml/changelog.xml
+++ b/app/src/main/res/xml/changelog.xml
@@ -1,5 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog>
+ <release version="5.1.5" versioncode="173" releasedate="2/11/2016">
+ <change>Toggle for Batch Mode on Now Playing</change>
+ <change>Admin tab: view/update music folders (Subsonic 5.2+)</change>
+ <change>Tag Browsing: can specify Music Folder (Subsonic 6.0+)</change>
+ <change>Show shuffle/radio mode in title bar</change>
+ <change>Madsonic only: Songs lists on Home tab</change>
+ <change>Clicking songs adds songs before it as well</change>
+ <change>Similar Artists: show missing artists below main list</change>
+ <change>Improve offline search (thanks fxthomas)</change>
+ <change>Improve podcast date formatting</change>
+ <change>Increase max sleep timer to 1 hour</change>
+ <change>Cast: added setting to disable DLNA gapless playback</change>
+ <change>Cast: added setting to stream original source files</change>
+ <change>Long press details dialogs to copy information</change>
+ <change>Android Auto improvements</change>
+ <change>Top Tracks: display #</change>
+ <change>Require current password when changing password</change>
+ <change>Improved Share Details dialog</change>
+ <change>Sort Music Folders alphabetically</change>
+ <change>Fix repeating same song if multiples copies in play queue</change>
+ <change>Fix freeze on Play x from Google Now</change>
+ <change>Fix Show Artist/Album back behavior</change>
+ <change>Minor Chromecast fixes</change>
+ </release>
<release version="5.1.4" versioncode="172" releasedate="1/17/2016">
<change>Minor theme improvements</change>
</release>
diff --git a/app/src/main/res/xml/settings_cast.xml b/app/src/main/res/xml/settings_cast.xml
index 058255c2..45766162 100644
--- a/app/src/main/res/xml/settings_cast.xml
+++ b/app/src/main/res/xml/settings_cast.xml
@@ -15,5 +15,11 @@
android:summary="@string/settings.gapless_playback_summary"
android:key="castingGaplessPlayback"
android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.casting_stream_original"
+ android:summary="@string/settings.casting_stream_original_summary"
+ android:key="castStreamOriginal"
+ android:defaultValue="true"/>
</PreferenceCategory>
</PreferenceScreen> \ No newline at end of file