[Android] [PATCH 2/6] remove IAudioPlayerControl

Jean-Baptiste Kempf jb at videolan.org
Thu Jun 11 17:48:48 CEST 2015


LGTM.

On 11 Jun, Thomas Guillem wrote :
> ---
>  .../org/videolan/vlc/PlaybackServiceClient.java    | 30 +-------
>  .../vlc/interfaces/IAudioPlayerControl.java        | 81 ----------------------
>  2 files changed, 1 insertion(+), 110 deletions(-)
>  delete mode 100644 vlc-android/src/org/videolan/vlc/interfaces/IAudioPlayerControl.java
> 
> diff --git a/vlc-android/src/org/videolan/vlc/PlaybackServiceClient.java b/vlc-android/src/org/videolan/vlc/PlaybackServiceClient.java
> index bddb420..4b212b7 100644
> --- a/vlc-android/src/org/videolan/vlc/PlaybackServiceClient.java
> +++ b/vlc-android/src/org/videolan/vlc/PlaybackServiceClient.java
> @@ -32,7 +32,6 @@ import android.preference.PreferenceManager;
>  import android.util.Log;
>  
>  import org.videolan.vlc.interfaces.IAudioPlayer;
> -import org.videolan.vlc.interfaces.IAudioPlayerControl;
>  import org.videolan.vlc.interfaces.IPlaybackService;
>  import org.videolan.vlc.interfaces.IPlaybackServiceCallback;
>  
> @@ -41,7 +40,7 @@ import java.lang.reflect.Method;
>  import java.util.ArrayList;
>  import java.util.List;
>  
> -public class PlaybackServiceClient implements IAudioPlayerControl {
> +public class PlaybackServiceClient {
>      public static final String TAG = "PlaybackServiceClient";
>  
>      private static PlaybackServiceClient mInstance;
> @@ -387,92 +386,74 @@ public class PlaybackServiceClient implements IAudioPlayerControl {
>                  new Object[] { i } );
>      }
>  
> -    @Override
>      public String getAlbum() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getAlbum", null, null);
>      }
>  
> -    @Override
>      public String getArtist() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getArtist", null, null);
>      }
>  
> -    @Override
>      public String getArtistPrev() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getArtistPrev", null, null);
>      }
>  
> -    @Override
>      public String getArtistNext() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getArtistNext", null, null);
>      }
>  
> -    @Override
>      public String getTitle() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getTitle", null, null);
>      }
>  
> -    @Override
>      public String getTitlePrev() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getTitlePrev", null, null);
>      }
>  
> -    @Override
>      public String getTitleNext() {
>          return remoteProcedureCall(mAudioServiceBinder, String.class, (String)null, "getTitleNext", null, null);
>      }
>  
> -    @Override
>      public boolean isPlaying() {
>          return hasMedia() && remoteProcedureCall(mAudioServiceBinder, boolean.class, false, "isPlaying", null, null);
>      }
>  
> -    @Override
>      public void pause() {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "pause", null, null);
>      }
>  
> -    @Override
>      public void play() {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "play", null, null);
>      }
>  
> -    @Override
>      public boolean hasMedia() {
>          return remoteProcedureCall(mAudioServiceBinder, boolean.class, false, "hasMedia", null, null);
>      }
>  
> -    @Override
>      public int getLength() {
>          return remoteProcedureCall(mAudioServiceBinder, int.class, 0, "getLength", null, null);
>      }
>  
> -    @Override
>      public int getTime() {
>          return remoteProcedureCall(mAudioServiceBinder, int.class, 0, "getTime", null, null);
>      }
>  
> -    @Override
>      public Bitmap getCover() {
>          return remoteProcedureCall(mAudioServiceBinder, Bitmap.class, (Bitmap)null, "getCover", null, null);
>      }
>  
> -    @Override
>      public Bitmap getCoverPrev() {
>          return remoteProcedureCall(mAudioServiceBinder, Bitmap.class, (Bitmap)null, "getCoverPrev", null, null);
>      }
>  
> -    @Override
>      public Bitmap getCoverNext() {
>          return remoteProcedureCall(mAudioServiceBinder, Bitmap.class, (Bitmap)null, "getCoverNext", null, null);
>      }
>  
> -    @Override
>      public void next() {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "next", null, null);
>      }
>  
> -    @Override
>      public void previous() {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "previous", null, null);
>      }
> @@ -483,53 +464,44 @@ public class PlaybackServiceClient implements IAudioPlayerControl {
>                  new Object[] { time } );
>      }
>  
> -    @Override
>      public boolean hasNext() {
>          return remoteProcedureCall(mAudioServiceBinder, boolean.class, false, "hasNext", null, null);
>      }
>  
> -    @Override
>      public boolean hasPrevious() {
>          return remoteProcedureCall(mAudioServiceBinder, boolean.class, false, "hasPrevious", null, null);
>      }
>  
> -    @Override
>      public void shuffle() {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "shuffle", null, null);
>      }
>  
> -    @Override
>      public void setRepeatType(PlaybackService.RepeatType t) {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "setRepeatType",
>                  new Class<?>[] { int.class },
>                  new Object[] { t.ordinal() } );
>      }
>  
> -    @Override
>      public boolean isShuffling() {
>          return remoteProcedureCall(mAudioServiceBinder, boolean.class, false, "isShuffling", null, null);
>      }
>  
> -    @Override
>      public PlaybackService.RepeatType getRepeatType() {
>          return PlaybackService.RepeatType.values()[
>              remoteProcedureCall(mAudioServiceBinder, int.class, PlaybackService.RepeatType.None.ordinal(), "getRepeatType", null, null)
>          ];
>      }
>  
> -    @Override
>      public void detectHeadset(boolean enable) {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, null, "detectHeadset",
>                  new Class<?>[] { boolean.class },
>                  new Object[] { enable } );
>      }
>  
> -    @Override
>      public float getRate() {
>          return remoteProcedureCall(mAudioServiceBinder, Float.class, (float) 1.0, "getRate", null, null);
>      }
>  
> -    @Override
>      public void handleVout() {
>          remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "handleVout", null, null);
>      }
> diff --git a/vlc-android/src/org/videolan/vlc/interfaces/IAudioPlayerControl.java b/vlc-android/src/org/videolan/vlc/interfaces/IAudioPlayerControl.java
> deleted file mode 100644
> index 025a832..0000000
> --- a/vlc-android/src/org/videolan/vlc/interfaces/IAudioPlayerControl.java
> +++ /dev/null
> @@ -1,81 +0,0 @@
> -/*****************************************************************************
> - * IAudioPlayer.java
> - *****************************************************************************
> - * Copyright © 2011-2012 VLC authors and VideoLAN
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
> - *****************************************************************************/
> -
> -package org.videolan.vlc.interfaces;
> -
> -import org.videolan.vlc.PlaybackService;
> -
> -import android.graphics.Bitmap;
> -
> -public interface IAudioPlayerControl {
> -    String getTitle();
> -
> -    String getTitlePrev();
> -
> -    String getTitleNext();
> -
> -    String getArtist();
> -
> -    String getArtistPrev();
> -
> -    String getArtistNext();
> -
> -    String getAlbum();
> -
> -    Bitmap getCover();
> -
> -    Bitmap getCoverPrev();
> -
> -    Bitmap getCoverNext();
> -
> -    int getLength();
> -
> -    int getTime();
> -
> -    boolean hasMedia();
> -
> -    boolean hasNext();
> -
> -    boolean hasPrevious();
> -
> -    void play();
> -
> -    void pause();
> -
> -    boolean isPlaying();
> -
> -    void next();
> -
> -    void previous();
> -
> -    void shuffle();
> -
> -    boolean isShuffling();
> -
> -    void setRepeatType(PlaybackService.RepeatType t);
> -
> -    PlaybackService.RepeatType getRepeatType();
> -
> -    void detectHeadset(boolean enable);
> -
> -    float getRate();
> -
> -    void handleVout();
> -}
> -- 
> 2.1.4
> 
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the Android mailing list