Example #1
0
    GalleryConfigurationGroup() :
        TriggeredConfigurationGroup(false, true, false, false)
    {
        setLabel(QObject::tr("MythGallery Settings (Slideshow)"));
        setUseLabel(false);

#ifdef USING_OPENGL
        HostCheckBox* useOpenGL = SlideshowUseOpenGL();
        addChild(useOpenGL);
        setTrigger(useOpenGL);

        ConfigurationGroup* openGLConfig = new VerticalConfigurationGroup(false);
        openGLConfig->addChild(SlideshowOpenGLTransition());
        openGLConfig->addChild(SlideshowOpenGLTransitionLength());
        addTarget("1", openGLConfig);
#endif

        ConfigurationGroup* regularConfig = new VerticalConfigurationGroup(false);
        regularConfig->addChild(MythGalleryOverlayCaption());
        regularConfig->addChild(SlideshowTransition());
        regularConfig->addChild(SlideshowBackground());
        addTarget("0", regularConfig);

        addChild(SlideshowDelay());
        addChild(SlideshowRecursive());
    }
Example #2
0
AudioMixerSettings::AudioMixerSettings() :
    TriggeredConfigurationGroup(false, true, false, false)
{
    setLabel(QObject::tr("Audio Mixer"));
    setUseLabel(false);

    Setting *volumeControl = MythControlsVolume();
    addChild(volumeControl);

    // Mixer settings
    ConfigurationGroup *settings =
        new VerticalConfigurationGroup(false, true, false, false);
    settings->addChild(MixerDevice());
    settings->addChild(MixerControl());
    settings->addChild(MixerVolume());
    settings->addChild(PCMVolume());

    ConfigurationGroup *dummy =
        new VerticalConfigurationGroup(false, true, false, false);

    // Show Mixer config only if internal volume controls enabled
    setTrigger(volumeControl);
    addTarget("0", dummy);
    addTarget("1", settings);
}
Example #3
0
    TriggeredItem(Setting *checkbox, Setting *setting) :
        TriggeredConfigurationGroup(false, false, false, false)
    {
        setTrigger(checkbox);

        addTarget("1", setting);
        addTarget("0", new VerticalConfigurationGroup(false, false));
    }
Example #4
0
    LocalHostNameSettings(Setting *checkbox, ConfigurationGroup *group) :
        TriggeredConfigurationGroup(false, false, false, false)
    {
        setLabel(QObject::tr("Use custom identifier for frontend preferences"));
        addChild(checkbox);
        setTrigger(checkbox);

        addTarget("1", group);
        addTarget("0", new VerticalConfigurationGroup(true));
    }
