コード例 #1
0
ファイル: CListview.cpp プロジェクト: iamnilay3/openlierox
void CListview::AddWidgetSubitem(CWidget *wid)
{
	if (getLastItem())  {
		getLastItem()->AppendSubitem(wid);
		// HINT: the item calls repaint on us automatically
	}
}
コード例 #2
0
ファイル: CListview.cpp プロジェクト: iamnilay3/openlierox
void CListview::AddImageSubitem(SDL_Surface *image)
{
	if (getLastItem())  {
		getLastItem()->AppendSubitem(image);
		// HINT: the item calls repaint on us automatically
	}
}
コード例 #3
0
ファイル: CListview.cpp プロジェクト: iamnilay3/openlierox
void CListview::AddTextSubitem(const std::string& text)
{
	if (getLastItem())  {
		getLastItem()->AppendSubitem(text);
		// HINT: the item calls repaint on us automatically
	}	
}
コード例 #4
0
ファイル: CListview.cpp プロジェクト: iamnilay3/openlierox
/////////////////
// Add a subitem
void CListview::AddSubitem(CListviewSubitem& sub)
{
	if (getLastItem())  {
		getLastItem()->AppendSubitem(sub);
		// HINT: the item calls repaint on us automatically
	}
}
コード例 #5
0
ファイル: LRParsing.cpp プロジェクト: dalzzing2/Project
point_itemnode LRParsing::GoTo(point_itemnode IS, grammer sym_val){
	int r_num, d_num;
	grammer SymAfterDot;
	point_itemnode cursor, New_Item, Go_To_Result_List = NULL, temp_item = NULL;
	//point_itemnode i_cursor;

	cursor = IS;
	while(cursor){
		//curr노드의 rule번호
		r_num = cursor->RuleNum;
		d_num = cursor->DotNum;

		//dot이 맨 끝에 존재하는 아이템은 무시.
		if(d_num >= rule_v[r_num].rule_len){
			cursor = cursor->link;
			continue;
		}

		SymAfterDot = rule_v[r_num].right[d_num];

		//점 다음의 심볼과 goto할 심볼이 다르면 다음 아이템으로 넘어 감.
		if(!(SymAfterDot.select == sym_val.select && SymAfterDot.location == sym_val.location)){
			cursor = cursor->link;
			continue;
		}

		//도트를 한칸 우측으로 옮긴 아이템 생성
		New_Item = (point_itemnode) malloc(sizeof(typeitemnode));
		New_Item->DotNum = d_num+1;
		New_Item->RuleNum = r_num;
		New_Item->link = NULL;

		//New_Item가 이미 존재하면 다음 cursor로 스킵.
		if(CheckExistItem(Go_To_Result_List,New_Item)){
			free(New_Item);
			cursor = cursor->link;
			continue;
		}

		//NewItemNodePtr를 Go_To_Result_List의 맨 뒤에 붙인다.
		if(Go_To_Result_List == NULL){
			Go_To_Result_List = New_Item;
		}else{
			temp_item = getLastItem(Go_To_Result_List);
			temp_item->link = New_Item;
		}//if

		cursor = cursor->link;
	}//while : cursor

	if(Go_To_Result_List)
		return closure(Go_To_Result_List);
	else
		return NULL;
}//GoTo()
コード例 #6
0
ファイル: LRParsing.cpp プロジェクト: dalzzing2/Project
point_itemnode LRParsing::closure(point_itemnode IS){
	//지역변수 선언
	point_itemnode	new_cs, curr, cursor;
	grammer					SymAfterDot;
	int					r_num, d_num;
	int					i_0 = 0;
	//포인터 curr가 CS의 첫 노드를 가리키게 한다.
	curr = IS;

	//Core Routine
	while(curr){
		//curr 노드의 rule번호
		r_num = curr->RuleNum;
		d_num = curr->DotNum;

		//SynAfterDot : type.grammer {int select / int location}
		SymAfterDot = rule_v[r_num].right[d_num];

		//단말기호이면 무시하고 넘어간다.
		if(!SymAfterDot.select){
			curr = curr->link;
			continue;
		}//if:select == 0
		for(i_0 = 0; i_0<23; i_0++){
			//룰 i_0의 좌측 심볼이 SymAfterDot이
			//아니면 continue
			if(rule_v[i_0].left.location != SymAfterDot.location)
				continue;

			//item node 하나를 만든다.
			new_cs=(point_itemnode)malloc(sizeof(typeitemnode));

			//rule 번호 r; dot number = 0 을 여기에 넣는다.
			new_cs->RuleNum = i_0;
			new_cs->DotNum = 0;
			new_cs->link=NULL;

			//new_cs가 이미 존재하면 continue
			if(CheckExistItem(IS, new_cs)){
				free(new_cs);
				continue;
			}//if : CheckExistItem()

			//NewItemNodePtr를 CS의 맨 뒤에 붙인다.
			cursor = getLastItem(IS);
			cursor->link = new_cs;
		}//for : i_0
		curr = curr->link;
	}//while : curr


	return IS;
}//closure()
コード例 #7
0
ファイル: linkedList.c プロジェクト: Juiposa/schoolwork
MusicRec * getLastItem( MusicRec * theList )
{
	MusicRec * returnVal;

	if ( isEmpty( theList ) == true ) {
		return NULL;
	}

	if ( theList->next != NULL ) {
		returnVal = getLastItem( theList->next );
	} else if ( theList->next == NULL ) {
		return theList;
	}

	return returnVal;
}
コード例 #8
0
void Showplan::onMessage() {
    const char* routine = "Showplan::onMessage";
	L_INFO(LOG_DB,"Showplan received message");
	mLock.lock();
    if (conf->getParam("next_on_showplan") == ""
                        && getSize() > 0
                        && getLastItem().getHash() != mActive) {
        L_INFO(LOG_DB,"Processing track load event");
        if (!mIsItemActive) {
            mActive = getFirstItem().getHash();
        }
        else {
        	getItemByHash(mActive).setState(DpsShowItem::Finished);
            try {
        	   mActive = getNextItem(getItemByHash(mActive)).getHash();
            }
            catch (int e) {
                cout << "Caught exception - no next item." << endl;
            }
			// while we have a script selected...
//            while (activePoint->getType() == 1
//                    && activePoint != lstShowPlan->lastItem()) {
//                activePoint = (ShowPlanItem*)activePoint->nextSibling();
//            }
        }
        getItemByHash(mActive).setState(DpsShowItem::Loaded);
        mIsItemActive = true;
        //??
        lstShowPlan->ensureItemVisible(lstShowPlan->selectedItem());
        //if (lstShowPlan->selectedItem()) {
        //    selectionChanged(lstShowPlan->selectedItem());
        //}
		mLock.unlock();
        showplanUpdated();
    }
	else {
		mLock.unlock();
	}	
	L_INFO(LOG_DB,"Finished Showplan onMessage");
}
コード例 #9
0
void Showplan::updateNextTrack() {
    mLock.lock();
    if (getSize() == 0) {
		conf->setParam("next_on_showplan","");
		mLock.unlock();
		return;
	}

	DpsShowItem x;
    if ( ! mIsItemActive ) {
        x = getFirstItem();
    }
    else {
        try {
            x = getNextItem(getItemByHash(mActive));
        }
        catch (DpsShowPlan::Error&) {
            mLock.unlock();
            return;
        }
    }

	try {
        while (1) {
        	if ( x.hasAudio() ) {
            	conf->setParam("next_on_showplan", x.getAudioItem()["md5"]);
                break;
        	}
            if (x == getLastItem()) {
                break;
            }
            x = getNextItem(x);
        }
	}
	catch (DpsShowPlan::Error&) {
		
	}

    mLock.unlock();
}
コード例 #10
0
fsl_player_ret_val playlist_previous(fsl_player_handle handle, options* opt)
{
    fsl_player* pplayer = NULL;
    pplayer = (fsl_player*)handle;
    fsl_player_drm_format drm_format;
    PlayItem * current = opt->current;
    PlayItem * next = getPrevItem(current);

    if(next)
    {
        opt->current = next;
        printf("%s\n", opt->current->name);
        pplayer->klass->stop(pplayer);
        pplayer->klass->set_media_location(pplayer, opt->current->name, &drm_format);
        pplayer->klass->play(pplayer);
    }
    switch( opt->repeat )
    {
        case FSL_PLAYER_REPEAT_NONE:
        {
            if( next )
            {
                opt->current = next;
                printf("%s\n", opt->current->name);
                pplayer->klass->stop(pplayer);
                pplayer->klass->set_media_location(pplayer, opt->current->name, &drm_format);
                pplayer->klass->play(pplayer);
            }
            else
            {
                //gcore_register_callback(gcore, NULL, NULL,0);
                // if not repeated mode or no next item, exit.
                //printf("%s(): No more multimedia files, exit.\n", __FUNCTION__);
                //player_exit(pplayer);
            }
            break;
        }
        case FSL_PLAYER_REPEAT_PLAYLIST:
        {
            if( next )
            {
                opt->current = next;
                printf("%s\n", opt->current->name);
                pplayer->klass->stop(pplayer);
                pplayer->klass->set_media_location(pplayer, opt->current->name, &drm_format);
                pplayer->klass->play(pplayer);
            }
            else
            {
                next = getLastItem(opt->pl);
                opt->current = next;
                pplayer->klass->stop(pplayer);
                pplayer->klass->set_media_location(pplayer, opt->current->name, &drm_format);
                pplayer->klass->play(pplayer);
            }
            break;
        }
        case FSL_PLAYER_REPEAT_CURRENT:
        {
            pplayer->klass->stop(pplayer);
            //pplayer->klass->set_media_location(pplayer, opt->current->name, &drm_format);
            pplayer->klass->play(pplayer);
            break;
        }
        default:
        {
            break;
        }
    }
    return FSL_PLAYER_SUCCESS;
}