当前位置: 首页>>代码示例>>Java>>正文


Java DanmakuTimer类代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:DanmakuFilters.java

示例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;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:21,代码来源:DrawHandler.java

示例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;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:20,代码来源:DanmakuFilters.java

示例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);
        }
    }
}
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:21,代码来源:DrawTask.java

示例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);
  }
}
 
开发者ID:pkliang,项目名称:gankmaku,代码行数:19,代码来源:BaseDanmakuFragment.java

示例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;
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:18,代码来源:DrawHandler.java

示例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;
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:23,代码来源:DrawTask.java

示例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;
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:24,代码来源:DanmakuFilters.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:DrawHandler.java

示例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);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:33,代码来源:DrawTask.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:DanmakuFilters.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:DanmakuFilters.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:CacheManagingDrawTask.java

示例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);
        }
    });
}
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:32,代码来源:LiveRoomActivity.java

示例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);
        }
    }
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:30,代码来源:DrawTask.java


注:本文中的master.flame.danmaku.danmaku.model.DanmakuTimer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。