Refactor
This commit is contained in:
parent
2e19bba6b9
commit
383a833c30
|
@ -170,7 +170,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +544,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,7 +619,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,7 +750,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,7 +823,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -933,7 +933,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1020,7 +1020,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,7 +1119,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,14 +175,14 @@ public abstract class MediaplayerActivity extends AppCompatActivity implements O
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlaybackSpeedAvailableChanged() {
|
public void onSetSpeedAbilityChanged() {
|
||||||
MediaplayerActivity.this.onPlaybackSpeedAvailableChanged();
|
MediaplayerActivity.this.onSetSpeedAbilityChanged();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onPlaybackSpeedAvailableChanged() {
|
protected void onSetSpeedAbilityChanged() {
|
||||||
Log.d(TAG, "onPlaybackSpeedAvailableChanged()");
|
Log.d(TAG, "onSetSpeedAbilityChanged()");
|
||||||
updatePlaybackSpeedButton();
|
updatePlaybackSpeedButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,9 @@ public class PlaybackService extends Service {
|
||||||
public static final int NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE = 8;
|
public static final int NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE = 8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Playback speed has changed
|
* Ability to set the playback speed has changed
|
||||||
*/
|
*/
|
||||||
public static final int NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE_AVAILABLE_CHANGED = 9;
|
public static final int NOTIFICATION_TYPE_SET_SPEED_ABILITY_CHANGED = 9;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returned by getPositionSafe() or getDurationSafe() if the playbackService
|
* Returned by getPositionSafe() or getDurationSafe() if the playbackService
|
||||||
|
@ -520,8 +520,8 @@ public class PlaybackService extends Service {
|
||||||
sendNotificationBroadcast(NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE, 0);
|
sendNotificationBroadcast(NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playbackSpeedAvailableChanged() {
|
public void setSpeedAbilityChanged() {
|
||||||
sendNotificationBroadcast(NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE_AVAILABLE_CHANGED, 0);
|
sendNotificationBroadcast(NOTIFICATION_TYPE_SET_SPEED_ABILITY_CHANGED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1018,7 +1018,7 @@ public class PlaybackServiceMediaPlayer implements SharedPreferences.OnSharedPre
|
||||||
|
|
||||||
void playbackSpeedChanged(float s);
|
void playbackSpeedChanged(float s);
|
||||||
|
|
||||||
void playbackSpeedAvailableChanged();
|
void setSpeedAbilityChanged();
|
||||||
|
|
||||||
void onBufferingUpdate(int percent);
|
void onBufferingUpdate(int percent);
|
||||||
|
|
||||||
|
@ -1040,7 +1040,7 @@ public class PlaybackServiceMediaPlayer implements SharedPreferences.OnSharedPre
|
||||||
((AudioPlayer) mp)
|
((AudioPlayer) mp)
|
||||||
.setOnBufferingUpdateListener(audioBufferingUpdateListener);
|
.setOnBufferingUpdateListener(audioBufferingUpdateListener);
|
||||||
((AudioPlayer) mp).setOnInfoListener(audioInfoListener);
|
((AudioPlayer) mp).setOnInfoListener(audioInfoListener);
|
||||||
((AudioPlayer) mp).setOnSpeedAdjustmentAvailableChangedListener(audioSpeedAvailableChangedListener);
|
((AudioPlayer) mp).setOnSpeedAdjustmentAvailableChangedListener(audioSetSpeedAbilityListener);
|
||||||
} else {
|
} else {
|
||||||
((VideoPlayer) mp)
|
((VideoPlayer) mp)
|
||||||
.setOnCompletionListener(videoCompletionListener);
|
.setOnCompletionListener(videoCompletionListener);
|
||||||
|
@ -1086,10 +1086,10 @@ public class PlaybackServiceMediaPlayer implements SharedPreferences.OnSharedPre
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MediaPlayer.OnSpeedAdjustmentAvailableChangedListener
|
private final MediaPlayer.OnSpeedAdjustmentAvailableChangedListener
|
||||||
audioSpeedAvailableChangedListener = new MediaPlayer.OnSpeedAdjustmentAvailableChangedListener() {
|
audioSetSpeedAbilityListener = new MediaPlayer.OnSpeedAdjustmentAvailableChangedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSpeedAdjustmentAvailableChanged(MediaPlayer arg0, boolean speedAdjustmentAvailable) {
|
public void onSpeedAdjustmentAvailableChanged(MediaPlayer arg0, boolean speedAdjustmentAvailable) {
|
||||||
callback.playbackSpeedAvailableChanged();
|
callback.setSpeedAbilityChanged();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -336,8 +336,8 @@ public abstract class PlaybackController {
|
||||||
case PlaybackService.NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE:
|
case PlaybackService.NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE:
|
||||||
onPlaybackSpeedChange();
|
onPlaybackSpeedChange();
|
||||||
break;
|
break;
|
||||||
case PlaybackService.NOTIFICATION_TYPE_PLAYBACK_SPEED_CHANGE_AVAILABLE_CHANGED:
|
case PlaybackService.NOTIFICATION_TYPE_SET_SPEED_ABILITY_CHANGED:
|
||||||
onPlaybackSpeedAvailableChanged();
|
onSetSpeedAbilityChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ public abstract class PlaybackController {
|
||||||
|
|
||||||
public void onPlaybackSpeedChange() {}
|
public void onPlaybackSpeedChange() {}
|
||||||
|
|
||||||
public void onPlaybackSpeedAvailableChanged() {}
|
public void onSetSpeedAbilityChanged() {}
|
||||||
|
|
||||||
public void onShutdownNotification() {}
|
public void onShutdownNotification() {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue