Browse Source

Whitespace

tags/2021-05-28
jules 7 years ago
parent
commit
e11bd2494b
2 changed files with 174 additions and 174 deletions
  1. +144
    -144
      modules/juce_core/native/java/AndroidVideo.java
  2. +30
    -30
      modules/juce_core/native/java/JuceAppActivity.java

+ 144
- 144
modules/juce_core/native/java/AndroidVideo.java View File

@@ -1,146 +1,146 @@
$$VideoApi21
//==============================================================================
public class MediaControllerCallback extends MediaController.Callback
{
private native void mediaControllerAudioInfoChanged (long host, MediaController.PlaybackInfo info);
private native void mediaControllerMetadataChanged (long host, MediaMetadata metadata);
private native void mediaControllerPlaybackStateChanged (long host, PlaybackState state);
private native void mediaControllerSessionDestroyed (long host);
MediaControllerCallback (long hostToUse)
{
host = hostToUse;
}
@Override
public void onAudioInfoChanged (MediaController.PlaybackInfo info)
{
mediaControllerAudioInfoChanged (host, info);
}
@Override
public void onMetadataChanged (MediaMetadata metadata)
{
mediaControllerMetadataChanged (host, metadata);
}
@Override
public void onPlaybackStateChanged (PlaybackState state)
{
mediaControllerPlaybackStateChanged (host, state);
}
@Override
public void onQueueChanged (List<MediaSession.QueueItem> queue) {}
@Override
public void onSessionDestroyed()
{
mediaControllerSessionDestroyed (host);
}
private long host;
}
//==============================================================================
public class MediaSessionCallback extends MediaSession.Callback
{
private native void mediaSessionPause (long host);
private native void mediaSessionPlay (long host);
private native void mediaSessionPlayFromMediaId (long host, String mediaId, Bundle extras);
private native void mediaSessionSeekTo (long host, long pos);
private native void mediaSessionStop (long host);
MediaSessionCallback (long hostToUse)
{
host = hostToUse;
}
@Override
public void onPause()
{
mediaSessionPause (host);
}
@Override
public void onPlay()
{
mediaSessionPlay (host);
}
@Override
public void onPlayFromMediaId (String mediaId, Bundle extras)
{
mediaSessionPlayFromMediaId (host, mediaId, extras);
}
@Override
public void onSeekTo (long pos)
{
mediaSessionSeekTo (host, pos);
}
@Override
public void onStop()
{
mediaSessionStop (host);
}
@Override
public void onFastForward() {}
@Override
public boolean onMediaButtonEvent (Intent mediaButtonIntent)
{
return true;
}
@Override
public void onRewind() {}
@Override
public void onSkipToNext() {}
@Override
public void onSkipToPrevious() {}
@Override
public void onSkipToQueueItem (long id) {}
private long host;
}
//==============================================================================
public class SystemVolumeObserver extends ContentObserver
{
private native void mediaSessionSystemVolumeChanged (long host);
SystemVolumeObserver (Activity activityToUse, long hostToUse)
{
super (null);
activity = activityToUse;
host = hostToUse;
}
void setEnabled (boolean shouldBeEnabled)
{
if (shouldBeEnabled)
activity.getApplicationContext().getContentResolver().registerContentObserver (android.provider.Settings.System.CONTENT_URI, true, this);
else
activity.getApplicationContext().getContentResolver().unregisterContentObserver (this);
}
@Override
public void onChange (boolean selfChange, Uri uri)
{
if (uri.toString().startsWith ("content://settings/system/volume_music"))
mediaSessionSystemVolumeChanged (host);
}
private Activity activity;
private long host;
}
$$VideoApi21
//==============================================================================
public class MediaControllerCallback extends MediaController.Callback
{
private native void mediaControllerAudioInfoChanged (long host, MediaController.PlaybackInfo info);
private native void mediaControllerMetadataChanged (long host, MediaMetadata metadata);
private native void mediaControllerPlaybackStateChanged (long host, PlaybackState state);
private native void mediaControllerSessionDestroyed (long host);
MediaControllerCallback (long hostToUse)
{
host = hostToUse;
}
@Override
public void onAudioInfoChanged (MediaController.PlaybackInfo info)
{
mediaControllerAudioInfoChanged (host, info);
}
@Override
public void onMetadataChanged (MediaMetadata metadata)
{
mediaControllerMetadataChanged (host, metadata);
}
@Override
public void onPlaybackStateChanged (PlaybackState state)
{
mediaControllerPlaybackStateChanged (host, state);
}
@Override
public void onQueueChanged (List<MediaSession.QueueItem> queue) {}
@Override
public void onSessionDestroyed()
{
mediaControllerSessionDestroyed (host);
}
private long host;
}
//==============================================================================
public class MediaSessionCallback extends MediaSession.Callback
{
private native void mediaSessionPause (long host);
private native void mediaSessionPlay (long host);
private native void mediaSessionPlayFromMediaId (long host, String mediaId, Bundle extras);
private native void mediaSessionSeekTo (long host, long pos);
private native void mediaSessionStop (long host);
MediaSessionCallback (long hostToUse)
{
host = hostToUse;
}
@Override
public void onPause()
{
mediaSessionPause (host);
}
@Override
public void onPlay()
{
mediaSessionPlay (host);
}
@Override
public void onPlayFromMediaId (String mediaId, Bundle extras)
{
mediaSessionPlayFromMediaId (host, mediaId, extras);
}
@Override
public void onSeekTo (long pos)
{
mediaSessionSeekTo (host, pos);
}
@Override
public void onStop()
{
mediaSessionStop (host);
}
@Override
public void onFastForward() {}
@Override
public boolean onMediaButtonEvent (Intent mediaButtonIntent)
{
return true;
}
@Override
public void onRewind() {}
@Override
public void onSkipToNext() {}
@Override
public void onSkipToPrevious() {}
@Override
public void onSkipToQueueItem (long id) {}
private long host;
}
//==============================================================================
public class SystemVolumeObserver extends ContentObserver
{
private native void mediaSessionSystemVolumeChanged (long host);
SystemVolumeObserver (Activity activityToUse, long hostToUse)
{
super (null);
activity = activityToUse;
host = hostToUse;
}
void setEnabled (boolean shouldBeEnabled)
{
if (shouldBeEnabled)
activity.getApplicationContext().getContentResolver().registerContentObserver (android.provider.Settings.System.CONTENT_URI, true, this);
else
activity.getApplicationContext().getContentResolver().unregisterContentObserver (this);
}
@Override
public void onChange (boolean selfChange, Uri uri)
{
if (uri.toString().startsWith ("content://settings/system/volume_music"))
mediaSessionSystemVolumeChanged (host);
}
private Activity activity;
private long host;
}
VideoApi21$$

