Ejemplo n.º 1
0
    // ----------------------------------------------------------
    LogSvcHandler::LogSvcHandler(const std::string& soName) :
	sourceObjectName_m(soName)
    {
        setRemoteLevelType(NOT_DEFINED_LOG_LEVEL);
        setLocalLevelType(NOT_DEFINED_LOG_LEVEL);
	char *acsSTDIO = getenv("ACS_LOG_STDOUT");
	int envStdioPriority = -1;
	if (acsSTDIO && *acsSTDIO)
	{
		envStdioPriority = atoi(acsSTDIO);
	}

	char *acsCentralizeLogger = getenv("ACS_LOG_CENTRAL");
	int envCentralizePriority = -1;
	if (acsCentralizeLogger && *acsCentralizeLogger)
	{
		envCentralizePriority = atoi(acsCentralizeLogger);
	}
	setLevels(LM_TRACE, LM_TRACE,DEFAULT_LOG_LEVEL);
	if(envStdioPriority >= 0)
		setLevels((Priority)-1, static_cast<Logging::BaseLog::Priority>(LogLevelDefinition::getACELogPriority(envStdioPriority)), ENV_LOG_LEVEL);
	
	if(envCentralizePriority >= 0)
		setLevels(static_cast<Logging::BaseLog::Priority>(LogLevelDefinition::getACELogPriority(envCentralizePriority)), (Priority)-1, ENV_LOG_LEVEL);
    }
Ejemplo n.º 2
0
	void configure(const LLSD& config)
	{
		Globals& g = Globals::get();
		Settings& s = Settings::get();
		
		g.invalidateCallSites();
		s.functionLevelMap.clear();
		s.classLevelMap.clear();
		s.fileLevelMap.clear();
		
		setPrintLocation(config["print-location"]);
		setDefaultLevel(decodeLevel(config["default-level"]));
		
		LLSD sets = config["settings"];
		LLSD::array_const_iterator a, end;
		for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a)
		{
			const LLSD& entry = *a;
			
			ELevel level = decodeLevel(entry["level"]);
			
			setLevels(s.functionLevelMap,	entry["functions"],	level);
			setLevels(s.classLevelMap,		entry["classes"],	level);
			setLevels(s.fileLevelMap,		entry["files"],		level);
		}
	}
Ejemplo n.º 3
0
	void configure(const LLSD& config)
	{
		AIAccess<Settings> settings_w(Settings::get());
		AIAccess<Globals>(Globals::get())->invalidateCallSites();
		settings_w->functionLevelMap.clear();
		settings_w->classLevelMap.clear();
		settings_w->fileLevelMap.clear();
		settings_w->tagLevelMap.clear();
		settings_w->uniqueLogMessages.clear();
		
		setPrintLocation(settings_w, config["print-location"]);
		setDefaultLevel(settings_w, decodeLevel(config["default-level"]));
		
		LLSD sets = config["settings"];
		LLSD::array_const_iterator a, end;
		for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a)
		{
			const LLSD& entry = *a;
			
			ELevel level = decodeLevel(entry["level"]);
			
			setLevels(settings_w->functionLevelMap, entry["functions"], level);
			setLevels(settings_w->classLevelMap,	 entry["classes"],   level);
			setLevels(settings_w->fileLevelMap,	 entry["files"],	 level);
			setLevels(settings_w->tagLevelMap,		 entry["tags"],		 level);
		}
	}
