This repository has been archived by the owner on May 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from a93-39a/master
Orange Squeeze and albumArtist
- Loading branch information
Showing
27 changed files
with
220 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":49,"versionName":"1.5.8","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug"},"path":"app-debug.apk","properties":{}}] | ||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":49,"versionName":"1.5.8","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug"},"path":"app-debug.apk","properties":{}}] |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":49,"versionName":"1.5.8","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
app/src/main/java/com/adam/aslfms/receiver/OrangeSqueezeReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.adam.aslfms.receiver; | ||
|
||
import android.content.Context; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
|
||
import com.adam.aslfms.util.Track; | ||
import com.adam.aslfms.util.Util; | ||
|
||
/** | ||
* A BroadcastReceiver for intents sent by the Orange Squeeze music player | ||
* | ||
* @see AbstractPlayStatusReceiver | ||
* | ||
* @author Austin Hogan <[email protected]> | ||
* @since 1.5.8 | ||
*/ | ||
public class OrangeSqueezeReceiver extends AbstractPlayStatusReceiver { | ||
|
||
static final String APP_PACKAGE = "com.orangebikelabs.orangesqueeze"; | ||
static final String APP_NAME = "Orange Squeeze"; | ||
|
||
static final String ACTION_ORANGE_METACHANGED = "com.orangebikelabs.orangesqueeze.metachanged"; | ||
static final String ACTION_ORANGE_PLAYSTATECHANGED = "com.orangebikelabs.orangesqueeze.playstatechanged"; | ||
|
||
static final String TAG = "OrangeSqzReceiver"; | ||
static private Track track = null; | ||
|
||
@Override | ||
protected void parseIntent(Context ctx, String action, Bundle bundle) { | ||
|
||
MusicAPI musicAPI = MusicAPI.fromReceiver( | ||
ctx, APP_NAME, APP_PACKAGE, null, false); | ||
setMusicAPI(musicAPI); | ||
|
||
if (action.equals(ACTION_ORANGE_METACHANGED)) { | ||
boolean isPlaying = bundle.getBoolean("isplaying"); | ||
boolean isPaused = bundle.getBoolean("ispaused"); | ||
if (isPaused) { | ||
setState(Track.State.PAUSE); | ||
Log.d(TAG, "Setting state to PAUSE"); | ||
} | ||
if (isPlaying) { | ||
setState(Track.State.RESUME); | ||
Log.d(TAG, "Setting state to RESUME"); | ||
} | ||
Track.Builder b = new Track.Builder(); | ||
b.setMusicAPI(musicAPI); | ||
b.setWhen(Util.currentTimeSecsUTC()); | ||
|
||
b.setArtist(bundle.getString("artist")); | ||
b.setAlbum(bundle.getString("album")); | ||
b.setTrack(bundle.getString("track")); | ||
b.setAlbumArtist(bundle.getString("albumartist")); | ||
b.setTrackArtist(bundle.getString("trackartist")); | ||
b.setTrackNr(bundle.getString("tracknr")); | ||
b.setDuration(bundle.getInt("duration")/1000); // convert ms to | ||
setTrack(b.build()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.