Example #5
0
WOLsqlSettings::WOLsqlSettings(Setting *checkbox, ConfigurationGroup *group) :
    TriggeredConfigurationGroup(false, false, false, false)
{
        setLabel(DatabaseSettings::tr("Backend Server Wakeup settings"));

        addChild(checkbox);
        setTrigger(checkbox);

        addTarget("1", group);
        addTarget("0", new VerticalConfigurationGroup(true));
};
Example #6
0
int main(int ac, char *av[])
{
	char rpath[MAX_NAME_LEN];
	int status, *jstatus;
	simplequeue_t *outputQ, *workQ, *qtoa;
	pthread_t IGMP_broadcast_thread;

	// create separate thread for broadcasting IGMP group query messages
	pthread_create(&IGMP_broadcast_thread, NULL, IGMPBroadcast, NULL);

	// setup the program properties
	setupProgram(ac, av);
	// creates a PID file under router_name.pid in the current directory
	status = makePIDFile(rconfig.router_name, rpath);
	// shutdown the router on receiving SIGUSR1 or SIGUSR2
	redefineSignalHandler(SIGUSR1, shutdownRouter);
	redefineSignalHandler(SIGUSR2, shutdownRouter);

	outputQ = createSimpleQueue("outputQueue", INFINITE_Q_SIZE, 0, 1);
	workQ = createSimpleQueue("work Queue", INFINITE_Q_SIZE, 0, 1);

	GNETInit(&(rconfig.ghandler), rconfig.config_dir, rconfig.router_name, outputQ);
	ARPInit();
	IPInit();

	classifier = createClassifier();
	filter = createFilter(classifier, 0);

	pcore = createPacketCore(rconfig.router_name, outputQ, workQ);

	// add a default Queue.. the createClassifier has already added a rule with "default" tag
	// char *qname, char *dqisc, double qweight, double delay_us, int nslots);
	addPktCoreQueue(pcore, "default", "taildrop", 1.0, 2.0, 0);
	rconfig.scheduler = PktCoreSchedulerInit(pcore);
	rconfig.worker = PktCoreWorkerInit(pcore);

	infoInit(rconfig.config_dir, rconfig.router_name);
	addTarget("Output Queue", outputQ);
	qtoa = getCoreQueue(pcore, "default");
	if (qtoa != NULL)
		addTarget("Default Queue", qtoa);
	else
		printf("Error .. found null queue for default\n");

	// start the CLI..
	CLIInit(&(rconfig));

	wait4thread(rconfig.scheduler);
	wait4thread(rconfig.worker);
	wait4thread(rconfig.ghandler);
	wait4thread(IGMP_broadcast_thread);
}
Example #7
0
void MainWindow::update_target_list()
{

	//Remove all the rows in the table
	int row = ui->target_table->rowCount();
	for (int i=row; i>=0; i--)
	{
		ui->target_table->removeRow(i);
	}

	//Add the updated targets
	QList<Target*> tracker_targets = tracker->get_targets();

	int imobile_target_count = 0;
	int non_transient_trace_count = 0;
	for (QList<Target*>::iterator iter = tracker_targets.begin(); iter != tracker_targets.end(); iter++)
	{
		if((*iter)->is_mobile()) addTarget(*iter);
		else
		{
			imobile_target_count++;
			non_transient_trace_count += (*iter)->get_number_of_traces();
		}
	}

	targets = tracker_targets;

	cout << "imobile_target_count = " << imobile_target_count << endl;
	cout << "non_transient_trace_count = " << non_transient_trace_count << endl;


}
Example #8
0
void linkLayer::loadFromDoc(PoDoFo::PdfMemDocument* doc) {
  qDebug() << "linkLayer: Loading named destinations ...";
  try {
    PoDoFo::PdfNamesTree* pNames = doc->GetNamesTree( PoDoFo::ePdfDontCreateObject );
    if( ! pNames ) return;
    PoDoFo::PdfDictionary destsDict;
    pNames->ToDictionary( PoDoFo::PdfName("Dests"), destsDict );
    PoDoFo::TKeyMap keyMap = destsDict.GetKeys();
    QString tName;
    PoDoFo::PdfDestination *dest;
    PoDoFo::PdfObject *obj;
    for(PoDoFo::TKeyMap::const_iterator it = keyMap.begin(); it != keyMap.end(); ++it ) {
      try {
	tName = QString::fromUtf8( it->first.GetName().c_str() );
	qDebug() << "Processing "<< tName;
        obj = pdfUtil::resolveRefs( doc, it->second );
	if ( obj->IsArray() ) dest = new PoDoFo::PdfDestination( obj );
	else if ( obj->IsDictionary() ) {
	  obj->GetDictionary().GetKey("D")->SetOwner( &doc->GetObjects() );
	  dest = new PoDoFo::PdfDestination( obj->GetDictionary().GetKey("D") );
	}
	else {
	  qDebug() << "Element is neither an array, nor a dictionary:"<< obj->GetDataTypeString();
	  continue;
	}
	addTarget( tName, dest );
      } catch ( PoDoFo::PdfError e ) {
	qDebug() << "linkLayer: Error adding named destination ("<<tName<<"):"<<e.what();
      }
    }
  } catch ( PoDoFo::PdfError  e ) {
    qDebug() << "linkLayer: Error processing names tree:" << e.what();
  };
  qDebug() << "linkLayer: Done loading named destinations.";
}
Example #9
0
void menuSelect()
{
	setvbuf(stdout, NULL, _IONBF, 0);
	
	while (1) {
		printf("> ");
		
		char command[32];
		fgets(command, 32*sizeof(char), stdin);
		command[strcspn(command, "\n")] = 0;
		
		if (command[0] == 'q') {
			printf("Goodbye.\n");
			break;
		} else if (command[0] == '?') {
			printf("Commands:\n");
			printf("\t?: Print this command list\n");
			printf("\tq: Quit\n");
			printf("\tBackground: Add another background picture\n");
			printf("\tTarget: Add another target image\n");
			printf("\tGenerate: Create a puzzle\n");
		} else if (strcmp(command, "Background") == 0) {
			addBackground();
		} else if (strcmp(command, "Target") == 0) {
			addTarget();
		} else if (strcmp(command, "Generate") == 0) {
			generatePuzzle();
		}
		
	}
}
Example #10
0
/*
================
idCameraDef::getActiveTarget
================
*/
idCameraPosition *idCameraDef::getActiveTarget(int index) {
	if (targetPositions.Num() == 0) {
		addTarget(NULL, idCameraPosition::FIXED);
		return targetPositions[0];
	}
	return targetPositions[index];
}
Example #11
0
void SCNetworkEventPublisher::addHostname(
    const SCNetworkSubscriptionContextRef& sc) {
  auto target =
      SCNetworkReachabilityCreateWithName(nullptr, sc->target.c_str());
  target_names_.push_back(sc->target);
  addTarget(sc, target);
}
Example #12
0
void CClient::addTargetVerb( LPCTSTR pszCmd, LPCTSTR pszArg )
{
	ADDTOCALLSTACK("CClient::addTargetVerb");
	// Target a verb at some object .

	ASSERT(pszCmd);
	GETNONWHITESPACE(pszCmd);
	SKIP_SEPARATORS(pszCmd);

	if ( !strlen(pszCmd) )
		pszCmd = pszArg;

	if ( pszCmd == pszArg )
	{
		GETNONWHITESPACE(pszCmd);
		SKIP_SEPARATORS(pszCmd);
		pszArg = "";
	}

	// priv here
	PLEVEL_TYPE ilevel = g_Cfg.GetPrivCommandLevel( pszCmd );
	if ( ilevel > GetPrivLevel() )
		return;

	m_Targ_Text.Format( "%s%s%s", pszCmd, ( pszArg[0] && pszCmd[0] ) ? " " : "", pszArg );
	TCHAR * pszMsg = Str_GetTemp();
	sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_TARGET_COMMAND), static_cast<LPCTSTR>(m_Targ_Text));
	addTarget(CLIMODE_TARG_OBJ_SET, pszMsg);
}
bool AbstractLogDispatcher::Impl::addTarget( TargetPtrUq target )
{
    bool result = addTarget( target.get() );
    if( result ) {
        auto id = target->uniqueId().toStdString();
        m_ownedTargets.insert( std::make_pair( id, std::move( target )));
    }
    return result;
}
Example #14
0
void
Pointer::setZero(const llvm::Value *place)
{
    llvm::DeleteContainerSeconds(mTargets);
    addTarget(Target::Constant,
              place,
              NULL,
              std::vector<Domain*>(),
              NULL);
}
Example #15
0
CRenderTarget::CRenderTarget(const string& format, uint width, uint height, uint texUnit, uint attachment)
{
	glGenFramebuffersEXT( 1, &m_uiFrameBuffer );
	m_bDepthRenderBuffer = m_bDepthTexture = false;
	m_uiWidth = width;
	m_uiHeight=height;
	addTarget(format, texUnit, attachment);
	if (format.find("depthbuffer") != string::npos)
		addDepthRenderBuffer();
}
Example #16
0
void CClient::addTargetFunction( LPCTSTR pszFunction, bool fAllowGround, bool fCheckCrime )
{
	ADDTOCALLSTACK("CClient::addTargetFunction");
	// Target a verb at some object .
	ASSERT(pszFunction);
	GETNONWHITESPACE(pszFunction);
	SKIP_SEPARATORS(pszFunction);

	m_Targ_Text = pszFunction;
	addTarget( CLIMODE_TARG_OBJ_FUNC, "", fAllowGround, fCheckCrime );
}
Example #17
0
bool Events::waitForPress(uint expiry) {
	uint32 delayEnd = g_system->getMillis() + expiry;
	CPressTarget pressTarget;
	addTarget(&pressTarget);

	while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd && !pressTarget._pressed) {
		pollEventsAndWait();
	}

	removeTarget();
	return pressTarget._pressed;
}
Example #18
0
void Monster::onCreatureFound(Creature* creature, bool pushFront/* = false*/)
{
	if (isFriend(creature)) {
		addFriend(creature);
	}

	if (isOpponent(creature)) {
		addTarget(creature, pushFront);
	}

	updateIdleStatus();
}
Example #19
0
     MythFillSettings() :
         TriggeredConfigurationGroup(false, true, false, false)
     {
         setLabel(QObject::tr("Program Schedule Downloading Options"));
         setUseLabel(false);

         Setting* fillEnabled = MythFillEnabled();
         addChild(fillEnabled);
         setTrigger(fillEnabled);

         ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
         settings->addChild(MythFillDatabasePath());
         settings->addChild(MythFillDatabaseArgs());
         settings->addChild(MythFillMinHour());
         settings->addChild(MythFillMaxHour());
         settings->addChild(MythFillGrabberSuggestsTime());
         addTarget("1", settings);

         // show nothing if fillEnabled is off
         addTarget("0", new VerticalConfigurationGroup(true));
     };