+ 30
- 30
modules/juce_core/native/java/JuceAppActivity.java View File

@@ -30,7 +30,7 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
$$JuceAndroidCameraImports$$ // If you get an error here, you need to re-save your project with the Projucer!
$$JuceAndroidCameraImports$$ // If you get an error here, you need to re-save your project with the Projucer!
$$JuceAndroidVideoImports$$ // If you get an error here, you need to re-save your project with the Projucer!
import android.net.http.SslError;
import android.net.Uri;
@@ -88,11 +88,11 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
}
//==============================================================================
public boolean isPermissionDeclaredInManifest (int permissionID)
{
return isPermissionDeclaredInManifest (getAndroidPermissionName (permissionID));
}
public boolean isPermissionDeclaredInManifest (int permissionID)
{
return isPermissionDeclaredInManifest (getAndroidPermissionName (permissionID));
}
public boolean isPermissionDeclaredInManifest (String permissionToCheck)
{
try
@@ -478,8 +478,8 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
public final String getClipboardContent()
{
ClipboardManager clipboard = (ClipboardManager) getSystemService (CLIPBOARD_SERVICE);
CharSequence content = clipboard.getText();
CharSequence content = clipboard.getText();
return content != null ? content.toString() : new String();
}
@@ -988,13 +988,13 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
public static class NativeSurfaceView extends SurfaceView
implements SurfaceHolder.Callback
{
private long nativeContext = 0;
private long nativeContext = 0;
private boolean forVideo;
NativeSurfaceView (Context context, long nativeContextPtr, boolean createdForVideo)
{
super (context);
nativeContext = nativeContextPtr;
nativeContext = nativeContextPtr;
forVideo = createdForVideo;
}
@@ -1012,39 +1012,39 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
//==============================================================================
@Override
public void surfaceChanged (SurfaceHolder holder, int format, int width, int height)
{
{
if (forVideo)
surfaceChangedNativeVideo (nativeContext, holder, format, width, height);
else
surfaceChangedNativeVideo (nativeContext, holder, format, width, height);
else
surfaceChangedNative (nativeContext, holder, format, width, height);
}
@Override
public void surfaceCreated (SurfaceHolder holder)
{
{
if (forVideo)
surfaceCreatedNativeVideo (nativeContext, holder);
else
surfaceCreatedNativeVideo (nativeContext, holder);
else
surfaceCreatedNative (nativeContext, holder);
}
@Override
public void surfaceDestroyed (SurfaceHolder holder)
{
{
if (forVideo)
surfaceDestroyedNativeVideo (nativeContext, holder);
else
surfaceDestroyedNativeVideo (nativeContext, holder);
else
surfaceDestroyedNative (nativeContext, holder);
}
@Override
protected void dispatchDraw (Canvas canvas)
{
super.dispatchDraw (canvas);
super.dispatchDraw (canvas);
if (forVideo)
dispatchDrawNativeVideo (nativeContext, canvas);
else
dispatchDrawNativeVideo (nativeContext, canvas);
else
dispatchDrawNative (nativeContext, canvas);
}
@@ -1068,12 +1068,12 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
private native void surfaceCreatedNative (long nativeContextptr, SurfaceHolder holder);
private native void surfaceDestroyedNative (long nativeContextptr, SurfaceHolder holder);
private native void surfaceChangedNative (long nativeContextptr, SurfaceHolder holder,
int format, int width, int height);
private native void dispatchDrawNativeVideo (long nativeContextPtr, Canvas canvas);
private native void surfaceCreatedNativeVideo (long nativeContextptr, SurfaceHolder holder);
private native void surfaceDestroyedNativeVideo (long nativeContextptr, SurfaceHolder holder);
private native void surfaceChangedNativeVideo (long nativeContextptr, SurfaceHolder holder,
int format, int width, int height);
private native void dispatchDrawNativeVideo (long nativeContextPtr, Canvas canvas);
private native void surfaceCreatedNativeVideo (long nativeContextptr, SurfaceHolder holder);
private native void surfaceDestroyedNativeVideo (long nativeContextptr, SurfaceHolder holder);
private native void surfaceChangedNativeVideo (long nativeContextptr, SurfaceHolder holder,
int format, int width, int height);
}
@@ -1637,7 +1637,7 @@ $$JuceAndroidWebViewNativeCode$$ // If you get an error here, you need to re-sav
private final Object hostLock = new Object();
}
$$JuceAndroidCameraCode$$ // If you get an error here, you need to re-save your project with the Projucer!
$$JuceAndroidCameraCode$$ // If you get an error here, you need to re-save your project with the Projucer!
$$JuceAndroidVideoCode$$ // If you get an error here, you need to re-save your project with the Projucer!
//==============================================================================


Loading…
Cancel
Save