2015년 2월 4일 수요일

리스트에 관해서 : CCTableView

cocos2d-x 2.2.2 기준.

CCTableView는 실제 리스트 기능을 하는 CCScrollView와 스크롤 이벤트 인터페이스
와 CCScrollViewDelegate로 구성된다.

class CCTableView : public CCScrollView, public CCScrollViewDelegate


# 생성하기
CCTableView* CCTableView::create(CCTableViewDataSource* dataSource, CCSize size)
{
    return CCTableView::create(dataSource, size, NULL);
}
CCTableView* CCTableView::create(CCTableViewDataSource* dataSource, CCSize size, CCNode *container)
{
    CCTableView *table = new CCTableView();
    table->initWithViewSize(size, container);
    table->autorelease();
    table->setDataSource(dataSource);
    table->_updateCellPositions();
    table->_updateContentSize();
    return table;
}

뒷부분에 CCNode *container 를 추가하면, 별도의 레이어를 생성한 후에, addChild하도록 되어있음.

bool CCScrollView::initWithViewSize(CCSize size, CCNode *container/* = NULL*/)
{
    if (CCLayer::init())
    {
        m_pContainer = container;
       
        if (!this->m_pContainer)
        {
            m_pContainer = CCLayer::create();
            this->m_pContainer->ignoreAnchorPointForPosition(false);
            this->m_pContainer->setAnchorPoint(ccp(0.0f, 0.0f));
        }
        this->setViewSize(size);
        setTouchEnabled(true);
        m_pTouches = new CCArray();
        m_pDelegate = NULL;
        m_bBounceable = true;
        m_bClippingToBounds = true;
        //m_pContainer->setContentSize(CCSizeZero);
        m_eDirection  = kCCScrollViewDirectionBoth;
        m_pContainer->setPosition(ccp(0.0f, 0.0f));
        m_fTouchLength = 0.0f;
       
        this->addChild(m_pContainer);
        m_fMinScale = m_fMaxScale = 1.0f;
        m_mapScriptHandler.clear();
        return true;
    }
    return false;
}

동영상 스트리밍 관련 링크



오픈소스 기반의 동영상 스트리밍서버 구축
http://kldp.org/node/53236
초간단 스트리밍 서버구축

웹캠을 이용하여 스트리밍 서버 구축하기 (ffmpeg, ffserver)
리눅스 환경하에서 스트리밍 서버 구축하기

RED5 + FFMPEG + FFserver 스트리밍 서버 구축하기