Ejemplo n.º 1
0
//---------------------------------------------------------------
void CloudsRGBDVideoPlayer::threadedFunction(){
	
	cout << "*** SETTING UP CLIP ENTERED THREAD" << endl;

    if(!nextPlayer->loadMovie(nextVideoPath)){
		ofLogError("CloudsRGBDVideoPlayer::setup") << "Movie path " << nextVideoPath << " failed to load";
        bLoadResult = false;
		clipPrerolled = false;
        return;
    }

	nextPlayer->setPosition( nextOffsetTime / nextPlayer->getDuration() );

	cout << "prerolled clip " << nextVideoPath << " to time " << nextOffsetTime << endl;

    /* Subtitles */
    nextClipHasSubtitles = loadSubtitles(nextSubtitlesPath);
    
	nextClipIsVO = false;
    nextClipVolumeAdjustment = nextClipVolume;
	
	cout << "*** SETTING UP CLIP FINISHED SETUP" << endl;

    bLoadResult = true;
}
Ejemplo n.º 2
0
bool CloudsRGBDVideoPlayer::setupVO(string audioPath, string subtitlesPath){
	
	cout << "*** SETTING UP VO " << audioPath << endl;
    
#ifndef VHX_MEDIA
   if(!ofFile::doesFileExist(audioPath)){
       ofLogError("CloudsRGBDVideoPlayer::setupVO") << "Audio path " << audioPath << " failed to load";
       //bLoadResult = false;
       clipPrerolled = false;
       return false;
   }
#endif
                   
    if(!nextPlayer->loadMovie(audioPath)){
		ofLogError("CloudsRGBDVideoPlayer::setupVO") << "Audio path " << audioPath << " failed to load";
		//bLoadResult = false;
		clipPrerolled = false;
		return false;
	}

   if(!bEventRegistered){
		ofAddListener(ofEvents().update, this, &CloudsRGBDVideoPlayer::update);
		bEventRegistered = true;
	}

	nextSubtitlesPath = subtitlesPath;
    nextClipHasSubtitles = loadSubtitles(nextSubtitlesPath);

	clipPrerolled = true;
	nextClipIsVO = true;
    bNextClipLoading = true;
	//bLoadResult = true;
    
	return true;
}
Ejemplo n.º 3
0
void Subtitles::setLine(int line) {
	if (_lines.empty())
		loadSubtitles();

	markTime();
	_lineNum = line;
	_lineSize = _lines[_lineNum].size();
	_lineEnd = 1;
	_displayLine.clear();
}
Ejemplo n.º 4
0
//---------------------------------------------------------------
bool CloudsRGBDVideoPlayer::setup(string videoPath, string calibrationXMLPath, string subtitlesPath, float offsetTime,float clipVolume){

	cout << "*** SETTING UP CLIP " << calibrationXMLPath << endl;
#ifndef VHX_MEDIA
    if (!ofFile::doesFileExist(videoPath)){
    	ofLogError("CloudsRGBDVideoPlayer::setup") << "Movie path " << videoPath << " failed to load";
        //bLoadResult = false;
        clipPrerolled = false;
        return false;
    }
#endif
    
	if(!ofFile::doesFileExist(calibrationXMLPath)){
    	ofLogError("CloudsRGBDVideoPlayer::setup") << "XML path " << calibrationXMLPath << " failed to load";
        //bLoadResult = false;
        clipPrerolled = false;
		return false;
	}

    if(!bEventRegistered){
		ofAddListener(ofEvents().update, this, &CloudsRGBDVideoPlayer::update);
		bEventRegistered = true;
	}
    
    nextVideoPath = videoPath;
    nextCalibrationXML = calibrationXMLPath;
    nextSubtitlesPath = subtitlesPath;
    nextOffsetTime = offsetTime;
    nextClipVolume = clipVolume;
    nextClipHasSubtitles = loadSubtitles(nextSubtitlesPath);

    if(!nextPlayer->loadMovie(nextVideoPath)){
        ofLogError("CloudsRGBDVideoPlayer::setup") << "Movie path " << nextVideoPath << " failed to load";
        //bLoadResult = false;
        clipPrerolled = false;
        return false;
    }
    
    
    //OLD PALCE
    //TODO may be causing problems with async videos
    //nextPlayer->setPosition( nextOffsetTime / nextPlayer->getDuration() );
    
    nextClipVolumeAdjustment = nextClipVolume;
    nextClipIsVO = false;
    clipPrerolled = true;
    bNextClipLoading = true;
    //bLoadResult = true;
    
    return true;
}