示例#1
0
void BakaEngine::BakaOnlineHelp(QStringList &args)
{
    if(args.empty())
        QDesktopServices::openUrl(QUrl(tr("http://bakamplayer.u8sand.net/help.php")));
    else
        InvalidParameter(args.join(' '));
}
示例#2
0
void BakaEngine::BakaOpenLocation(QStringList &args)
{
    if(args.empty())
        OpenLocation();
    else
        InvalidParameter(args.join(' '));
}
示例#3
0
void BakaEngine::BakaOutput(QStringList &args)
{
    if(args.empty())
        window->setDebug(!window->getDebug());
    else
        InvalidParameter(args.join(' '));
}
示例#4
0
void BakaEngine::BakaFullScreen(QStringList &args)
{
    if(args.empty())
        window->FullScreen(!window->isFullScreen());
    else
        InvalidParameter(args.join(' '));
}
示例#5
0
void BakaEngine::BakaStop(QStringList &args)
{
    if(args.empty())
        mpv->Stop();
    else
        InvalidParameter(args.join(' '));
}
示例#6
0
void BakaEngine::BakaQuit(QStringList &args)
{
    if(args.empty())
        Quit();
    else
        InvalidParameter(args.join(' '));
}
示例#7
0
void BakaEngine::BakaMediaInfo(QStringList &args)
{
    if(args.empty())
        MediaInfo(window->ui->actionMedia_Info->isChecked());
    else
        InvalidParameter(args.join(' '));
}
示例#8
0
void BakaEngine::BakaOpenClipboard(QStringList &args)
{
    if(args.empty())
        mpv->LoadFile(QApplication::clipboard()->text());
    else
        InvalidParameter(args.join(' '));
}
示例#9
0
void BakaEngine::BakaShowInFolder(QStringList &args)
{
    if(args.empty())
        Util::ShowInFolder(mpv->getPath(), mpv->getFile());
    else
        InvalidParameter(args.join(' '));
}
示例#10
0
void BakaEngine::BakaPlayPause(QStringList &args)
{
    if(args.empty())
        PlayPause();
    else
        InvalidParameter(args.join(' '));
}
示例#11
0
void BakaEngine::BakaPreferences(QStringList &args)
{
    if(args.empty())
        PreferencesDialog::showPreferences(this, window);
    else
        InvalidParameter(args.join(' '));
}
示例#12
0
void BakaEngine::BakaNew(QStringList &args)
{
    if(args.empty())
        QProcess::startDetached(QApplication::applicationFilePath(), {});
    else
        InvalidParameter(args.join(' '));
}
示例#13
0
void BakaEngine::BakaMute(QStringList &args)
{
    if(args.empty())
        mpv->Mute(!mpv->getMute());
    else
        InvalidParameter(args.join(' '));
}
示例#14
0
void IntGeneratorOp::init(libconfig::Config& root, libconfig::Setting& node)
{
	ZeroInputOp::init(root, node);

	// Read parameters, make sure they make sense.
	//
	int tuples, width;

	tuples = node["sizeinmb"];
	width = node["width"];

	tuplewidth = width;
	totaltuples = tuples * 1024ull* 1024ull / tuplewidth;

	if (tuplewidth < sizeof(CtInt))
		throw InvalidParameter();

	// Populate schema.
	//
	schema.add(CT_INTEGER);
	schema.add(CT_CHAR, tuplewidth - sizeof(CtInt));
	assert(schema.getTupleSize() == tuplewidth);

	// Populate private data structures.
	//
	for (int i=0; i<MAX_THREADS; ++i) 
	{
		scratchspace.push_back(NULL);
		output.push_back(NULL);
		producedsofar.push_back(0);
	}
}
示例#15
0
void BakaEngine::BakaDeinterlace(QStringList &args)
{
    if(args.empty())
        mpv->Deinterlace(window->ui->action_Deinterlace->isChecked());
    else
        InvalidParameter(args.join(' '));
}
示例#16
0
void BakaEngine::BakaInterpolate(QStringList &args)
{
    if(args.empty())
        mpv->Interpolate(window->ui->action_Motion_Interpolation->isChecked());
    else
        InvalidParameter(args.join(' '));
}
示例#17
0
void BakaEngine::About(QString what)
{
    if(what == QString())
        AboutDialog::about(BAKA_MPLAYER_VERSION, window);
    else if(what == "qt")
        qApp->aboutQt();
    else
        InvalidParameter(what);
}
示例#18
0
文件: ObsID.cpp 项目: JC5005/GPSTk
   // This is used to register a new ObsID & Rinex 3 identifier.  The syntax for the
   // Rinex 3 identifier is the same as for the ObsID constructor. 
   // If there are spaces in the provided identifier, they are ignored
   ObsID ObsID::newID(const std::string& strID, const std::string& desc)
      throw(InvalidParameter)
   {
      if (char2ot.count(strID[0]) && 
          char2cb.count(strID[1]) && 
          char2tc.count(strID[2]))
          GPSTK_THROW(InvalidParameter("Identifier " + strID + " already defined."));

      return idCreator(strID, desc);
   }
