Example #1
0
	bool UserStreamPlayer::fileDrop( ci::app::FileDropEvent event ) {
		if(event.getNumFiles() != 1) return false;

		std::string fileRef = event.getFile(0);
		std::cout << fileRef << std::endl;
		setJson( fileRef );
		return true;
	}
void RibbonPaint::fileDrop( ci::app::FileDropEvent event )
{
    if(_state != kStateNormal) return;

    if(event.getNumFiles() != 1) return;

    std::string fileRef = event.getFile(0);

    ci::IStreamFileRef stream = ci::loadFileStream(fileRef);

    while (stream->isEof() == false)
    {
        std::string currentLine = stream->readLine();
        std::string::size_type locationIndex = currentLine.find( "Parameters Used: [", 0 );

        // Found a match lets set the parameters
        if( locationIndex != std::string::npos )
        {
            setBrushSettingsFromStringParameters(currentLine);
            return;
        }
    }
}