Ejemplo n.º 4
0
void setLevels(Tree* t, int height) {
    if(!t) {
        return;
    }
    else {
        t->level = height;
        setLevels(t->left, height + 1);
        setLevels(t->right, height + 1);
    }
}
Ejemplo n.º 5
0
void AudioThumbnail::addBlock (const int64 startSample, const AudioSampleBuffer& incoming,
                               int startOffsetInBuffer, int numSamples)
{
    jassert (startSample >= 0);

    const int firstThumbIndex = (int) (startSample / samplesPerThumbSample);
    const int lastThumbIndex  = (int) ((startSample + numSamples + (samplesPerThumbSample - 1)) / samplesPerThumbSample);
    const int numToDo = lastThumbIndex - firstThumbIndex;

    if (numToDo > 0)
    {
        const int numChans = jmin (channels.size(), incoming.getNumChannels());

        const HeapBlock<MinMaxValue> thumbData ((size_t) (numToDo * numChans));
        const HeapBlock<MinMaxValue*> thumbChannels ((size_t) numChans);

        for (int chan = 0; chan < numChans; ++chan)
        {
            const float* const sourceData = incoming.getSampleData (chan, startOffsetInBuffer);
            MinMaxValue* const dest = thumbData + numToDo * chan;
            thumbChannels [chan] = dest;

            for (int i = 0; i < numToDo; ++i)
            {
                float low, high;
                const int start = i * samplesPerThumbSample;
                FloatVectorOperations::findMinAndMax (sourceData + start, jmin (samplesPerThumbSample, numSamples - start), low, high);
                dest[i].setFloat (low, high);
            }
        }

        setLevels (thumbChannels, firstThumbIndex, numChans, numToDo);
    }
}
Ejemplo n.º 6
0
int weighting(Tree* huffman) {
    if(!huffman) {
        return 0;
    }
    setLevels(huffman, 0);
    return getSum(huffman);
}
Ejemplo n.º 7
0
MeterSegmentOverload::MeterSegmentOverload(const String& componentName, float fThreshold, float fRange, int CrestFactor, bool bThickBorder, int nColor)
{
    // set component name
    setName(componentName);

    // display thick border on meter segment?
    hasThickBorder = bThickBorder;

    // lower threshold, meter segment will be dark below this level
    fLowerThreshold = fThreshold;

    // level range above lower threshold; this affects the brightness
    fThresholdRange = fRange;

    // upper threshold, meter segment will be fully lit above this
    // level
    fUpperThreshold = fThreshold + fThresholdRange;

    // meter crest factor
    nCrestFactor = CrestFactor;

    // show peak level marker on segment?
    bPeakMarker = false;

    // initialise meter segment's brightness (0.0f is dark, 1.0f is
    // fully lit)
    fBrightness = 0.0f;

    // set meter segment's hue from colour number
    if (nColor == 0)
    {
        // meter segment is red
        fHue = 0.00f;
    }
    else if (nColor == 1)
    {
        // meter segment is yellow
        fHue = 0.18f;
    }
    else if (nColor == 2)
    {
        // meter segment is green
        fHue = 0.30f;
    }
    else
    {
        // meter segment is blue
        fHue = 0.58f;
    }

    // initialise maximum level
    fMaximumLevel = -9999.9f;
    strMaximumLevel = "";

    // make sure that segment is drawn after initialisation
    setLevels(-9999.9f, -9999.9f, -9999.9f);
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void MultiOtsuThreshold::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setSelectedCellArrayPath( reader->readDataArrayPath( "SelectedCellArrayPath", getSelectedCellArrayPath() ) );
  setNewCellArrayName( reader->readString( "NewCellArrayName", getNewCellArrayName() ) );
  setSaveAsNewArray( reader->readValue( "SaveAsNewArray", getSaveAsNewArray() ) );
  setSlice( reader->readValue( "Slice", getSlice() ) );
  setLevels( reader->readValue( "Levels", getLevels() ) );
  reader->closeFilterGroup();
}
SingleCollectionTreeItemModel::SingleCollectionTreeItemModel( Collections::Collection *collection,
                                                              const QList<CategoryId::CatMenuId> &levelType )
    :CollectionTreeItemModelBase( )
{
    m_collection = collection;
    //we only have one collection that, by its very nature, is always expanded
    m_expandedCollections.insert( m_collection );
    setLevels( levelType );

    connect( collection, SIGNAL( updated() ), this, SLOT( slotFilter() ) ) ;
}
Ejemplo n.º 10
0
bool OilifyFilter::init(void)
{
  // skip OpenCL initialization in case context is not given
  if (m_ctx == nullptr) return (m_good = true);

  // compile program
  m_program = m_ctx->buildProgramFromSourceFile(CLSRCFILE("oilify.cl"));
  if (m_program.isNull())
  {
    ERRORM("Failed to create Oilify filter program: " << m_program.log().toStdString());
    return false;
  }

  // create kernel
#ifndef OPTIMIZED_VER
  m_kernel = m_program.createKernel("oilify");
  if (m_kernel.isNull())
  {
    ERRORM("Failed to create Oilify filter kernel: " << m_program.log().toStdString());
    return false;
  }
#else
  m_kernel_oilify = m_program.createKernel("oilify");
  if (m_kernel_oilify.isNull())
  {
    ERRORM("Failed to create Oilify filter kernel: " << m_program.log().toStdString());
    return false;
  }

  m_kernel_oilify_prepare = m_program.createKernel("oilify_prepare");
  if (m_kernel_oilify_prepare.isNull())
  {
    ERRORM("Failed to create oilify_prepare filter kernel: " << m_program.log().toStdString());
    return false;
  }
#endif

  setRadius(DEFAULT_RADIUS);
  setLevels(DEFAULT_LEVELS);

  return (m_good = true);
}
Ejemplo n.º 11
0
void
ServiceBase::sortByGenreArtist()
{
    setLevels( QList<CategoryId::CatMenuId>() << CategoryId::Genre << CategoryId::Artist );
}
Ejemplo n.º 12
0
void
ServiceBase::sortByAlbum()
{
    setLevels( QList<CategoryId::CatMenuId>() << CategoryId::Album );
}
Ejemplo n.º 13
0
void PhysicsHashSpace::initHashSpace()
{
    setLevels(getLevels());
    initSpace();
}