Skip to content

Commit

Permalink
Create and register basic A/V callback classes
Browse files Browse the repository at this point in the history
  • Loading branch information
markwinter committed Sep 3, 2014
1 parent 4ffcf56 commit ef0e5d8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package im.tox.antox.callbacks;

import android.content.Context;

import im.tox.antox.utils.AntoxFriend;
import im.tox.jtoxcore.callbacks.OnAudioDataCallback;

/**
* Created by Mark Winter on 03/09/14.
*/
public class AntoxOnAudioDataCallback implements OnAudioDataCallback<AntoxFriend> {

private Context ctx;

public AntoxOnAudioDataCallback(Context ctx) {
this.ctx = ctx;
}

public void execute(int callID, byte[] data) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package im.tox.antox.callbacks;

import android.content.Context;

import im.tox.antox.utils.AntoxFriend;
import im.tox.jtoxcore.ToxAvCallbackID;
import im.tox.jtoxcore.callbacks.OnAvCallbackCallback;

/**
* Created by Mark Winter on 03/09/14.
*/
public class AntoxOnAvCallbackCallback implements OnAvCallbackCallback<AntoxFriend> {

private Context ctx;

public AntoxOnAvCallbackCallback(Context ctx) {
this.ctx = ctx;
}

public void execute(int callID, ToxAvCallbackID callbackID) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package im.tox.antox.callbacks;

import android.content.Context;

import im.tox.antox.utils.AntoxFriend;
import im.tox.jtoxcore.callbacks.OnVideoDataCallback;

/**
* Created by Mark Winter on 03/09/14.
*/
public class AntoxOnVideoDataCallback implements OnVideoDataCallback<AntoxFriend> {

private Context ctx;

public AntoxOnVideoDataCallback(Context ctx) {
this.ctx = ctx;
}

public void execute(int callID, byte[] data, int width, int height) {

}
}
7 changes: 7 additions & 0 deletions app/src/main/java/im/tox/antox/tox/ToxSingleton.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.concurrent.ExecutionException;

import im.tox.antox.callbacks.AntoxOnActionCallback;
import im.tox.antox.callbacks.AntoxOnAudioDataCallback;
import im.tox.antox.callbacks.AntoxOnAvCallbackCallback;
import im.tox.antox.callbacks.AntoxOnConnectionStatusCallback;
import im.tox.antox.callbacks.AntoxOnFileControlCallback;
import im.tox.antox.callbacks.AntoxOnFileDataCallback;
Expand All @@ -34,6 +36,7 @@
import im.tox.antox.callbacks.AntoxOnStatusMessageCallback;
import im.tox.antox.callbacks.AntoxOnTypingChangeCallback;
import im.tox.antox.callbacks.AntoxOnUserStatusCallback;
import im.tox.antox.callbacks.AntoxOnVideoDataCallback;
import im.tox.antox.data.AntoxDB;
import im.tox.antox.utils.AntoxFriend;
import im.tox.antox.utils.AntoxFriendList;
Expand Down Expand Up @@ -695,6 +698,10 @@ public void initTox(Context ctx) {
AntoxOnFileControlCallback antoxOnFileControlCallback = new AntoxOnFileControlCallback(ctx);
AntoxOnFileDataCallback antoxOnFileDataCallback = new AntoxOnFileDataCallback(ctx);

AntoxOnAudioDataCallback antoxOnAudioDataCallback = new AntoxOnAudioDataCallback(ctx);
AntoxOnAvCallbackCallback antoxOnAvCallbackCallback = new AntoxOnAvCallbackCallback(ctx);
AntoxOnVideoDataCallback antoxOnVideoDataCallback = new AntoxOnVideoDataCallback(ctx);

callbackHandler.registerOnMessageCallback(antoxOnMessageCallback);
callbackHandler.registerOnFriendRequestCallback(antoxOnFriendRequestCallback);
callbackHandler.registerOnActionCallback(antoxOnActionCallback);
Expand Down

0 comments on commit ef0e5d8

Please sign in to comment.