Пример #1
0
///////////////////////////////////////////
// Decrement the packet playback speed
void EQPacket::decPlayback(void)
{
  if (m_vPacket)
  {
    int x = m_vPacket->playbackSpeed();
    switch(x)
      {
	// paused
      case -1:
	return;
	break;
	
	// slower than 1 is paused
      case 1:
	x = -1;
	break;
	
	// if we were full speed goto 9
      case 0:
	x = 9;
	break;
	
      default:
	x -= 1;
	break;
      }
    
    setPlayback(x);
  }
}
Пример #2
0
///////////////////////////////////////////
// Increment the packet playback speed
void EQPacket::incPlayback(void)
{
  int x;

  if (m_vPacket)
  {
    x = m_vPacket->playbackSpeed();
  }
  else
  {
    x = m_packetCapture->getPlaybackSpeed();
  }
    
  switch(x)
  {
	// if we were paused go to 1X not full speed
    case -1:
      x = 1;
      break;
	
    // can't go faster than full speed
    case 0:
      return;
	
    case 9:
      x = 0;
      break;
	
    default:
      x += 1;
      break;
  }
    
  setPlayback(x);
}
Пример #3
0
uint8_t PLR_StartNewFile(const char* filename, bool turn) {

	uint16_t data;
	if(turn == TRUE){
		turning = TRUE;
		turntime = (config_turnval*1000)/TASKDEL_MS; /*Turn in taskcycles*/
	}
	//Stop actual playback
	PLR_StopPlayback();

	VS_ReadRegister(VS_MODE, &data);
	data = (data | VS_MODE_SM_LINE1 | VS_MODE_SM_SDINEW);
	VS_WriteRegister(VS_MODE, data);

	/*resync*/
	VS_WriteRegister(VS_WRAMADDR, 0x1E29);
	VS_WriteRegister(VS_WRAM, 0);

	if (FAT1_open(&fp, filename, FA_READ) != FR_OK) {
		return ERR_FAILED;
	}

	/*As in datasheet explained set twice 0 in REG_DECODETIME to set back playback time*/
	VS_WriteRegister(VS_DECODE_TIME, 0x00);
	VS_WriteRegister(VS_DECODE_TIME, 0x00);

	setPlayback();

	while (!VS_Ready()) {
		//wait until DREQ high
	}

	return ERR_OK;

}
Пример #4
0
uint8_t PLR_PausePlayback(bool pause) {

	if (pause) {
		clearPlayback();
	} else {
		if (fp.obj.fs != 0) {
			setPlayback();
		}
	}

	return ERR_OK;
}
DatabaseSink::DatabaseSink(AbstractRoutingEngine *engine, map<std::string, std::string> config)
	:AbstractSource(engine,config),thread(NULL),shared(NULL),playback(false),playbackShared(NULL), playbackMultiplier(1)
{
	databaseName = "storage";
	tablename = "data";
	tablecreate = "CREATE TABLE IF NOT EXISTS data (key TEXT, value BLOB, source TEXT, time REAL, sequence REAL)";

	if(config.find("databaseFile") != config.end())
	{
		setDatabaseFileName(config["databaseFile"]);
	}

	if(config.find("bufferLength") != config.end())
	{
		bufferLength = atoi(config["bufferLength"].c_str());
	}

	if(config.find("properties") != config.end())
	{
		parseConfig();
	}

	for(auto itr=propertiesToSubscribeTo.begin();itr!=propertiesToSubscribeTo.end();itr++)
	{
		engine->subscribeToProperty(*itr,this);
	}

	mSupported.push_back(DatabaseFile);
	mSupported.push_back(DatabaseLogging);
	mSupported.push_back(DatabasePlayback);

	routingEngine->setSupported(supported(), this);

	if(config.find("startOnLoad")!= config.end())
	{
		setLogging(true);
	}

	if(config.find("playbackMultiplier")!= config.end())
	{
		playbackMultiplier = boost::lexical_cast<uint>(config["playbackMultiplier"]);
	}

	if(config.find("playbackOnLoad")!= config.end())
	{
		setPlayback(true);
	}


}
Пример #6
0
djvGlslTestPlaybackToolBar::djvGlslTestPlaybackToolBar(
    djvGlslTestPlayback * playback,
    djvGlslTestContext *  context,
    QWidget *             parent) :
    QToolBar(parent),
    _playback(playback),
    _buttons(0),
    _slider (0)
{
    QWidget * widget = new QWidget;
    widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    
    _buttons = new djvPlaybackButtons(context);
    
    _slider = new djvViewFrameSlider(context);
    
    QHBoxLayout * layout = new QHBoxLayout(widget);
    layout->setMargin(5);
    layout->setSpacing(5);
    layout->addWidget(_buttons);
    layout->addWidget(_slider);
    
    addWidget(widget);
    setMovable(false);
    setFloatable(false);
    
    _buttons->setPlayback(playback->playback());
    
    _slider->setFrameList(playback->sequence().frames);
    _slider->setSpeed(playback->sequence().speed);
    
    _slider->connect(
        _playback,
        SIGNAL(frameChanged(qint64)),
        SLOT(setFrame(qint64)));
    
    _playback->connect(
        _buttons,
        SIGNAL(playbackChanged(djvPlaybackUtil::PLAYBACK)),
        SLOT(setPlayback(djvPlaybackUtil::PLAYBACK)));
    
    _playback->connect(
        _slider,
        SIGNAL(frameChanged(qint64)),
        SLOT(setFrame(qint64)));
}
Пример #7
0
MStatus AbcImport::doIt(const MArgList & args)
{
    MStatus status;

    MArgParser argData(syntax(), args, &status);

    MString filename("");
    MString connectRootNodes("");
    MString filterString("");
    MString excludeFilterString("");

    MObject reparentObj = MObject::kNullObj;

    bool    swap = false;
    bool    createIfNotFound = false;
    bool    removeIfNoUpdate = false;

    bool    debugOn = false;

    if (argData.isFlagSet("help"))
    {
        MGlobal::displayInfo(usage);
        return status;
    }

    if (argData.isFlagSet("debug"))
        debugOn = true;

    if (argData.isFlagSet("reparent"))
    {
        MString parent("");
        MDagPath reparentDagPath;
        status = argData.getFlagArgument("reparent", 0, parent);
        if (status == MS::kSuccess
            && getDagPathByName(parent, reparentDagPath) == MS::kSuccess)
        {
            reparentObj = reparentDagPath.node();
        }
        else
        {
            MString theWarning = parent;
            theWarning += MString(" is not a valid DagPath");
            printWarning(theWarning);
        }
    }

    if (!argData.isFlagSet("connect") && argData.isFlagSet("mode"))
    {
        MString modeStr;
        argData.getFlagArgument("mode", 0, modeStr);
        if (modeStr == "replace")
            deleteCurrentSelection();
        else if (modeStr == "open")
        {
            MFileIO fileIo;
            fileIo.newFile(true);
        }
    }
    else if (argData.isFlagSet("connect"))
    {
        swap = true;
        argData.getFlagArgument("connect", 0, connectRootNodes);

        if (argData.isFlagSet("createIfNotFound"))
        {
            createIfNotFound = true;
        }

        if (argData.isFlagSet("removeIfNoUpdate"))
            removeIfNoUpdate = true;
    }

    if (argData.isFlagSet("filterObjects"))
    {
        argData.getFlagArgument("filterObjects", 0, filterString);
    }

    if (argData.isFlagSet("excludeFilterObjects"))
    {
        argData.getFlagArgument("excludeFilterObjects", 0, excludeFilterString);
    }

    // if the flag isn't specified we'll only do stuff marked with the Maya
    // meta data
    bool recreateColorSets = false;
    if (argData.isFlagSet("recreateAllColorSets"))
    {
        recreateColorSets = true;
    }

    status = argData.getCommandArgument(0, filename);
    MString abcNodeName;
    if (status == MS::kSuccess)
    {
        {
            MString fileRule, expandName;
            MString alembicFileRule = "alembicCache";
            MString alembicFilePath = "cache/alembic";

            MString queryFileRuleCmd;
            queryFileRuleCmd.format("workspace -q -fre \"^1s\"",
                alembicFileRule);
            MString queryFolderCmd;
            queryFolderCmd.format("workspace -en `workspace -q -fre \"^1s\"`",
                alembicFileRule);

            // query the file rule for alembic cache
            MGlobal::executeCommand(queryFileRuleCmd, fileRule);
            if (fileRule.length() > 0)
            {
                // we have alembic file rule, query the folder
                MGlobal::executeCommand(queryFolderCmd, expandName);
            }

            // resolve the expanded file rule
            if (expandName.length() == 0)
            {
                expandName = alembicFilePath;
            }

            // get the path to the alembic file rule
            MFileObject directory;
            directory.setRawFullName(expandName);
            MString directoryName = directory.resolvedFullName();

            // resolve the relative path
            MFileObject absoluteFile;
            absoluteFile.setRawFullName(filename);
			absoluteFile.setResolveMethod(MFileObject::kInputFile);
#if MAYA_API_VERSION < 201300
            if (absoluteFile.resolvedFullName() !=
                absoluteFile.expandedFullName())
            {
#else
            if (!MFileObject::isAbsolutePath(filename)) {
#endif
                // this is a relative path
                MString absoluteFileName = directoryName + "/" + filename;
                absoluteFile.setRawFullName(absoluteFileName);
                filename = absoluteFile.resolvedFullName();
            }
            else
            {
                filename = absoluteFile.resolvedFullName();
            }
        }

        MFileObject fileObj;
        status = fileObj.setRawFullName(filename);
        if (status == MS::kSuccess && fileObj.exists())
        {
            ArgData inputData(filename, debugOn, reparentObj,
                swap, connectRootNodes, createIfNotFound, removeIfNoUpdate,
                recreateColorSets, filterString, excludeFilterString);
            abcNodeName = createScene(inputData);

            if (inputData.mSequenceStartTime != inputData.mSequenceEndTime &&
                inputData.mSequenceStartTime != -DBL_MAX &&
                inputData.mSequenceEndTime != DBL_MAX)
            {
                if (argData.isFlagSet("fitTimeRange"))
                {
                    MTime sec(1.0, MTime::kSeconds);
                    setPlayback(
                        inputData.mSequenceStartTime * sec.as(MTime::uiUnit()),
                        inputData.mSequenceEndTime * sec.as(MTime::uiUnit()) );
                }

                if (argData.isFlagSet("setToStartFrame"))
                {
                    MTime sec(1.0, MTime::kSeconds);
                    MGlobal::viewFrame( inputData.mSequenceStartTime *
                        sec.as(MTime::uiUnit()) );
                }
            }
        }
        else
        {
            MString theError("In AbcImport::doIt(), ");
            theError += filename;
            theError += MString(" doesn't exist");
            printError(theError);
        }
    }

    MPxCommand::setResult(abcNodeName);

    return status;
}
Пример #8
0
void VideoControls::pause() {
    setPlayback(false);
}
Пример #9
0
void VideoControls::play() {
    setPlayback(true);
}
AsyncPropertyReply *DatabaseSink::setProperty(AsyncSetPropertyRequest request)
{
	AsyncPropertyReply* reply = new AsyncPropertyReply(request);
	reply->success = false;

	if(request.property == DatabaseLogging)
	{
		if(request.value->value<bool>())
		{
			setPlayback(false);
			startDb();
			reply->success = true;
			DatabaseLoggingType temp(true);
			routingEngine->updateProperty(DatabaseLogging,&temp,uuid());
		}
		else
		{
			stopDb();
			reply->success = true;
			DatabaseLoggingType temp(false);
			routingEngine->updateProperty(DatabaseLogging,&temp,uuid());
		}
	}

	else if(request.property == DatabaseFile)
	{
		std::string fname = request.value->toString();

		databaseName = fname;

		DatabaseFileType temp(databaseName);

		routingEngine->updateProperty(DatabaseFile,&temp,uuid());

		reply->success = true;
	}
	else if( request.property == DatabasePlayback)
	{
		if(request.value->value<bool>())
		{
			setLogging(false);
			startPlayback();

			DatabasePlaybackType temp(playback);

			routingEngine->updateProperty(DatabasePlayback,&temp,uuid());
		}
		else
		{
			if(playbackShared)
				playbackShared->stop = true;

			playback = false;

			DatabasePlaybackType temp(playback);

			routingEngine->updateProperty(DatabasePlayback, &temp, uuid());
		}

		reply->success = true;
	}

	return reply;
}