Example #20
0
void EventOut::connect( LinkData* linkData, Module* target, PortAdapterType adapter )
{
	VERIFY( target );

	EventTarget data;
	data.target_  = target;
	data.inputId_ = linkData->inputId_;

    addTarget( linkData, adapter );

    resize( numTargets_ );
	at( numTargets_-1 ) = data;
}
Example #21
0
int TargetsList::toggleTarget(Targetable * target)
{
    if (alreadyHasTarget(target))
    {

        return removeTarget(target);
    }
    else
    {

        return addTarget(target);
    }
}
Example #22
0
void AudioOut::connect( LinkData* linkData, Module* target, PortAdapterType adapter )
{
    VERIFY( target );
    addTarget( linkData, adapter );

	ptrAudio_                  = bufAudio_.resize( numTargets_ );
    FLOAT* ptrTarget           = target->connect( linkData->inputId_ );
	ptrAudio_[ numTargets_-1 ] = ptrTarget;

 //   FLOAT* ptrTarget   = target->connect( linkData->inputId_ );
 //   UINT16 idx         = addTarget( linkData );
	//ptrAudio_          = bufAudio_.resize( idx );
	//ptrAudio_[ idx-1 ] = ptrTarget;
}
Example #23
0
void CliHandler::operator()(const int sockfd) {
  for (;;) {
    std::string line = fetchMessageString(sockfd);
    auto cmd = detachToken(line);
    makeLowerCase(cmd);
    if (cmd == "at")
      addTarget(line);
    else if (cmd == "ao")
      addObstacle(line);
    else if (cmd == "clear")
      clear(line);
    else if (cmd == "eot")
      return;
  }
}
Example #24
0
void StartScene::gameLogic(float dt)
{

    DataModel *m = DataModel::getModel();
    Wave *wave = this->getCurrentWave();
    if(wave!=nullptr) {
        double lastTimeTargetAdded = wave->lastTimeTargetAdded;
        double now = wave->time;
        if (lastTimeTargetAdded == 0 || now - lastTimeTargetAdded >= wave->spawnRate)
        {
            addTarget();
            wave->lastTimeTargetAdded = now;
//          wave->time += dt;
        }
    }
}
Example #25
0
/*!
    Adjusts general to \a general.
 */
