Esempio n. 1
0
void XDlgBarTimeline::Update()
{
	UpdateSlider();
	auto spAction = SPROBJ->GetspAction();
	if( spAction )
		m_comboPlayMode.SetCurSel( (int)spAction->GetPlayMode() );
}
Esempio n. 2
0
void XDlgBarTimeline::OnCbnSelchangeCombo1()
{
	// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
	auto spAction = SPROBJ->GetspAction();
	if( !spAction ) return;
	spAction->SetPlayMode( (xRPT_TYPE)m_comboPlayMode.GetCurSel() );
	SPROBJ->SetPlayType( spAction->GetPlayMode() );

}
Esempio n. 3
0
int CPlayCenter::MakePrevPlayIndex(unsigned int u_listIndex)
{
	size_t size_count = 0;
	auto it = m_spSongListMap.find(u_listIndex);
	if(it!=m_spSongListMap.end())
		size_count = it->second.size();
	if(size_count==0)
	{
		m_iCurPlayingSongIndex = -1;
		return -1;
	}
	songsArrayIterT iterFirst = it->second.begin();
	songsArrayIterT iterLast = it->second.begin()+(size_count-1);
	unsigned int iFirst = iterFirst->GetLocalId();
	unsigned int iLast = iterLast->GetLocalId();
	switch (GetPlayMode())
	{
	case EM_MODE::EM_LIST_ORDER:
		{
			m_iCurPlayingSongIndex --;
			if(m_iCurPlayingSongIndex<iFirst)
				m_iCurPlayingSongIndex = iFirst;
			return -1;
		}
		break;
	case EM_MODE::EM_LIST_LOOP:
		{
			m_iCurPlayingSongIndex --;
			if(m_iCurPlayingSongIndex<iFirst)
				m_iCurPlayingSongIndex = iFirst;
			return 0;
		}
		break;
	case EM_MODE::EM_SINGLE:
		{
			return -1;
		}
		break;
	case EM_MODE::EM_SINGLE_LOOP:
		return 0;
		break;
	case EM_MODE::EM_RAMDON:
		{

			srand((unsigned int)time(NULL));
			if(iLast-iFirst==0)
				m_iCurPlayingSongIndex = iFirst;
			else 
				m_iCurPlayingSongIndex = iFirst + rand()%(iLast-iFirst+1);
			return 0;
		}
		break;
	default:
		assert(FALSE);
		return -1;
	}
}
Esempio n. 4
0
void cSoftPlayer::OpenFile(const char *filename) {
        int ret;
	char StreamFilename[120];
	
	ic=0;
	if (!filename) {
                printf("Filname is NULL!!\n");
                ic=0;
                return;
        };
	
	if (IsStreamFile(filename)) {
		FILE *streamfile;
		printf("Found stream!\n");
		streamfile=fopen(filename,"r");
		if (!streamfile)
			return;
		fgets(StreamFilename,120,streamfile);
		chomp(StreamFilename);
		filename=StreamFilename;
		fclose(streamfile);
	};
		
        printf("open file '%s'\n",filename);
/* ---------------------------------------------------------------------------
 * As a workaround for softdevice behaviour of setting AVFMT_NOFILE flag
 * for input format "mpeg" we temporarily clear this here now and restore
 * flags later.
 * For this reason, this change does not fit indentation rules.
 */
AVInputFormat *fmt;
int           oldFlags;
fmt=av_find_input_format("mpeg");
oldFlags = fmt->flags;
fmt->flags &= ~AVFMT_NOFILE;
        char str[60];
        if ( (ret=av_open_input_file( &ic, filename, NULL, 0, NULL)) ) {
                snprintf(str,60,"%s %s!","Could not open file",filename);
                Skins.Message(mtError, str);
                printf("could not open file. Return value %d\n",ret);
                ic=0;
fmt->flags = oldFlags;
                return;
        };
fmt->flags = oldFlags;

        if ( av_find_stream_info( ic ) ) {
                printf("could not find stream info\n");
        };
        Streams=GetPlayMode( ic );

        if (ic) {
                strlcpy(title, ic->title, sizeof(title));
                strlcpy(author, ic->author, sizeof(author));
                strlcpy(album, ic->album, sizeof(album));
                strlcpy(curr_filename, ic->filename, sizeof(curr_filename));
                                
                stripTrailingNonLetters(title);
                stripTrailingNonLetters(author);
                stripTrailingNonLetters(album);
                stripTrailingNonLetters(curr_filename);
                duration=ic->duration;
                start_time=ic->start_time;
        };
};