10 | * This is just for a more convenient syntax if you only need to override the end action.
11 | */
12 | public abstract class AnimationEndListener implements Animation.AnimationListener {
13 | @Override
14 | public void onAnimationStart(Animation animation) {
15 | }
16 |
17 | @Override
18 | public void onAnimationRepeat(Animation animation) {
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/values-en-rGB/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/alarm_clock.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_new_music.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_volume_off.xml:
--------------------------------------------------------------------------------
1 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/tidal_emblem.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/emoticon_sad_outline.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/folder.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_genres.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/settings_brightness.xml:
--------------------------------------------------------------------------------
1 |
8 |
13 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/emoticon_cool_outline.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/podcasts.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/framework/EnumWithId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.framework;
18 |
19 | /**
20 | * Helper interface to associate an id with an enum value
21 | */
22 | public interface EnumWithId {
23 | int getId();
24 | }
25 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/values/constants.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 | 512
21 | 9090
22 | 9000
23 |
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/PlayersChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | /**
20 | * Event sent when the list of players connected to the server has changed.
21 | */
22 | public class PlayersChanged {
23 | }
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/settings_advanced.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/toast_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/dialog/ArtworkListLayout.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.itemlist.dialog;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.StringRes;
6 |
7 | import uk.org.ngo.squeezer.R;
8 | import uk.org.ngo.squeezer.framework.EnumWithText;
9 |
10 | /**
11 | * Supported list layouts.
12 | */
13 | public enum ArtworkListLayout implements EnumWithText {
14 | grouped(R.string.settings_layout_grouped),
15 | grid(R.string.SWITCH_TO_GALLERY),
16 | list(R.string.SWITCH_TO_EXTENDED_LIST);
17 |
18 | /**
19 | * The text to use for this layout
20 | */
21 | @StringRes
22 | private final int stringResource;
23 |
24 | @Override
25 | public String getText(Context context) {
26 | return context.getString(stringResource);
27 | }
28 |
29 | ArtworkListLayout(@StringRes int serverString) {
30 | this.stringResource = serverString;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/IServiceItemListCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.itemlist;
18 |
19 | import uk.org.ngo.squeezer.service.ServiceCallback;
20 |
21 | public interface IServiceItemListCallback extends ItemReceiver, ServiceCallback {
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/nowplaying.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/action_bar_custom_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
21 |
22 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/anim/slide_in_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/anim/slide_out_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/menu/player_group_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/framework/EnumWithText.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.framework;
18 |
19 | import android.content.Context;
20 |
21 | /**
22 | * Helper interface to associate a text suitable for display in the UI with an enum value.
23 | */
24 | public interface EnumWithText {
25 | String getText(Context context);
26 | }
27 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/shuffle.xml:
--------------------------------------------------------------------------------
1 |
5 |
8 |
9 |
12 |
13 |
16 |
17 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Squeezer/src/main/play/listings/en-US/full-description.txt:
--------------------------------------------------------------------------------
1 | Control your Lyrion Music Server and players.
2 |
3 | Features include:
4 |
5 | • Browse the library by album artist, all artists, composers, album, genre, year, playlist, favorites, or new music
6 | • Playlist control (now playing, shuffle, repeat, save/clear/modify playlists)
7 | • Manage players (names, synchronisation groups, sleep, alarms)
8 | • Full library search
9 | • Internet radio support (browse, staff picks, search)
10 | • Browse music folders
11 | • Supports Plugins/Apps
12 | • Library Views and Remote Music Libraries
13 | • Download of local music; track, album, artist, genre, year, playlist and music folder
14 | • Automatic discovery of local servers
15 | • Support for password protected servers
16 | • Control playback from your Android Wear device
17 | • Home Screen Widgets
18 | • Alarm Clock management
19 | • Add/remove music from favorites
20 | • Display lyrics
21 |
22 | Squeezer is free, and open source.
23 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/widget/OnSwipeListener.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.widget;
2 |
3 | import android.view.GestureDetector;
4 | import android.view.MotionEvent;
5 |
6 | public class OnSwipeListener extends GestureDetector.SimpleOnGestureListener {
7 |
8 | public boolean onSwipeUp(){
9 | return false;
10 | }
11 |
12 | public boolean onSwipeDown(){
13 | return false;
14 | }
15 |
16 | public boolean onSwipeLeft(){
17 | return false;
18 | }
19 |
20 | public boolean onSwipeRight(){
21 | return false;
22 | }
23 |
24 | @Override
25 | public boolean onDown(MotionEvent e) {
26 | return true;
27 | }
28 |
29 | @Override
30 | public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
31 | if (Math.abs(velocityX) > Math.abs(velocityY)) {
32 | return velocityX < 0 ? onSwipeLeft() : onSwipeRight();
33 | } else {
34 | return velocityY < 0 ? onSwipeUp() : onSwipeDown();
35 | }
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/Squeezer/src/main/res/values-sw340dp-long/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/values-land/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_songs.xml:
--------------------------------------------------------------------------------
1 |
8 |
13 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/connecting.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
19 |
20 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/show_artwork.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_artists_album.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 | android.enableJetifier=false
15 | android.nonFinalResIds=false
16 | android.nonTransitiveRClass=false
17 | android.useAndroidX=true
18 | org.gradle.jvmargs=-XX:MaxMetaspaceSize=768m
19 | org.gradle.unsafe.configuration-cache=false
20 |
21 | # When configured, Gradle will run in incubating parallel mode.
22 | # This option should only be used with decoupled projects. More details, visit
23 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
24 | # org.gradle.parallel=true
25 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/party.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/home_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/tunein.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable-v24/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
7 |
9 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/dialog/PlayerRenameDialog.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.itemlist.dialog;
2 |
3 | import android.app.Dialog;
4 | import android.os.Bundle;
5 | import androidx.annotation.NonNull;
6 | import android.text.InputType;
7 |
8 | import uk.org.ngo.squeezer.R;
9 | import uk.org.ngo.squeezer.itemlist.PlayerListActivity;
10 |
11 | public class PlayerRenameDialog extends BaseEditTextDialog {
12 |
13 | private PlayerListActivity activity;
14 |
15 | @NonNull
16 | @Override
17 | public Dialog onCreateDialog(Bundle savedInstanceState) {
18 | Dialog dialog = super.onCreateDialog(savedInstanceState);
19 |
20 | activity = (PlayerListActivity) getActivity();
21 | dialog.setTitle(getString(R.string.rename_title, activity.getCurrentPlayer().getName()));
22 | editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
23 | editText.setText(activity.getCurrentPlayer().getName());
24 |
25 | return dialog;
26 | }
27 |
28 | @Override
29 | protected boolean commit(String newName) {
30 | activity.playerRename(newName);
31 | return true;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/util/DevicePlayers.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.util;
2 |
3 | import android.content.Context;
4 |
5 | import uk.org.ngo.squeezer.Preferences;
6 | import uk.org.ngo.squeezer.Squeezer;
7 |
8 | public class DevicePlayers {
9 |
10 | private final Context context;
11 | private SqueezePlayer squeezePlayer;
12 |
13 | public DevicePlayers(Context context) {
14 | this.context = context;
15 | }
16 |
17 | public void onCreate() {
18 | Preferences preferences = Squeezer.getPreferences();
19 | SqueezeLite squeezeLite = new SqueezeLite(context);
20 | if (preferences.controlSqueezelite() && squeezeLite.has()) squeezeLite.start();
21 | }
22 |
23 | public void onResume() {
24 | Preferences preferences = Squeezer.getPreferences();
25 | squeezePlayer = (preferences.controlSqueezePlayer() && SqueezePlayer.has(context)) ? SqueezePlayer.startControllingSqueezePlayer(context) : null;
26 | }
27 |
28 | public void onPause() {
29 | if (squeezePlayer != null) {
30 | squeezePlayer.stopControllingSqueezePlayer();
31 | squeezePlayer = null;
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_shuffle_off.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
16 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/world.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
18 |
19 |
20 |
25 |
26 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_library_views.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_settings_36.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/menu/player_context_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/HandshakeComplete.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | /**
20 | * Event sent after handshaking with the server is complete.
21 | */
22 | public class HandshakeComplete {
23 | /** Server version */
24 | public final String version;
25 |
26 | public HandshakeComplete(String version) {
27 | this.version = version;
28 | }
29 |
30 | @Override
31 | public String toString() {
32 | return "HandshakeComplete{" +
33 | "version='" + version + '\'' +
34 | '}';
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/spotify.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/spotify_emblem.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/framework/EnumIdLookup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.framework;
18 |
19 | import android.util.SparseArray;
20 |
21 | /**
22 | * Reverse mapping of EnumWithId.
23 | *
24 | * Enables lookup of enum value via it's id.
25 | */
26 | public class EnumIdLookup & EnumWithId> {
27 |
28 | private final SparseArray map = new SparseArray<>();
29 |
30 | public EnumIdLookup(Class enumType) {
31 | for (E v : enumType.getEnumConstants()) {
32 | map.put(v.getId(), v);
33 | }
34 | }
35 |
36 | public E get(int num) {
37 | return map.get(num);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_menu_overflow.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
26 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/model/Image.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.model;
2 |
3 | import android.net.Uri;
4 | import android.os.Parcel;
5 | import android.os.Parcelable;
6 |
7 | import java.util.Map;
8 |
9 | import uk.org.ngo.squeezer.Util;
10 |
11 | public class Image implements Parcelable {
12 | public final Uri artworkId;
13 | public final String caption;
14 |
15 | public Image(Map record) {
16 | artworkId = Util.getImageUrl(record, "image");
17 | caption = Util.getString(record, "caption");
18 | }
19 |
20 | protected Image(Parcel in) {
21 | artworkId = Uri.parse(in.readString());
22 | caption = in.readString();
23 | }
24 |
25 | @Override
26 | public void writeToParcel(Parcel dest, int flags) {
27 | dest.writeString(artworkId.toString());
28 | dest.writeString(caption);
29 | }
30 |
31 | @Override
32 | public int describeContents() {
33 | return 0;
34 | }
35 |
36 | public static final Creator CREATOR = new Creator() {
37 | @Override
38 | public Image createFromParcel(Parcel in) {
39 | return new Image(in);
40 | }
41 |
42 | @Override
43 | public Image[] newArray(int size) {
44 | return new Image[size];
45 | }
46 | };
47 | }
48 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/ActivePlayerChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import java.util.Map;
20 |
21 | import uk.org.ngo.squeezer.model.Player;
22 |
23 | /**
24 | * Event sent when the player that is controlled by Squeezer (the "active" player) has changed.
25 | */
26 | public class ActivePlayerChanged {
27 | /** The active player. May be null. */
28 | public final Player player;
29 |
30 | public ActivePlayerChanged(Player player) {
31 | this.player = player;
32 | }
33 |
34 | @Override
35 | public String toString() {
36 | return "{player: " + player + "}";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/volume/VolumeKeysDelegate.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.volume;
2 |
3 | import android.view.KeyEvent;
4 |
5 | import uk.org.ngo.squeezer.service.ISqueezeService;
6 |
7 | /**
8 | * Intercept hardware volume control keys to control slimserver
9 | * volume.
10 | *
11 | * Change the volume when the key is depressed. Suppress the keyUp
12 | * event, otherwise you get a notification beep as well as the volume
13 | * changing.
14 | */
15 | public class VolumeKeysDelegate {
16 |
17 | public static boolean onKeyDown(int keyCode, ISqueezeService service) {
18 | return switch (keyCode) {
19 | case KeyEvent.KEYCODE_VOLUME_UP -> adjustVolume(1, service);
20 | case KeyEvent.KEYCODE_VOLUME_DOWN -> adjustVolume(-1, service);
21 | default -> false;
22 | };
23 | }
24 |
25 | public static boolean onKeyUp(int keyCode) {
26 | return switch (keyCode) {
27 | case KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_VOLUME_DOWN -> true;
28 | default -> false;
29 | };
30 | }
31 |
32 | private static boolean adjustVolume(int direction, ISqueezeService service) {
33 | if (service == null) {
34 | return false;
35 | }
36 | service.adjustVolume(direction);
37 | return true;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/dialog/CallStateDialog.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.dialog;
2 |
3 | import android.app.Dialog;
4 | import android.os.Bundle;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.fragment.app.DialogFragment;
8 |
9 | import com.google.android.material.dialog.MaterialAlertDialogBuilder;
10 |
11 | import uk.org.ngo.squeezer.Preferences;
12 | import uk.org.ngo.squeezer.R;
13 | import uk.org.ngo.squeezer.Squeezer;
14 |
15 | public class CallStateDialog extends DialogFragment {
16 | public interface CallStateDialogHost {
17 | void requestCallStatePermission();
18 | }
19 |
20 | @NonNull
21 | @Override
22 | public Dialog onCreateDialog(Bundle savedInstanceState) {
23 | CallStateDialogHost host = (CallStateDialogHost) requireParentFragment();
24 | return new MaterialAlertDialogBuilder(requireActivity())
25 | .setTitle(R.string.call_state_permission_title)
26 | .setMessage(R.string.call_state_permission_message)
27 | .setPositiveButton(R.string.request_permission, (dialogInterface, i) -> host.requestCallStatePermission())
28 | .setNegativeButton(R.string.DISABLE, (dialogInterface, i) -> Squeezer.getPreferences().setActionOnIncomingCall(Preferences.IncomingCallAction.NONE))
29 | .create();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/PlaylistChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import androidx.annotation.NonNull;
20 |
21 | import uk.org.ngo.squeezer.model.Player;
22 |
23 | /** Event sent when a player's play status changes. */
24 | public class PlaylistChanged {
25 | /** The affected player. */
26 | @NonNull
27 | public final Player player;
28 |
29 | public PlaylistChanged(@NonNull Player player) {
30 | this.player = player;
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | return "PlaylistChanged{" +
36 | "player=" + player +
37 | '}';
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/nature_sounds.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/PlayerStateChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 |
20 | import androidx.annotation.NonNull;
21 |
22 | import uk.org.ngo.squeezer.model.Player;
23 |
24 | /** Event sent when a player's state has changed. */
25 | public class PlayerStateChanged {
26 | /** The player with changed state. */
27 | @NonNull public final Player player;
28 |
29 | public PlayerStateChanged(@NonNull Player player) {
30 | this.player = player;
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | return "PlayerStateChanged{" +
36 | "player=" + player +
37 | '}';
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Squeezer/src/androidTest/java/uk/org/ngo/squeezer/test/util/ImageCacheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.test.util;
18 |
19 | import junit.framework.TestCase;
20 |
21 | import uk.org.ngo.squeezer.util.ImageCache;
22 |
23 | public class ImageCacheTest extends TestCase {
24 | /** Verify that hashKeyForDisk returns correct MD5 checksums. */
25 | public void testHashKeyForDisk() {
26 | assertEquals("acbd18db4cc2f85cedef654fccc4a4d8", ImageCache.hashKeyForDisk("foo"));
27 | assertEquals("37b51d194a7513e45b56f6524f2d51f2", ImageCache.hashKeyForDisk("bar"));
28 | assertEquals("73feffa4b7f6bb68e44cf984c85f6e88", ImageCache.hashKeyForDisk("baz"));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/PowerStatusChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import androidx.annotation.NonNull;
20 |
21 | import uk.org.ngo.squeezer.model.Player;
22 |
23 | /** Event sent when the power status of the player has changed. */
24 | public class PowerStatusChanged {
25 | /** The player with changed state. */
26 | @NonNull public final Player player;
27 |
28 | public PowerStatusChanged(@NonNull Player player) {
29 | this.player = player;
30 | }
31 |
32 | @NonNull
33 | @Override
34 | public String toString() {
35 | return "PowerStatusChanged{" +
36 | "player=" + player +
37 | '}';
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/AlertEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import androidx.annotation.NonNull;
20 |
21 | import uk.org.ngo.squeezer.model.AlertWindow;
22 |
23 | /** Event sent when a alert window message is received. */
24 | public class AlertEvent {
25 | /** The message to show. */
26 | @NonNull
27 | public final AlertWindow message;
28 |
29 | public boolean isShown = false;
30 |
31 | public AlertEvent(@NonNull AlertWindow message) {
32 | this.message = message;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return "AlertEvent{" +
38 | "message=" + message +
39 | '}';
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/SleepTimeChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import androidx.annotation.NonNull;
20 |
21 | import uk.org.ngo.squeezer.model.Player;
22 |
23 | /** Event sent when the sleep duration or remaining sleep time of the given song has changed. */
24 | public class SleepTimeChanged {
25 | /** The player with changed state. */
26 | @NonNull
27 | public final Player player;
28 |
29 | public SleepTimeChanged(@NonNull Player player) {
30 | this.player = player;
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | return "SleepTimeChanged{" +
36 | "player=" + player +
37 | '}';
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/charts.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
15 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_repeat_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_repeat_white.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/DisplayEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import androidx.annotation.NonNull;
20 |
21 | import uk.org.ngo.squeezer.model.DisplayMessage;
22 |
23 | /** Event sent when a display status message is received. */
24 | public class DisplayEvent {
25 | /** The message to show. */
26 | @NonNull
27 | public final DisplayMessage message;
28 |
29 | public boolean isShown = false;
30 |
31 | public DisplayEvent(@NonNull DisplayMessage message) {
32 | this.message = message;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return "DisplayEvent{" +
38 | "message=" + message +
39 | '}';
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/HomeMenuEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import android.util.Log;
20 |
21 | import androidx.annotation.NonNull;
22 |
23 | import java.util.List;
24 |
25 | import uk.org.ngo.squeezer.model.JiveItem;
26 |
27 | /** Event sent when the home menu has changed. */
28 | public class HomeMenuEvent {
29 |
30 | @NonNull
31 | public List menuItems;
32 |
33 | public HomeMenuEvent(@NonNull List menuItems) {
34 | this.menuItems = menuItems;
35 | }
36 |
37 | @NonNull
38 | @Override
39 | public String toString() {
40 | return "HomeMenuEvent{" +
41 | "menuItems=" + menuItems +
42 | '}';
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ic_repeat_off.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/apps_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/settings_repeat.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/util/SqueezeLite.java:
--------------------------------------------------------------------------------
1 | package uk.org.ngo.squeezer.util;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.pm.PackageManager;
6 | import android.os.Build;
7 | import android.util.Log;
8 | import android.widget.Toast;
9 |
10 | public class SqueezeLite {
11 | private static final String PACKAGE = "org.lyrion.squeezelite";
12 | private static final String SERVICE = "org.lyrion.squeezelite.PlayerService";
13 |
14 | private final Context context;
15 |
16 | public SqueezeLite(Context context) {
17 | this.context = context;
18 | }
19 |
20 | public static boolean has(Context context) {
21 | final PackageManager packageManager = context.getPackageManager();
22 | Intent intent = packageManager.getLaunchIntentForPackage(PACKAGE);
23 | return (intent != null);
24 | }
25 |
26 | public boolean has() {
27 | return has(context);
28 | }
29 |
30 | public void start() {
31 | Log.i("SqueezeLite", "start");
32 | Intent intent = new Intent().setClassName(PACKAGE, SERVICE);
33 | try {
34 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
35 | context.startForegroundService(intent);
36 | } else {
37 | context.startService(intent);
38 | }
39 | } catch (Exception e) {
40 | Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show();
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/youtube.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_folder.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/util/TimeUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.util;
18 |
19 | import java.text.DateFormatSymbols;
20 |
21 | public class TimeUtil {
22 |
23 | public static String timeFormat(int hour, int minute, boolean is24HourFormat) {
24 | String timeFormat = is24HourFormat ? "%02d:%02d" : "%d:%02d";
25 | int displayHour = hour;
26 | if (!is24HourFormat) {
27 | displayHour = displayHour % 12;
28 | if (displayHour == 0) displayHour = 12;
29 | }
30 |
31 | return String.format(timeFormat, displayHour, minute);
32 | }
33 |
34 | public static String formatAmPm(int hour) {
35 | String[] amPmStrings = new DateFormatSymbols().getAmPmStrings();
36 | String am = amPmStrings[0];
37 | String pm = amPmStrings[1];
38 |
39 | return (hour < 12 ? am : pm);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/ml_artists.xml:
--------------------------------------------------------------------------------
1 |
8 |
11 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/ListHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service;
18 |
19 | import java.util.List;
20 | import java.util.Map;
21 |
22 | /**
23 | * Implement this for each extended query format command you wish to support.
24 | *
25 | * @author Kurt Aaholst
26 | */
27 | interface ListHandler {
28 | /**
29 | * @return The type of item this handler can handle
30 | */
31 | Class getDataType();
32 |
33 | /**
34 | * @return The list of items received so far
35 | */
36 | List getItems();
37 |
38 | /**
39 | * Prepare for parsing an extended query format response
40 | */
41 | void clear();
42 |
43 | /**
44 | * Called for each item received in the current reply. Just store this internally.
45 | *
46 | * @param record Item data from Squeezebox Server
47 | */
48 | void add(Map record);
49 | }
50 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/edittext_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
24 |
25 |
29 |
30 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/docs/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {% seo %}
7 |
8 |
9 |
10 |
11 |
12 |
13 | {% include head-custom.html %}
14 |
16 |
17 |
18 | Skip to the content.
19 |
20 |
21 |
23 |
24 |
25 |
26 | {{ content }}
27 |
28 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/drawable/deezer_emblem.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/layout/clock.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
23 |
24 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/MusicChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import androidx.annotation.NonNull;
20 |
21 | import uk.org.ngo.squeezer.model.Player;
22 | import uk.org.ngo.squeezer.model.PlayerState;
23 |
24 | /** Event sent when the track the player is playing changes. */
25 | public class MusicChanged {
26 | /** The player with changed state. */
27 | @NonNull public final Player player;
28 |
29 | /** The active player's new state. */
30 | @NonNull
31 | public final PlayerState playerState;
32 |
33 | public MusicChanged(@NonNull Player player, @NonNull PlayerState playerState) {
34 | this.player = player;
35 | this.playerState = playerState;
36 | }
37 |
38 | @Override
39 | public String toString() {
40 | return "MusicChanged{" +
41 | "player=" + player +
42 | ", playerState=" + playerState +
43 | '}';
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/IntEditTextPreference.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer;
18 |
19 | import android.content.Context;
20 | import android.util.AttributeSet;
21 |
22 | import androidx.preference.EditTextPreference;
23 |
24 | public class IntEditTextPreference extends EditTextPreference {
25 |
26 | public IntEditTextPreference(Context context) {
27 | super(context);
28 | }
29 |
30 | public IntEditTextPreference(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | }
33 |
34 | public IntEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
35 | super(context, attrs, defStyle);
36 | }
37 |
38 | @Override
39 | protected String getPersistedString(String defaultReturnValue) {
40 | return String.valueOf(getPersistedInt(0));
41 | }
42 |
43 | @Override
44 | protected boolean persistString(String value) {
45 | return persistInt(Util.getInt(value));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/model/HelpText.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017 Kurt Aaholst
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.model;
18 |
19 | import android.os.Parcel;
20 |
21 | /**
22 | * Implements the of the LMS SqueezePlay interface.
23 | * http://wiki.slimdevices.com/index.php/SqueezeCenterSqueezePlayInterface#.3Cinput_fields.3E
24 | */
25 | public class HelpText {
26 | public String text;
27 | public String token;
28 |
29 | public static HelpText readFromParcel(Parcel source) {
30 | if (source.readInt() == 0) return null;
31 |
32 | HelpText helpText = new HelpText();
33 | helpText.text = source.readString();
34 | helpText.token = source.readString();
35 |
36 | return helpText;
37 | }
38 |
39 | public static void writeToParcel(Parcel dest, HelpText helpText) {
40 | dest.writeInt(helpText == null ? 0 : 1);
41 | if (helpText == null) return;
42 |
43 | dest.writeString(helpText.text);
44 | dest.writeString(helpText.token);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/Squeezer/src/main/res/menu/currentplaylistmenu.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
41 |
--------------------------------------------------------------------------------
/Squeezer/src/main/java/uk/org/ngo/squeezer/service/event/ConnectionChanged.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package uk.org.ngo.squeezer.service.event;
18 |
19 | import uk.org.ngo.squeezer.service.ConnectionError;
20 | import uk.org.ngo.squeezer.service.ConnectionState;
21 |
22 | /**
23 | * Event posted whenever the connection state to the server changes.
24 | */
25 | public class ConnectionChanged {
26 | /** The new connection state. */
27 | public ConnectionState.State connectionState;
28 | public ConnectionError connectionError;
29 |
30 | public ConnectionChanged(ConnectionState.State connectionState) {
31 | this.connectionState = connectionState;
32 | }
33 |
34 | public ConnectionChanged(ConnectionError connectionError) {
35 | this.connectionState = ConnectionState.State.CONNECTION_FAILED;
36 | this.connectionError = connectionError;
37 | }
38 |
39 | @Override
40 | public String toString() {
41 | return "ConnectionChanged{" + connectionState + '}';
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------