void QMofGeneralization::setGeneral(QMofClassifier *general)
{
    // This is a read-write association end

    if (_general != general) {
        // Adjust subsetted properties
        removeTarget(_general);

        _general = general;
        if (general && general->asQModelingObject() && this->asQModelingObject())
            QObject::connect(general->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setGeneral()));

        // Adjust subsetted properties
        if (general) {
            addTarget(general);
        }
    }
}
Example #26
0
static void menu_select_loop() {
    for(;;) {
        printf("=>");
        char command[128];
        getstr(command,128);
        if(command[0]=='q') break;
        if(command[0]=='?') {
            printf("Commands:\n");
            printf("\t? : print this command list\n");
            printf("\tq : quit\n");
            printf("\tBackground: add another backgroud picture\n");
            printf("\tTarget: add another target image\n");
            printf("\tGenerate: create a puzzle\n");
        }
        if(0==strcmp(command, "Background")) addBackgroud();
        else if(0==strcmp(command, "Target")) addTarget();
        else if(0==strcmp(command, "Generate")) generatePuzzle();
    }
}
Example #27
0
void SCNetworkEventPublisher::addAddress(
    const SCNetworkSubscriptionContextRef& sc) {
  struct sockaddr* addr;
  if (sc->family == AF_INET) {
    struct sockaddr_in ipv4_addr;
    ipv4_addr.sin_family = AF_INET;
    inet_pton(AF_INET, sc->target.c_str(), &ipv4_addr.sin_addr);
    addr = (struct sockaddr*)&ipv4_addr;
  } else {
    struct sockaddr_in6 ip6_addr;
    ip6_addr.sin6_family = AF_INET6;
    inet_pton(AF_INET6, sc->target.c_str(), &ip6_addr.sin6_addr);
    addr = (struct sockaddr*)&ip6_addr;
  }

  auto target = SCNetworkReachabilityCreateWithAddress(nullptr, addr);
  target_addresses_.push_back(sc->target);
  addTarget(sc, target);
}
Example #28
0
void NDKCamera::CreateSession(ANativeWindow* previewWindow,
                              ANativeWindow* jpgWindow, int32_t imageRotation) {
  // Create output from this app's ANativeWindow, and add into output container
  requests_[PREVIEW_REQUEST_IDX].outputNativeWindow_ = previewWindow;
  requests_[PREVIEW_REQUEST_IDX].template_ = TEMPLATE_PREVIEW;
  requests_[JPG_CAPTURE_REQUEST_IDX].outputNativeWindow_ = jpgWindow;
  requests_[JPG_CAPTURE_REQUEST_IDX].template_ = TEMPLATE_STILL_CAPTURE;

  CALL_CONTAINER(create(&outputContainer_));
  for (auto& req : requests_) {
    ANativeWindow_acquire(req.outputNativeWindow_);
    CALL_OUTPUT(create(req.outputNativeWindow_, &req.sessionOutput_));
    CALL_CONTAINER(add(outputContainer_, req.sessionOutput_));
    CALL_TARGET(create(req.outputNativeWindow_, &req.target_));
    CALL_DEV(createCaptureRequest(cameras_[activeCameraId_].device_,
                                  req.template_, &req.request_));
    CALL_REQUEST(addTarget(req.request_, req.target_));
  }

  // Create a capture session for the given preview request
  captureSessionState_ = CaptureSessionState::READY;
  CALL_DEV(createCaptureSession(cameras_[activeCameraId_].device_,
                                outputContainer_, GetSessionListener(),
                                &captureSession_));

  ACaptureRequest_setEntry_i32(requests_[JPG_CAPTURE_REQUEST_IDX].request_,
                               ACAMERA_JPEG_ORIENTATION, 1, &imageRotation);

  /*
   * Only preview request is in manual mode, JPG is always in Auto mode
   * JPG capture mode could also be switch into manual mode and control
   * the capture parameters, this sample leaves JPG capture to be auto mode
   * (auto control has better effect than author's manual control)
   */
  uint8_t aeModeOff = ACAMERA_CONTROL_AE_MODE_OFF;
  CALL_REQUEST(setEntry_u8(requests_[PREVIEW_REQUEST_IDX].request_,
                           ACAMERA_CONTROL_AE_MODE, 1, &aeModeOff));
  CALL_REQUEST(setEntry_i32(requests_[PREVIEW_REQUEST_IDX].request_,
                            ACAMERA_SENSOR_SENSITIVITY, 1, &sensitivity_));
  CALL_REQUEST(setEntry_i64(requests_[PREVIEW_REQUEST_IDX].request_,
                            ACAMERA_SENSOR_EXPOSURE_TIME, 1, &exposureTime_));
}
Example #29
0
NfcDevice::NfcDevice(QString path) {
  _iface = new NfcDeviceInterface("org.nfc_tools.nfcd",
			path, QDBusConnection::systemBus(), this);
  if( _iface->isValid() ) {
    _name = _iface->getName();
    _id = _iface->getId();
    QObject::connect(_iface,SIGNAL(targetFieldEntered(QString,QString)),
      this, SLOT(addTarget(QString,QString)));
    QObject::connect(_iface,SIGNAL(targetFieldLeft(QString,QString)),
      this, SLOT(removeTarget(QString,QString)));
    QStringList targetsList = _iface->getTargetList();
    for(int i = 0; i < targetsList.size(); i++) {
      QString path = _iface->getTargetPathByUid(targetsList.at(i));
      _targets.append( new NfcTarget(path) );
    }
  }
  else {
    qDebug() << "DBus interface not valid with path: (" + path + ")";
  }
}
void
Participant::restoreTarget(const QVariant &state)
{
    const QVariantMap map = state.toMap();
    Target *target = addTarget();
    target->setAuthor(map.value("author", "").toString());
    target->setInfo(map.value("info", "").toString());
    target->setKitName(map.value("kitName", "").toString());
    target->setLicense(map.value("license", "").toString());
    target->setName(map.value("name", "").toString());
    target->setPath(map.value("path", "").toString());

    QString algorithmStr =
        map.value("layerAlgorithm", "LINEAR_INTERPOLATION").toString();
    target->setLayerAlgorithm
    (algorithmStr == "MAXIMUM" ? LAYERALGORITHM_MAXIMUM :
     algorithmStr == "MINIMUM" ? LAYERALGORITHM_MINIMUM :
     LAYERALGORITHM_LINEAR_INTERPOLATION);

    QString formatStr =
        map.value("sampleFormat", "SAMPLEFORMAT_FLAC_24BIT").toString();
    target->setSampleFormat
    (formatStr == "AIFF_8BIT" ? SAMPLEFORMAT_AIFF_8BIT :
     formatStr == "AIFF_16BIT" ? SAMPLEFORMAT_AIFF_16BIT :
     formatStr == "AIFF_24BIT" ? SAMPLEFORMAT_AIFF_24BIT :
     formatStr == "AIFF_32BIT" ? SAMPLEFORMAT_AIFF_32BIT :
     formatStr == "AIFF_32BIT_FLOAT" ? SAMPLEFORMAT_AIFF_32BIT_FLOAT :
     formatStr == "AU_8BIT" ? SAMPLEFORMAT_AU_8BIT :
     formatStr == "AU_16BIT" ? SAMPLEFORMAT_AU_16BIT :
     formatStr == "AU_24BIT" ? SAMPLEFORMAT_AU_24BIT :
     formatStr == "AU_32BIT" ? SAMPLEFORMAT_AU_32BIT :
     formatStr == "AU_32BIT_FLOAT" ? SAMPLEFORMAT_AU_32BIT_FLOAT :
     formatStr == "FLAC_8BIT" ? SAMPLEFORMAT_FLAC_8BIT :
     formatStr == "FLAC_16BIT" ? SAMPLEFORMAT_FLAC_16BIT :
     formatStr == "FLAC_24BIT" ? SAMPLEFORMAT_FLAC_24BIT :
     formatStr == "WAV_8BIT" ? SAMPLEFORMAT_WAV_8BIT :
     formatStr == "WAV_16BIT" ? SAMPLEFORMAT_WAV_16BIT :
     formatStr == "WAV_24BIT" ? SAMPLEFORMAT_WAV_24BIT :
     formatStr == "WAV_32BIT" ? SAMPLEFORMAT_WAV_32BIT :
     SAMPLEFORMAT_WAV_32BIT_FLOAT);
}