示例#19
0
void BakaEngine::BakaHelp(QStringList &args)
{
    if(args.empty())
    {
        Print(tr("usage: baka <command> [...]"));
        Print(tr("commands:"));
        int len, max_len = 22;
        for(auto command = BakaCommandMap.begin(); command != BakaCommandMap.end(); ++command)
        {
            QString str = QString("  %0 %1").arg(command.key(), command->second[0]);
            len = str.length();
            while(len++ <= max_len)
                str += ' ';
            str += command->second[1];
            Print(str);
        }
    }
    else
    {
        QString arg = args.front();
        args.pop_front();
        if(args.empty())
        {
            auto command = BakaCommandMap.find(arg);
            if(command != BakaCommandMap.end()) //found
            {
                Print(tr("usage: %0 %1").arg(arg, command->second[0]));
                Print(tr("description:"));
                Print(QString("  %0").arg(command->second[1]));
                if(command->second.length() > 2 && command->second[2] != QString())
                {
                    Print(tr("advanced:"));
                    Print(QString("  %0").arg(command->second[2]));
                }
            }
            else
                InvalidParameter(arg);
        }
        else
            InvalidParameter(args.join(' '));
    }
}
示例#20
0
void BakaEngine::BakaDim(QStringList &args)
{
    if(dimDialog == nullptr)
    {
        Print(tr("DimDialog not supported on this platform"));
        return;
    }
    if(args.empty())
        Dim(!dimDialog->isVisible());
    else
        InvalidParameter(args.join(' '));
}
示例#21
0
void BakaEngine::BakaScreenshot(QStringList &args)
{
    if(args.empty())
        Screenshot(false);
    else
    {
        QString arg = args.front();
        args.pop_front();
        if(args.empty() && arg == "subtitles")
            Screenshot(true);
        else
            InvalidParameter(arg);
    }
}
示例#22
0
void BakaEngine::BakaFitWindow(QStringList &args)
{
    if(args.empty())
        FitWindow();
    else
    {
        QString arg = args.front();
        args.pop_front();
        if(args.empty())
            FitWindow(arg.toInt());
        else
            InvalidParameter(args.join(' '));
    }
}
示例#23
0
void BakaEngine::BakaDebug(QStringList &args)
{
    if(!args.empty())
    {
        QString arg = args.front();
        args.pop_front();
        if(args.empty())
            mpv->Debug(arg);
        else
            InvalidParameter(args.join(' '));
    }
    else
        RequiresParameters("debug");
}
SimpleSensorNoiseDataPointsFilter<T>::SimpleSensorNoiseDataPointsFilter(const Parameters& params):
	PointMatcher<T>::DataPointsFilter("SimpleSensorNoiseDataPointsFilter", 
		SimpleSensorNoiseDataPointsFilter::availableParameters(), params),
	sensorType(Parametrizable::get<unsigned>("sensorType")),
	gain(Parametrizable::get<T>("gain"))
{
  std::vector<std::string> sensorNames = boost::assign::list_of ("Sick LMS-1xx")("Hokuyo URG-04LX")("Hokuyo UTM-30LX")("Kinect / Xtion")("Sick Tim3xx");
	if (sensorType >= sensorNames.size())
	{
		throw InvalidParameter(
			(boost::format("SimpleSensorNoiseDataPointsFilter: Error, sensorType id %1% does not exist.") % sensorType).str());
	}

	LOG_INFO_STREAM("SimpleSensorNoiseDataPointsFilter - using sensor noise model: " << sensorNames[sensorType]);
}
示例#25
0
void BakaEngine::BakaBoss(QStringList &args)
{
    if(args.empty())
    {
        if(window->isFullScreen()) // exit fullscreen if in fullscreen
            window->FullScreen(false);
        else
        {
            mpv->Pause();
            window->setWindowState(window->windowState() | Qt::WindowMinimized); // minimize window
        }
    }
    else
        InvalidParameter(args.join(' '));
}
示例#26
0
void BakaEngine::BakaUpdate(QStringList &args)
{
    if(args.empty())
        UpdateDialog::CheckForUpdates(this, window);
    else
    {
#if defined(Q_OS_WIN)
        QString arg = args.front();
        args.pop_front();
        if(arg == "youtube-dl")
            QProcess::startDetached("youtube-dl.exe", {"--update"});
        else
#endif
            InvalidParameter(args.join(' '));
    }
}
示例#27
0
/* Module specific commands */
void ModChella::sumbitJob(int paramc, const std::vector<std::string>& params) {
	std::string data;
	if (paramc < 1)
		throw TooFewParameters(1);

	if (params[0].empty())
		throw InvalidParameter("jobname empty");

	if (paramc == 2)
		data = params[1];

	srand (time(NULL));
	zmq::context_t context(1);
	zmq::socket_t socket(context, ZMQ_REQ);

	socket.connect("tcp://localhost:5566");
	std::cout << "Connect to Chella master... " << std::endl;

	std::ifstream fjob(params[0]);
	std::string jobobject;

	fjob.seekg(0, std::ios::end);
	jobobject.reserve(fjob.tellg());
	fjob.seekg(0, std::ios::beg);

	jobobject.assign((std::istreambuf_iterator<char>(fjob)), std::istreambuf_iterator<char>());

	ProcessJob job;
	job.set_name(params[0]);
	job.set_id(rand() % 1000 + 1);
	job.set_quid(quidpp::Quid().toString(true));
	job.set_state(ProcessJob::SPAWN);
	job.set_content(jobobject);
	job.set_data(data);

	std::string serialized;
	job.SerializeToString(&serialized);

	zmq::message_t request(serialized.size());
	memcpy(reinterpret_cast<void *>(request.data()), serialized.c_str(), serialized.size());
	socket.send(request);

	/* Get the reply */
	zmq::message_t reply;
	socket.recv(&reply);
	std::cout << "Job submitted" << std::endl;
}
示例#28
0
void BakaEngine::BakaVolume(QStringList &args)
{
    if(!args.empty())
    {
        QString arg = args.front();
        args.pop_front();
        if(args.empty())
        {
            if(arg.startsWith('+') || arg.startsWith('-'))
                mpv->Volume(mpv->getVolume()+arg.toInt(), true);
            else
                mpv->Volume(arg.toInt(), true);
        }
        else
            InvalidParameter(args.join(' '));
    }
    else
        RequiresParameters("volume");
}
示例#29
0
 void Database::import ( const char * folder, const char * file )
 {
     const ::UINT result = ::MsiDatabaseImport(handle(),folder,file);
     if ( result != ERROR_SUCCESS )
     {
         if ( result == ERROR_BAD_PATHNAME ) {
             throw (BadPathName());
         }
         else if ( result == ERROR_FUNCTION_FAILED ) {
             throw (FunctionFailed());
         }
         else if ( result == ERROR_INVALID_HANDLE ) {
             throw (InvalidHandle());
         }
         else if ( result == ERROR_INVALID_PARAMETER ) {
             throw (InvalidParameter());
         }
         UNCHECKED_INSTALLER_ERROR(MsiDatabaseImport,result);
     }
 }
示例#30
0
void BakaEngine::BakaSpeed(QStringList &args)
{
    if(!args.empty())
    {
        QString arg = args.front();
        args.pop_front();
        if(args.empty())
        {
            if(arg.startsWith('+') || arg.startsWith('-'))
                mpv->Speed(mpv->getSpeed()+arg.toDouble());
            else
                mpv->Speed(arg.toDouble());
            mpv->ShowText(tr("Speed: %0x").arg(QString::number(mpv->getSpeed(), 'f', 2)));
        }
        else
            InvalidParameter(args.join(' '));
    }
    else
        RequiresParameters("speed");
}