本文整理汇总了Java中master.flame.danmaku.danmaku.model.DanmakuTimer类的典型用法代码示例。如果您正苦于以下问题:Java DanmakuTimer类的具体用法?Java DanmakuTimer怎么用?Java DanmakuTimer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DanmakuTimer类属于master.flame.danmaku.danmaku.model包,在下文中一共展示了DanmakuTimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: needFilter
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public synchronized boolean needFilter(BaseDanmaku danmaku, int index, int totalsizeInScreen, DanmakuTimer timer, boolean fromCachingTask) {
boolean z = true;
synchronized (this) {
removeTimeoutDanmakus(this.blockedDanmakus, 2);
removeTimeoutDanmakus(this.passedDanmakus, 2);
removeTimeoutDanmakus(this.currentDanmakus, 3);
if (!this.blockedDanmakus.contains(danmaku) || danmaku.isOutside()) {
if (this.passedDanmakus.contains(danmaku)) {
z = false;
} else if (this.currentDanmakus.containsKey(danmaku.text)) {
this.currentDanmakus.put(String.valueOf(danmaku.text), danmaku);
this.blockedDanmakus.removeItem(danmaku);
this.blockedDanmakus.addItem(danmaku);
} else {
this.currentDanmakus.put(String.valueOf(danmaku.text), danmaku);
this.passedDanmakus.addItem(danmaku);
z = false;
}
}
}
return z;
}
示例2: createDrawTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
private IDrawTask createDrawTask(boolean useDrwaingCache, DanmakuTimer timer,
Context context,
int width, int height,
boolean isHardwareAccelerated,
IDrawTask.TaskListener taskListener) {
mDisp = mContext.getDisplayer();
mDisp.setSize(width, height);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
mDisp.setDensities(displayMetrics.density, displayMetrics.densityDpi,
displayMetrics.scaledDensity);
mDisp.resetSlopPixel(mContext.scaleTextSize);
mDisp.setHardwareAccelerated(isHardwareAccelerated);
IDrawTask task = useDrwaingCache ?
new CacheManagingDrawTask(timer, mContext, taskListener, 1024 * 1024 * AndroidUtils.getMemoryClass(context) / 3)
: new DrawTask(timer, mContext, taskListener);
task.setParser(mParser);
task.prepare();
obtainMessage(NOTIFY_DISP_SIZE_CHANGED, false).sendToTarget();
return task;
}
示例3: needFilter
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
private boolean needFilter(BaseDanmaku danmaku, int orderInScreen,
int totalSizeInScreen, DanmakuTimer timer, boolean fromCachingTask, DanmakuContext context) {
if (mMaximumSize <= 0 || danmaku.getType() != BaseDanmaku.TYPE_SCROLL_RL) {
return false;
}
if (totalSizeInScreen < mMaximumSize || danmaku.isShown()
|| (mLastSkipped != null && (danmaku.time - mLastSkipped.time > context.mDanmakuFactory.MAX_DANMAKU_DURATION / 20))) {
mLastSkipped = danmaku;
return false;
}
if (orderInScreen > mMaximumSize && !danmaku.isTimeOut()) {
return true;
}
mLastSkipped = danmaku;
return false;
}
示例4: DrawTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public DrawTask(DanmakuTimer timer, DanmakuContext context,
TaskListener taskListener) {
if (context == null) {
throw new IllegalArgumentException("context is null");
}
mContext = context;
mDisp = context.getDisplayer();
mTaskListener = taskListener;
mRenderer = new DanmakuRenderer(context);
mRenderer.setVerifierEnabled(mContext.isPreventOverlappingEnabled() || mContext.isMaxLinesLimited());
initTimer(timer);
Boolean enable = mContext.isDuplicateMergingEnabled();
if (enable != null) {
if(enable) {
mContext.mDanmakuFilters.registerFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
} else {
mContext.mDanmakuFilters.unregisterFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
}
}
}
示例5: initDanmaku
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
protected void initDanmaku(DanmakuSurfaceView danmakuSurfaceView, BaseDanmakuParser parser) {
if (danmakuSurfaceView != null) {
//parser = createParser(null);
danmakuSurfaceView.setCallback(new DrawHandler.Callback() {
@Override public void updateTimer(DanmakuTimer timer) {
}
@Override public void prepared() {
danmakuSurfaceView.start();
}
});
danmakuSurfaceView.prepare(parser);
//danmakuSurfaceView.showFPS(true);
danmakuSurfaceView.enableDanmakuDrawingCache(true);
danmakuSurfaceView.setZOrderOnTop(true);
danmakuSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
}
示例6: createTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
private IDrawTask createTask(boolean useDrwaingCache, DanmakuTimer timer, Context context,
int width, int height, IDrawTask.TaskListener taskListener) {
mDisp = new AndroidDisplayer();
mDisp.setSize(width, height);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
mDisp.setDensities(displayMetrics.density, displayMetrics.densityDpi,
displayMetrics.scaledDensity);
mDisp.resetSlopPixel(DanmakuGlobalConfig.DEFAULT.scaleTextSize);
obtainMessage(NOTIFY_DISP_SIZE_CHANGED, false).sendToTarget();
IDrawTask task = useDrwaingCache ? new CacheManagingDrawTask(timer, context, mDisp,
taskListener, 1024 * 1024 * AndroidUtils.getMemoryClass(context) / 3)
: new DrawTask(timer, context, mDisp, taskListener);
task.setParser(mParser);
task.prepare();
return task;
}
示例7: drawDanmakus
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
protected RenderingState drawDanmakus(AbsDisplayer<?> disp, DanmakuTimer timer) {
if (danmakuList != null) {
Canvas canvas = (Canvas) disp.getExtraData();
if (clearFlag > 0) {
DrawHelper.clearCanvas(canvas);
clearFlag--;
} else {
float[] refreshRect = mRenderer.getRefreshArea().mRefreshRect;
mRectCache.push(refreshRect);
float[] rect = mRectCache.getRect();
DrawHelper.clearCanvas(canvas, Math.max(0, rect[0]), Math.max(0, rect[1]),
Math.min(disp.getWidth(), rect[2]), Math.min(disp.getHeight(), rect[3]));
}
long currMills = timer.currMillisecond;
danmakus = danmakuList.sub(currMills - DanmakuFactory.MAX_DANMAKU_DURATION - 100,
currMills);
if (danmakus != null) {
return mRenderer.draw(mDisp, danmakus, mStartRenderTime);
}
}
return null;
}
示例8: filter
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
@Override
public synchronized boolean filter(BaseDanmaku danmaku, int orderInScreen, int totalsizeInScreen,
DanmakuTimer timer) {
if (danmakus.last() != null && danmakus.last().isTimeOut()) {
danmakus.clear();
}
if (danmakus.contains(danmaku)) {
return true;
}
if (timer == null || !danmaku.isOutside()) {
return false;
}
long elapsedTime = System.currentTimeMillis() - timer.currMillisecond;
if (elapsedTime >= mMaxTime) {
danmakus.addItem(danmaku);
return true;
}
return false;
}
示例9: createDrawTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
private IDrawTask createDrawTask(boolean useDrwaingCache, DanmakuTimer timer, Context context, int width, int height, boolean isHardwareAccelerated, TaskListener taskListener) {
this.mDisp = this.mContext.getDisplayer();
this.mDisp.setSize(width, height);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
this.mDisp.setDensities(displayMetrics.density, displayMetrics.densityDpi, displayMetrics.scaledDensity);
this.mDisp.resetSlopPixel(this.mContext.scaleTextSize);
this.mDisp.setHardwareAccelerated(isHardwareAccelerated);
IDrawTask task = useDrwaingCache ? new CacheManagingDrawTask(timer, this.mContext, taskListener, (1048576 * AndroidUtils.getMemoryClass(context)) / 3) : new DrawTask(timer, this.mContext, taskListener);
task.setParser(this.mParser);
task.prepare();
obtainMessage(10, Boolean.valueOf(false)).sendToTarget();
return task;
}
示例10: DrawTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public DrawTask(DanmakuTimer timer, DanmakuContext context, TaskListener taskListener) {
boolean z = false;
if (context == null) {
throw new IllegalArgumentException("context is null");
}
this.mContext = context;
this.mDisp = context.getDisplayer();
this.mTaskListener = taskListener;
this.mRenderer = new DanmakuRenderer(context);
this.mRenderer.setOnDanmakuShownListener(new OnDanmakuShownListener() {
public void onDanmakuShown(BaseDanmaku danmaku) {
if (DrawTask.this.mTaskListener != null) {
DrawTask.this.mTaskListener.onDanmakuShown(danmaku);
}
}
});
IRenderer iRenderer = this.mRenderer;
if (this.mContext.isPreventOverlappingEnabled() || this.mContext.isMaxLinesLimited()) {
z = true;
}
iRenderer.setVerifierEnabled(z);
initTimer(timer);
Boolean enable = Boolean.valueOf(this.mContext.isDuplicateMergingEnabled());
if (enable == null) {
return;
}
if (enable.booleanValue()) {
this.mContext.mDanmakuFilters.registerFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
} else {
this.mContext.mDanmakuFilters.unregisterFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
}
}
示例11: filter
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen, DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = needFilter(danmaku, index, totalsizeInScreen, timer, fromCachingTask);
if (filtered) {
danmaku.mFilterParam |= 128;
}
return filtered;
}
示例12: filterSecondary
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public boolean filterSecondary(BaseDanmaku danmaku, int lines, int totalsizeInScreen, DanmakuTimer timer, boolean willHit, DanmakuContext context) {
for (IDanmakuFilter<?> f : this.mFilterArraySecondary) {
if (f != null) {
boolean filtered = f.filter(danmaku, lines, totalsizeInScreen, timer, willHit, context);
danmaku.filterResetFlag = context.mGlobalFlagValues.FILTER_RESET_FLAG;
if (filtered) {
return true;
}
}
}
return false;
}
示例13: CacheManagingDrawTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public CacheManagingDrawTask(DanmakuTimer timer, DanmakuContext config, TaskListener taskListener, int maxCacheSize) {
super(timer, config, taskListener);
NativeBitmapFactory.loadLibs();
this.mMaxCacheSize = maxCacheSize;
if (NativeBitmapFactory.isInNativeAlloc()) {
this.mMaxCacheSize = maxCacheSize * 2;
}
this.mCacheManager = new CacheManager(maxCacheSize, 3);
this.mRenderer.setCacheManager(this.mCacheManager);
}
示例14: initListener
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
@Override
protected void initListener() {
mDanmakuView.setCallback(new DrawHandler.Callback() {
@Override
public void prepared() {
mDanmakuView.start();
}
@Override
public void updateTimer(DanmakuTimer timer) {
}
@Override
public void danmakuShown(BaseDanmaku danmaku) {
}
@Override
public void drawingFinished() {
}
});
mRetryGetDanmuBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mRoomPresenter.getChatListInfo(roomId);
}
});
}
示例15: DrawTask
import master.flame.danmaku.danmaku.model.DanmakuTimer; //导入依赖的package包/类
public DrawTask(DanmakuTimer timer, DanmakuContext context,
TaskListener taskListener) {
if (context == null) {
throw new IllegalArgumentException("context is null");
}
mContext = context;
mDisp = context.getDisplayer();
mTaskListener = taskListener;
mRenderer = new DanmakuRenderer(context);
mRenderer.setOnDanmakuShownListener(new IRenderer.OnDanmakuShownListener() {
@Override
public void onDanmakuShown(BaseDanmaku danmaku) {
if (mTaskListener != null) {
mTaskListener.onDanmakuShown(danmaku);
}
}
});
mRenderer.setVerifierEnabled(mContext.isPreventOverlappingEnabled() || mContext.isMaxLinesLimited());
initTimer(timer);
Boolean enable = mContext.isDuplicateMergingEnabled();
if (enable != null) {
if(enable) {
mContext.mDanmakuFilters.registerFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
} else {
mContext.mDanmakuFilters.unregisterFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
}
}
}