示例#1
0
MojErr MojDbIndex::addBuiltinProps()
{
    LOG_TRACE("Entering function %s", __FUNCTION__);

	MojString idStr;
	MojErr err = idStr.assign(MojDb::IdKey);
	MojErrCheck(err);
	if (m_propNames.find(idStr) == MojInvalidSize) {
		MojObject idProp;
		err = idProp.put(NameKey, idStr);
		MojErrCheck(err);
		err = addProp(idProp);
		MojErrCheck(err);
	}
	if (m_includeDeleted && m_propNames.front() != MojDb::DelKey) {
		MojObject delProp;
		err = delProp.putString(NameKey, MojDb::DelKey);
		MojErrCheck(err);
		err = delProp.putBool(DefaultKey, false);
		MojErrCheck(err);
		err = addProp(delProp, true);
		MojErrCheck(err);
		MojAssert(m_propNames.front() == MojDb::DelKey);
	}
	m_idIndex = m_propNames.find(idStr);
	MojAssert(m_idIndex != MojInvalidSize);
	m_idIndex++; // account for prefix

	return MojErrNone;
}
示例#2
0
    static xmlNodePtr PODContainerToXml(const std::string &rootName, Iterator begin, Iterator end)
    {

        xmlNodePtr root = xmlNewNode(NULL, xmlStrdup( BAD_CAST rootName.c_str() ) );

        if (typeid( typename Iterator::value_type) == typeid(std::string))
        {
            addProp(root, "item_type", "std::string");
        }
        else
        {
            addProp(root, "item_type", ::fwCore::TypeDemangler< typename Iterator::value_type >().getLeafClassname());
        }

        if ( begin == end)
        {
            return root;
        }
        for ( Iterator i=begin ; i!= end ; ++i )
        {
            xmlNodePtr node = newElement( "item", *i );
            xmlAddChild(root,node);
        }
        return root;
    }
示例#3
0
void PropFrame::addPropData(char const* name , PropData const& data , unsigned flag)
{
	switch ( data.getType() )
	{
	case PROP_VEC3F:
		if ( flag & CPF_COLOR )
		{
			//TODO

		}
		else
		{
			FixString< 128 > fullName;
			fullName = name;
			fullName += ".X";
			addProp( fullName , data.cast< Vec3f >().x , flag );
			fullName = name;
			fullName += ".Y";
			addProp( fullName , data.cast< Vec3f >().y , flag );
			fullName = name;
			fullName += ".Y";
			addProp( fullName , data.cast< Vec3f >().z , flag );
		}
		break;
	case PROP_VEC2F:
		{
			FixString< 128 > fullName;
			fullName = name;
			fullName += ".X";
			addProp( fullName , data.cast< Vec2f >().x , flag );
			fullName = name;
			fullName += ".Y";
			addProp( fullName , data.cast< Vec2f >().y , flag );
		}
		break;
	case PROP_BOOL:
		{
			int valueSet[] = { 1 , 0 };
			char const* strSet[] = { "True" , "False" };
			addEnumProp( name , data.cast< bool >() , 2 , valueSet , strSet );
		}
		break;
	default:
		{
			PorpTextCtrl* textCtrl = new PorpTextCtrl( UI_PROP_TEXTCTRL , calcWidgetPos() , getWidgetSize() , this );
			textCtrl->setData( data );
			addPorpWidget( name , textCtrl );
		}
	}
}
示例#4
0
VObject* addPropValue(VObject *o, const char *p, const char *v)
{
    VObject *prop;
    prop = addProp(o,p);
    setVObjectUStringZValue_(prop, fakeUnicode(v,0));
    return prop;
}
示例#5
0
DLLEXPORT(VObject*) addPropValue(VObject *o, const char *p, const char *v)
{
    VObject *prop;
    prop = addProp(o,p);
    setVObjectStringZValue_(prop, strdup( v ) );
    return prop;
}
VObject* OContactAccessBackend_VCard::safeAddProp( VObject *o, const char *prop)
{
    VObject *ret = 0;
    if ( o )
        ret = addProp( o, prop );
    return ret;
}
示例#7
0
DLLEXPORT(VObject*) setValueWithSize_(VObject *prop, void *val, unsigned int size)
{
    VObject *sizeProp;
    setVObjectAnyValue(prop, val);
    sizeProp = addProp(prop,VCDataSizeProp);
    setVObjectLongValue(sizeProp, size);
    return prop;
}
示例#8
0
DLLEXPORT(VObject*) addPropSizedValue_(VObject *o, const char *p, const char *v,
	unsigned int size)
{
    VObject *prop;
    prop = addProp(o,p);
    setValueWithSize_(prop, (void*)v, size);
    return prop;
}
示例#9
0
VObject* addGroup(VObject *o, const char *g)
{
    /*
        a.b.c
        -->
        prop(c)
            prop(VCGrouping=b)
                prop(VCGrouping=a)
     */
    char *dot = strrchr(g,'.');
    if (dot) {
        VObject *p, *t;
        char *gs, *n = dot+1;
        gs = dupStr(g,0);       /* so we can write to it. */
        /* used to be
        * t = p = addProp_(o,lookupProp_(n));
        */
        t = p = addProp_(o,lookupProp(n));
        dot = strrchr(gs,'.');
        if (dot) {
            *dot = 0;
            do {
                dot = strrchr(gs,'.');
                if (dot) {
                    n = dot+1;
                    *dot=0;
                }
                else
                    n = gs;
                /* property(VCGroupingProp=n);
                 *  and the value may have VCGrouping property
                 */
                t = addProp(t,VCGroupingProp);
                setVObjectStringZValue(t,lookupProp_(n));
            } while (n != gs);
        } else {
            t = addProp(t,VCGroupingProp);
            setVObjectStringZValue(t,lookupProp_(n));
        }
        deleteStr(gs);
        return p;
        }
    else
        return addProp_(o,lookupProp(g));
}
示例#10
0
VObject* addPropValue(VObject *o, const char *p, const char *v)
{
    VObject *prop;
    prop = addProp(o,p);
  if (v) {
    setVObjectUStringZValue_(prop, fakeUnicode(v,0));
    if (needsQuotedPrintable (v)) {
      if (PL_strcasecmp (VCCardProp, vObjectName(o)) == 0) 
        addProp (prop, VCQuotedPrintableProp);
      else
        addProp (o, VCQuotedPrintableProp);
    }
  }
  else
    setVObjectUStringZValue_(prop, fakeUnicode("",0));

    return prop;
}
示例#11
0
static void enterAttr(const char *s1, const char *s2) {
  const char *p1, *p2 = nullptr;
  p1 = lookupProp_(s1);
  if (s2) {
    VObject *a;
    p2 = lookupProp_(s2);
    a = addProp(curProp, p1);
    setVObjectStringZValue(a, p2);
  } else
    addProp(curProp, p1);
  if (PL_strcasecmp(p1, VCBase64Prop) == 0 ||
      (s2 && PL_strcasecmp(p2, VCBase64Prop) == 0))
    lexPushMode(L_BASE64);
  else if (PL_strcasecmp(p1, VCQuotedPrintableProp) == 0 ||
           (s2 && PL_strcasecmp(p2, VCQuotedPrintableProp) == 0))
    lexPushMode(L_QUOTED_PRINTABLE);
  deleteString((char *)s1);
  deleteString((char *)s2);
}
示例#12
0
static int pushVObject(const char *prop) {
  VObject *newObj;
  if (ObjStackTop == PR_MAXLEVEL) return FALSE;

  ObjStack[++ObjStackTop] = curObj;

  if (curObj) {
    newObj = addProp(curObj, prop);
    curObj = newObj;
  } else
    curObj = newVObject(prop);

  return TRUE;
}
示例#13
0
void User::getShareReward(int index)
{
	if(getShareRewardsLock(index - 1) == 1)
	{
		PopPanel::getInstance()->note("shareReward","type:Text---text:"+ a2u("已经获得该奖励"),1.0f,false,true);
		return;
	}
	
	auto name = "shareReward" + cocos2d::Value(index).asString();
	
	ValueVector rewards;
	ValueVector rewardVec;
	stringToValueVector(PlotScript::sharedHD()->getLuaVarString("script/Test.lua", name.c_str()),"###",rewardVec);
	for(auto pair:rewardVec)
	{
		ValueMap rewardMap;
		stringToValueMap(pair.asString(), rewardMap);
		rewards.push_back(cocos2d::Value(rewardMap));
	}

	// 默认只有一个奖品
	auto rewardMap = rewards.at(0).asValueMap();
	int typeId = rewardMap["typeId"].asInt();
	int num = rewardMap["num"].asInt();

	for(int i = 0; i < num; i ++)
	{
		auto prop = Prop::create(typeId);
		// 获得奖励
		auto player = Detect::shareDetect()->getPlayer();
		player->addProp(prop);
	}

	auto prop = Prop::create(typeId);
	PopPanel::getInstance()->note("cantEquip","type:Text---text:"+ a2u("恭喜获得 ###") + "type:Text---text:"+ prop->getNickName() + "|color:{255,0,0}");

	setShareRewardsLock(index - 1, 1);
}
示例#14
0
MojErr MojDbIndex::fromObject(const MojObject& obj, const MojString& locale) 
{
    LOG_TRACE("Entering function %s", __FUNCTION__);

	// check name
	MojString name;
	MojErr err = obj.getRequired(NameKey, name);
	MojErrCheck(err);
	err = validateName(name);
	MojErrCheck(err);
	m_name = name;
	m_locale = locale;
    if(m_locale == _T("en_CN"))
       m_locale = locale;

	// get deleted flag
	bool includeDel = false;
	if (obj.get(IncludeDeletedKey, includeDel)) {
		incDel(includeDel);
	}
	// add props
	MojObject props;
	err = obj.getRequired(PropsKey, props);
	MojErrCheck(err);
	MojObject propObj;
	MojSize j = 0;
	while (props.at(j++, propObj)) {
		err = addProp(propObj);
		MojErrCheck(err);
	}
	if (m_props.empty()) {
		MojErrThrowMsg(MojErrDbInvalidIndex, _T("db: no properties specified in index '%s'"), name.data());
	}
	m_obj = obj;

	return MojErrNone;
}
示例#15
0
/**
 * Add all properties from the given property list, in a reverse order.
 * @param props	Property list to clone.
 */
void PropList::addProps(const PropList& props) {
	for(Property *cur = props.head; cur; cur = cur->next()) {
		Property *copy = cur->copy();
		addProp(copy);
	}
}
示例#16
0
WindowPlanes::WindowPlanes(QDeclarativeItem *parent) :
    QDeclarativeItem(parent)
{
    number=0;
    game_state="stop";
    bullet_type=1;
    prop_state=false;
    save_timer_bullet_to_single=save_timer_two_secs=-1;

    setX(0);
    setY(0);
    planes = new MyPlanes(this);

    connect(planes,SIGNAL(play_music(QString)),SIGNAL(play_music(QString)));

    thread = new QThread(this);
    mythread = new MyThread(this);
    mythread->moveToThread(thread);

    connect(this,SIGNAL(myThreadStart()), mythread, SLOT(start()));
    connect(this,SIGNAL(myThreadStop()), mythread, SLOT(stop()));
    connect(mythread,SIGNAL(game_over()),SLOT(planes_dit()));//Qt::QueuedConnection
    connect(mythread,SIGNAL(game_over()),SIGNAL(game_over()));
    connect(mythread,SIGNAL(captureBomb()),SIGNAL(acquireBomb()));//当用户吃到炸弹道具后发射acquireBomb()信号
    connect(mythread,SIGNAL(captureDoubleBullet()),SLOT(bulletToDouble()));//吃到双倍子弹后调用bulletToDouble()

    thread->start();

#ifdef MEEGO_EDITION_HARMATTAN
    double bulletScaled=0.8,enemyScaled=0.96,enemy3Scaled=0.88,propScaled=1;
#elif defined(Q_OS_SYMBIAN_V5)//判断qt的版本
    double bulletScaled=0.8,enemyScaled=0.8,enemy3Scaled=0.66,propScaled=1;
#else
    double bulletScaled=0.6,enemyScaled=0.72,enemy3Scaled=0.66,propScaled=0.75;
#endif
    //planes->setX(width()/2-planes->width()/2);//设置飞机的位置
    //planes->setY(height()-planes->height());//设置飞机的位置
    image.load(":/Image/Bullets_01.png");
    pixmap_bullet1=QPixmap::fromImage(image.scaled(bulletScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/Bullets_02.png");
    pixmap_bullet2=QPixmap::fromImage(image.scaled(bulletScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));



    image.load(":/Image/Bullets_Bomb.png");
    pixmap_prop1=QPixmap::fromImage(image.scaled(propScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/Bullets_Dual.png");
    pixmap_prop0=QPixmap::fromImage(image.scaled(propScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));




    image.load(":/Image/F2_01.png");
    pixmap_enemy1_1=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F2_02.png");
    pixmap_enemy1_2=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F2_03.png");
    pixmap_enemy1_3=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F2_04.png");
    pixmap_enemy1_4=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F2_05.png");
    pixmap_enemy1_5=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));



    image.load(":/Image/F3_01.png");
    pixmap_enemy2_1=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F3_02.png");
    pixmap_enemy2_2=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F3_03.png");
    pixmap_enemy2_3=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F3_04.png");
    pixmap_enemy2_4=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F3_05.png");
    pixmap_enemy2_5=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F3_06.png");
    pixmap_enemy2_6=QPixmap::fromImage(image.scaled(enemyScaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));


    image.load(":/Image/F4_01.png");
    pixmap_enemy3_1=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_02.png");
    pixmap_enemy3_2=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_03.png");
    pixmap_enemy3_3=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_04.png");
    pixmap_enemy3_4=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_05.png");
    pixmap_enemy3_5=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_06.png");
    pixmap_enemy3_6=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_07.png");
    pixmap_enemy3_7=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_08.png");
    pixmap_enemy3_8=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));

    image.load(":/Image/F4_09.png");
    pixmap_enemy3_9=QPixmap::fromImage(image.scaled(enemy3Scaled*image.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));


    connect(&timer_bullet,SIGNAL(timeout()),this,SLOT(addBullet()));
    connect(&timer_enemy1_1,SIGNAL(timeout()),SLOT(addenemy1_1()));
    connect(&timer_enemy1_2,SIGNAL(timeout()),SLOT(addenemy1_2()));
    connect(&timer_enemy1_3,SIGNAL(timeout()),SLOT(addenemy1_3()));
    connect(&timer_enemy2_1,SIGNAL(timeout()),SLOT(addenemy2_1()));
    connect(&timer_enemy2_2,SIGNAL(timeout()),SLOT(addenemy2_2()));
    connect(&timer_enemy2_3,SIGNAL(timeout()),SLOT(addenemy2_3()));
    connect(&timer_enemy3_1,SIGNAL(timeout()),SLOT(addenemy3_1()));
    connect(&timer_enemy3_2,SIGNAL(timeout()),SLOT(addenemy3_2()));
    connect(&timer_enemy3_3,SIGNAL(timeout()),SLOT(addenemy3_3()));

    connect(&timer_prop,SIGNAL(timeout()),SLOT(addProp()));
    timer_bullet_to_single.setSingleShot(true);
    timer_two_secs.setSingleShot(true);
    connect(&timer_bullet_to_single,SIGNAL(timeout()),SLOT(bulletToSingle()));
    connect(&timer_two_secs,SIGNAL(timeout()),SLOT(enemy_timer_start()));
    grade=1;

    pixmap_bullet=&pixmap_bullet1;

}
void DlgObjProperties::concatenate(PropertyEditorList& l)
{
	for (uint i = 0; i < l.size(); ++i)
		addProp(l[i]);
}
示例#18
0
DimRegionEdit::DimRegionEdit() :
    eEG1PreAttack("Pre-attack", 0, 100, 2),
    eEG1Attack("Attack", 0, 60, 3),
    eEG1Decay1("Decay 1", 0.005, 60, 3),
    eEG1Decay2("Decay 2", 0, 60, 3),
    eEG1InfiniteSustain("Infinite sustain"),
    eEG1Sustain("Sustain", 0, 100, 2),
    eEG1Release("Release", 0, 60, 3),
    eEG1Hold("Hold"),
    eEG1Controller("Controller"),
    eEG1ControllerInvert("Controller invert"),
    eEG1ControllerAttackInfluence("Controller attack influence", 0, 3),
    eEG1ControllerDecayInfluence("Controller decay influence", 0, 3),
    eEG1ControllerReleaseInfluence("Controller release influence", 0, 3),
    eLFO1Frequency("Frequency", 0.1, 10, 2),
    eLFO1InternalDepth("Internal depth", 0, 1200),
    eLFO1ControlDepth("Control depth", 0, 1200),
    eLFO1Controller("Controller"),
    eLFO1FlipPhase("Flip phase"),
    eLFO1Sync("Sync"),
    eEG2PreAttack("Pre-attack", 0, 100, 2),
    eEG2Attack("Attack", 0, 60, 3),
    eEG2Decay1("Decay 1", 0.005, 60, 3),
    eEG2Decay2("Decay 2", 0, 60, 3),
    eEG2InfiniteSustain("Infinite sustain"),
    eEG2Sustain("Sustain", 0, 100, 2),
    eEG2Release("Release", 0, 60, 3),
    eEG2Controller("Controller"),
    eEG2ControllerInvert("Controller invert"),
    eEG2ControllerAttackInfluence("Controller attack influence", 0, 3),
    eEG2ControllerDecayInfluence("Controller decay influence", 0, 3),
    eEG2ControllerReleaseInfluence("Controller release influence", 0, 3),
    eLFO2Frequency("Frequency", 0.1, 10, 2),
    eLFO2InternalDepth("Internal depth", 0, 1200),
    eLFO2ControlDepth("Control depth", 0, 1200),
    eLFO2Controller("Controller"),
    eLFO2FlipPhase("Flip phase"),
    eLFO2Sync("Sync"),
    eEG3Attack("Attack", 0, 10, 3),
    eEG3Depth("Depth", -1200, 1200),
    eLFO3Frequency("Frequency", 0.1, 10, 2),
    eLFO3InternalDepth("Internal depth", 0, 1200),
    eLFO3ControlDepth("Control depth", 0, 1200),
    eLFO3Controller("Controller"),
    eLFO3Sync("Sync"),
    eVCFEnabled("Enabled"),
    eVCFType("Type"),
    eVCFCutoffController("Cutoff controller"),
    eVCFCutoffControllerInvert("Cutoff controller invert"),
    eVCFCutoff("Cutoff"),
    eVCFVelocityCurve("Velocity curve"),
    eVCFVelocityScale("Velocity scale"),
    eVCFVelocityDynamicRange("Velocity dynamic range", 0, 4),
    eVCFResonance("Resonance"),
    eVCFResonanceDynamic("Resonance dynamic"),
    eVCFResonanceController("Resonance controller"),
    eVCFKeyboardTracking("Keyboard tracking"),
    eVCFKeyboardTrackingBreakpoint("Keyboard tracking breakpoint"),
    eVelocityResponseCurve("Velocity response curve"),
    eVelocityResponseDepth("Velocity response depth", 0, 4),
    eVelocityResponseCurveScaling("Velocity response curve scaling"),
    eReleaseVelocityResponseCurve("Release velocity response curve"),
    eReleaseVelocityResponseDepth("Release velocity response depth", 0, 4),
    eReleaseTriggerDecay("Release trigger decay", 0, 8),
    eCrossfade_in_start("Crossfade-in start"),
    eCrossfade_in_end("Crossfade-in end"),
    eCrossfade_out_start("Crossfade-out start"),
    eCrossfade_out_end("Crossfade-out end"),
    ePitchTrack("Pitch track"),
    eDimensionBypass("Dimension bypass"),
    ePan("Pan", -64, 63),
    eSelfMask("Self mask"),
    eAttenuationController("Attenuation controller"),
    eInvertAttenuationController("Invert attenuation controller"),
    eAttenuationControllerThreshold("Attenuation controller threshold"),
    eChannelOffset("Channel offset", 0, 9),
    eSustainDefeat("Sustain defeat"),
    eMSDecode("MS decode"),
    eSampleStartOffset("Sample start offset", 0, 2000),
    eUnityNote("Unity note"),
    eFineTune("Fine tune", -49, 50),
    eGain("Gain", -96, 0, 2, -655360),
    eGainPlus6("Gain +6dB", eGain, 6 * -655360),
    eSampleLoopEnabled("Enabled"),
    eSampleLoopStart("Loop start positon"),
    eSampleLoopLength("Loop size"),
    eSampleLoopType("Loop type"),
    eSampleLoopInfinite("Infinite loop"),
    eSampleLoopPlayCount("Playback count", 1),
    update_model(0)
{
    connect(eEG1PreAttack, &gig::DimensionRegion::EG1PreAttack);
    connect(eEG1Attack, &gig::DimensionRegion::EG1Attack);
    connect(eEG1Decay1, &gig::DimensionRegion::EG1Decay1);
    connect(eEG1Decay2, &gig::DimensionRegion::EG1Decay2);
    connect(eEG1InfiniteSustain, &gig::DimensionRegion::EG1InfiniteSustain);
    connect(eEG1Sustain, &gig::DimensionRegion::EG1Sustain);
    connect(eEG1Release, &gig::DimensionRegion::EG1Release);
    connect(eEG1Hold, &gig::DimensionRegion::EG1Hold);
    connect(eEG1Controller, &gig::DimensionRegion::EG1Controller);
    connect(eEG1ControllerInvert, &gig::DimensionRegion::EG1ControllerInvert);
    connect(eEG1ControllerAttackInfluence,
            &gig::DimensionRegion::EG1ControllerAttackInfluence);
    connect(eEG1ControllerDecayInfluence,
            &gig::DimensionRegion::EG1ControllerDecayInfluence);
    connect(eEG1ControllerReleaseInfluence,
            &gig::DimensionRegion::EG1ControllerReleaseInfluence);
    connect(eLFO1Frequency, &gig::DimensionRegion::LFO1Frequency);
    connect(eLFO1InternalDepth, &gig::DimensionRegion::LFO1InternalDepth);
    connect(eLFO1ControlDepth, &gig::DimensionRegion::LFO1ControlDepth);
    connect(eLFO1Controller, &gig::DimensionRegion::LFO1Controller);
    connect(eLFO1FlipPhase, &gig::DimensionRegion::LFO1FlipPhase);
    connect(eLFO1Sync, &gig::DimensionRegion::LFO1Sync);
    connect(eEG2PreAttack, &gig::DimensionRegion::EG2PreAttack);
    connect(eEG2Attack, &gig::DimensionRegion::EG2Attack);
    connect(eEG2Decay1, &gig::DimensionRegion::EG2Decay1);
    connect(eEG2Decay2, &gig::DimensionRegion::EG2Decay2);
    connect(eEG2InfiniteSustain, &gig::DimensionRegion::EG2InfiniteSustain);
    connect(eEG2Sustain, &gig::DimensionRegion::EG2Sustain);
    connect(eEG2Release, &gig::DimensionRegion::EG2Release);
    connect(eEG2Controller, &gig::DimensionRegion::EG2Controller);
    connect(eEG2ControllerInvert, &gig::DimensionRegion::EG2ControllerInvert);
    connect(eEG2ControllerAttackInfluence,
            &gig::DimensionRegion::EG2ControllerAttackInfluence);
    connect(eEG2ControllerDecayInfluence,
            &gig::DimensionRegion::EG2ControllerDecayInfluence);
    connect(eEG2ControllerReleaseInfluence,
            &gig::DimensionRegion::EG2ControllerReleaseInfluence);
    connect(eLFO2Frequency, &gig::DimensionRegion::LFO2Frequency);
    connect(eLFO2InternalDepth, &gig::DimensionRegion::LFO2InternalDepth);
    connect(eLFO2ControlDepth, &gig::DimensionRegion::LFO2ControlDepth);
    connect(eLFO2Controller, &gig::DimensionRegion::LFO2Controller);
    connect(eLFO2FlipPhase, &gig::DimensionRegion::LFO2FlipPhase);
    connect(eLFO2Sync, &gig::DimensionRegion::LFO2Sync);
    connect(eEG3Attack, &gig::DimensionRegion::EG3Attack);
    connect(eEG3Depth, &gig::DimensionRegion::EG3Depth);
    connect(eLFO3Frequency, &gig::DimensionRegion::LFO3Frequency);
    connect(eLFO3InternalDepth, &gig::DimensionRegion::LFO3InternalDepth);
    connect(eLFO3ControlDepth, &gig::DimensionRegion::LFO3ControlDepth);
    connect(eLFO3Controller, &gig::DimensionRegion::LFO3Controller);
    connect(eLFO3Sync, &gig::DimensionRegion::LFO3Sync);
    connect(eVCFEnabled, &gig::DimensionRegion::VCFEnabled);
    connect(eVCFType, &gig::DimensionRegion::VCFType);
    connect(eVCFCutoffController,
            &gig::DimensionRegion::SetVCFCutoffController);
    connect(eVCFCutoffControllerInvert,
            &gig::DimensionRegion::VCFCutoffControllerInvert);
    connect(eVCFCutoff, &gig::DimensionRegion::VCFCutoff);
    connect(eVCFVelocityCurve, &gig::DimensionRegion::SetVCFVelocityCurve);
    connect(eVCFVelocityScale, &gig::DimensionRegion::SetVCFVelocityScale);
    connect(eVCFVelocityDynamicRange,
            &gig::DimensionRegion::SetVCFVelocityDynamicRange);
    connect(eVCFResonance, &gig::DimensionRegion::VCFResonance);
    connect(eVCFResonanceDynamic, &gig::DimensionRegion::VCFResonanceDynamic);
    connect(eVCFResonanceController,
            &gig::DimensionRegion::VCFResonanceController);
    connect(eVCFKeyboardTracking, &gig::DimensionRegion::VCFKeyboardTracking);
    connect(eVCFKeyboardTrackingBreakpoint,
            &gig::DimensionRegion::VCFKeyboardTrackingBreakpoint);
    connect(eVelocityResponseCurve,
            &gig::DimensionRegion::SetVelocityResponseCurve);
    connect(eVelocityResponseDepth,
            &gig::DimensionRegion::SetVelocityResponseDepth);
    connect(eVelocityResponseCurveScaling,
            &gig::DimensionRegion::SetVelocityResponseCurveScaling);
    connect(eReleaseVelocityResponseCurve,
            &gig::DimensionRegion::SetReleaseVelocityResponseCurve);
    connect(eReleaseVelocityResponseDepth,
            &gig::DimensionRegion::SetReleaseVelocityResponseDepth);
    connect(eReleaseTriggerDecay, &gig::DimensionRegion::ReleaseTriggerDecay);
    connect(eCrossfade_in_start, &DimRegionEdit::set_Crossfade_in_start);
    connect(eCrossfade_in_end, &DimRegionEdit::set_Crossfade_in_end);
    connect(eCrossfade_out_start, &DimRegionEdit::set_Crossfade_out_start);
    connect(eCrossfade_out_end, &DimRegionEdit::set_Crossfade_out_end);
    connect(ePitchTrack, &gig::DimensionRegion::PitchTrack);
    connect(eDimensionBypass, &gig::DimensionRegion::DimensionBypass);
    connect(ePan, &gig::DimensionRegion::Pan);
    connect(eSelfMask, &gig::DimensionRegion::SelfMask);
    connect(eAttenuationController,
            &gig::DimensionRegion::AttenuationController);
    connect(eInvertAttenuationController,
            &gig::DimensionRegion::InvertAttenuationController);
    connect(eAttenuationControllerThreshold,
            &gig::DimensionRegion::AttenuationControllerThreshold);
    connect(eChannelOffset, &gig::DimensionRegion::ChannelOffset);
    connect(eSustainDefeat, &gig::DimensionRegion::SustainDefeat);
    connect(eMSDecode, &gig::DimensionRegion::MSDecode);
    connect(eSampleStartOffset, &gig::DimensionRegion::SampleStartOffset);
    connect(eUnityNote, &DimRegionEdit::set_UnityNote);
    connect(eFineTune, &DimRegionEdit::set_FineTune);
    connect(eGain, &DimRegionEdit::set_Gain);
    connect(eGainPlus6, &DimRegionEdit::set_Gain);
    connect(eSampleLoopEnabled, &DimRegionEdit::set_LoopEnabled);
    connect(eSampleLoopType, &DimRegionEdit::set_LoopType);
    connect(eSampleLoopStart, &DimRegionEdit::set_LoopStart);
    connect(eSampleLoopLength, &DimRegionEdit::set_LoopLength);
    connect(eSampleLoopInfinite, &DimRegionEdit::set_LoopInfinite);
    connect(eSampleLoopPlayCount, &DimRegionEdit::set_LoopPlayCount);

    for (int i = 0 ; i < 7 ; i++) {
        table[i] = new Gtk::Table(3, 1);
        table[i]->set_col_spacings(7);
    }

    // set tooltips
    eUnityNote.set_tip(
        _("Note this sample is associated with (a.k.a. 'root note')")
    );
    eSampleStartOffset.set_tip(_("Sample position at which playback should be started"));
    ePan.set_tip(_("Stereo balance (left/right)"));
    eChannelOffset.set_tip(
        _("Output channel where the audio signal should be routed to (0 - 9)")
    );
    ePitchTrack.set_tip(
        _("If true: sample will be pitched according to the key position "
          "(this would be disabled for drums for example)")
    );
    eSampleLoopEnabled.set_tip(_("If enabled: repeats to playback the sample"));
    eSampleLoopStart.set_tip(
        _("Start position within the sample (in sample points) of the area to "
          "be looped")
    );
    eSampleLoopLength.set_tip(
        _("Duration (in sample points) of the area to be looped")
    );
    eSampleLoopType.set_tip(
        _("Direction in which the loop area in the sample should be played back")
    );
    eSampleLoopInfinite.set_tip(
        _("Whether the loop area should be played back forever\n"
          "Caution: this setting is stored on Sample side, thus is shared "
          "among all dimension regions that use this sample!")
    );
    eSampleLoopPlayCount.set_tip(
        _("How many times the loop area should be played back\n"
          "Caution: this setting is stored on Sample side, thus is shared "
          "among all dimension regions that use this sample!")
    );

    pageno = 0;
    rowno = 0;
    firstRowInBlock = 0;

    addHeader(_("Mandatory Settings"));
    addString("Sample", lSample, wSample);
    //TODO: the following would break drag&drop:   wSample->property_editable().set_value(false);  or this:    wSample->set_editable(false);
    tooltips.set_tip(*wSample, _("Drop a sample here"));
    addProp(eUnityNote);
    addHeader(_("Optional Settings"));
    addProp(eSampleStartOffset);
    addProp(eChannelOffset);
    addHeader("Loops");
    addProp(eSampleLoopEnabled);
    addProp(eSampleLoopStart);
    addProp(eSampleLoopLength);
    {
        const char* choices[] = { "normal", "bidirectional", "backward", 0 };
        static const uint32_t values[] = {
            gig::loop_type_normal,
            gig::loop_type_bidirectional,
            gig::loop_type_backward
        };
        eSampleLoopType.set_choices(choices, values);
    }
    addProp(eSampleLoopType);
    addProp(eSampleLoopInfinite);
    addProp(eSampleLoopPlayCount);

    nextPage();

    addHeader(_("General Amplitude Settings"));
    addProp(eGain);
    addProp(eGainPlus6);
    addProp(ePan);
    addHeader(_("Amplitude Envelope (EG1)"));
    addProp(eEG1PreAttack);
    addProp(eEG1Attack);
    addProp(eEG1Decay1);
    addProp(eEG1Decay2);
    addProp(eEG1InfiniteSustain);
    addProp(eEG1Sustain);
    addProp(eEG1Release);
    addProp(eEG1Hold);
    addProp(eEG1Controller);
    addProp(eEG1ControllerInvert);
    addProp(eEG1ControllerAttackInfluence);
    addProp(eEG1ControllerDecayInfluence);
    addProp(eEG1ControllerReleaseInfluence);

    nextPage();

    addHeader(_("Amplitude Oscillator (LFO1)"));
    addProp(eLFO1Frequency);
    addProp(eLFO1InternalDepth);
    addProp(eLFO1ControlDepth);
    {
        const char* choices[] = { "internal", "modwheel", "breath",
                                  "internal+modwheel", "internal+breath", 0 };
        static const gig::lfo1_ctrl_t values[] = {
            gig::lfo1_ctrl_internal,
            gig::lfo1_ctrl_modwheel,
            gig::lfo1_ctrl_breath,
            gig::lfo1_ctrl_internal_modwheel,
            gig::lfo1_ctrl_internal_breath
        };
        eLFO1Controller.set_choices(choices, values);
    }
    addProp(eLFO1Controller);
    addProp(eLFO1FlipPhase);
    addProp(eLFO1Sync);
    addHeader("Crossfade");
    addProp(eAttenuationController);
    addProp(eInvertAttenuationController);
    addProp(eAttenuationControllerThreshold);
    addProp(eCrossfade_in_start);
    addProp(eCrossfade_in_end);
    addProp(eCrossfade_out_start);
    addProp(eCrossfade_out_end);

    nextPage();

    addHeader(_("General Filter Settings"));
    addProp(eVCFEnabled);
    {
        const char* choices[] = { "lowpass", "lowpassturbo", "bandpass",
                                  "highpass", "bandreject", 0 };
        static const gig::vcf_type_t values[] = {
            gig::vcf_type_lowpass,
            gig::vcf_type_lowpassturbo,
            gig::vcf_type_bandpass,
            gig::vcf_type_highpass,
            gig::vcf_type_bandreject
        };
        eVCFType.set_choices(choices, values);
    }
    addProp(eVCFType);
    {
        const char* choices[] = { "none", "none2", "modwheel", "effect1", "effect2",
                                  "breath", "foot", "sustainpedal", "softpedal",
                                  "genpurpose7", "genpurpose8", "aftertouch", 0 };
        static const gig::vcf_cutoff_ctrl_t values[] = {
            gig::vcf_cutoff_ctrl_none,
            gig::vcf_cutoff_ctrl_none2,
            gig::vcf_cutoff_ctrl_modwheel,
            gig::vcf_cutoff_ctrl_effect1,
            gig::vcf_cutoff_ctrl_effect2,
            gig::vcf_cutoff_ctrl_breath,
            gig::vcf_cutoff_ctrl_foot,
            gig::vcf_cutoff_ctrl_sustainpedal,
            gig::vcf_cutoff_ctrl_softpedal,
            gig::vcf_cutoff_ctrl_genpurpose7,
            gig::vcf_cutoff_ctrl_genpurpose8,
            gig::vcf_cutoff_ctrl_aftertouch
        };
        eVCFCutoffController.set_choices(choices, values);
    }
    addProp(eVCFCutoffController);
    addProp(eVCFCutoffControllerInvert);
    addProp(eVCFCutoff);
    const char* curve_type_texts[] = { "nonlinear", "linear", "special", 0 };
    static const gig::curve_type_t curve_type_values[] = {
        gig::curve_type_nonlinear,
        gig::curve_type_linear,
        gig::curve_type_special
    };
    eVCFVelocityCurve.set_choices(curve_type_texts, curve_type_values);
    addProp(eVCFVelocityCurve);
    addProp(eVCFVelocityScale);
    addProp(eVCFVelocityDynamicRange);
    addProp(eVCFResonance);
    addProp(eVCFResonanceDynamic);
    {
        const char* choices[] = { "none", "genpurpose3", "genpurpose4",
                                  "genpurpose5", "genpurpose6", 0 };
        static const gig::vcf_res_ctrl_t values[] = {
            gig::vcf_res_ctrl_none,
            gig::vcf_res_ctrl_genpurpose3,
            gig::vcf_res_ctrl_genpurpose4,
            gig::vcf_res_ctrl_genpurpose5,
            gig::vcf_res_ctrl_genpurpose6
        };
        eVCFResonanceController.set_choices(choices, values);
    }
    addProp(eVCFResonanceController);
    addProp(eVCFKeyboardTracking);
    addProp(eVCFKeyboardTrackingBreakpoint);

    nextPage();

    addHeader(_("Filter Cutoff Envelope (EG2)"));
    addProp(eEG2PreAttack);
    addProp(eEG2Attack);
    addProp(eEG2Decay1);
    addProp(eEG2Decay2);
    addProp(eEG2InfiniteSustain);
    addProp(eEG2Sustain);
    addProp(eEG2Release);
    addProp(eEG2Controller);
    addProp(eEG2ControllerInvert);
    addProp(eEG2ControllerAttackInfluence);
    addProp(eEG2ControllerDecayInfluence);
    addProp(eEG2ControllerReleaseInfluence);
    addHeader(_("Filter Cutoff Oscillator (LFO2)"));
    addProp(eLFO2Frequency);
    addProp(eLFO2InternalDepth);
    addProp(eLFO2ControlDepth);
    {
        const char* choices[] = { "internal", "modwheel", "foot",
                                  "internal+modwheel", "internal+foot", 0 };
        static const gig::lfo2_ctrl_t values[] = {
            gig::lfo2_ctrl_internal,
            gig::lfo2_ctrl_modwheel,
            gig::lfo2_ctrl_foot,
            gig::lfo2_ctrl_internal_modwheel,
            gig::lfo2_ctrl_internal_foot
        };
        eLFO2Controller.set_choices(choices, values);
    }
    addProp(eLFO2Controller);
    addProp(eLFO2FlipPhase);
    addProp(eLFO2Sync);

    nextPage();

    addHeader(_("General Pitch Settings"));
    addProp(eFineTune);
    addProp(ePitchTrack);
    addHeader(_("Pitch Envelope (EG3)"));
    addProp(eEG3Attack);
    addProp(eEG3Depth);
    addHeader(_("Pitch Oscillator (LFO3)"));
    addProp(eLFO3Frequency);
    addProp(eLFO3InternalDepth);
    addProp(eLFO3ControlDepth);
    {
        const char* choices[] = { "internal", "modwheel", "aftertouch",
                                  "internal+modwheel", "internal+aftertouch", 0 };
        static const gig::lfo3_ctrl_t values[] = {
            gig::lfo3_ctrl_internal,
            gig::lfo3_ctrl_modwheel,
            gig::lfo3_ctrl_aftertouch,
            gig::lfo3_ctrl_internal_modwheel,
            gig::lfo3_ctrl_internal_aftertouch
        };
        eLFO3Controller.set_choices(choices, values);
    }
    addProp(eLFO3Controller);
    addProp(eLFO3Sync);

    nextPage();

    eVelocityResponseCurve.set_choices(curve_type_texts, curve_type_values);
    addProp(eVelocityResponseCurve);
    addProp(eVelocityResponseDepth);
    addProp(eVelocityResponseCurveScaling);
    eReleaseVelocityResponseCurve.set_choices(curve_type_texts,
                                              curve_type_values);
    addProp(eReleaseVelocityResponseCurve);
    addProp(eReleaseVelocityResponseDepth);
    addProp(eReleaseTriggerDecay);
    {
        const char* choices[] = { "none", "effect4depth", "effect5depth", 0 };
        static const gig::dim_bypass_ctrl_t values[] = {
            gig::dim_bypass_ctrl_none,
            gig::dim_bypass_ctrl_94,
            gig::dim_bypass_ctrl_95
        };
        eDimensionBypass.set_choices(choices, values);
    }
    addProp(eDimensionBypass);
    addProp(eSelfMask);
    addProp(eSustainDefeat);
    addProp(eMSDecode);

    nextPage();


    eEG1InfiniteSustain.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::EG1InfiniteSustain_toggled));
    eEG2InfiniteSustain.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::EG2InfiniteSustain_toggled));
    eEG1Controller.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::EG1Controller_changed));
    eEG2Controller.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::EG2Controller_changed));
    eLFO1Controller.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::LFO1Controller_changed));
    eLFO2Controller.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::LFO2Controller_changed));
    eLFO3Controller.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::LFO3Controller_changed));
    eAttenuationController.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::AttenuationController_changed));
    eVCFEnabled.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::VCFEnabled_toggled));
    eVCFCutoffController.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::VCFCutoffController_changed));
    eVCFResonanceController.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::VCFResonanceController_changed));

    eCrossfade_in_start.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::crossfade1_changed));
    eCrossfade_in_end.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::crossfade2_changed));
    eCrossfade_out_start.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::crossfade3_changed));
    eCrossfade_out_end.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::crossfade4_changed));

    eSampleLoopEnabled.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::update_loop_elements));
    eSampleLoopStart.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::loop_start_changed));
    eSampleLoopLength.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::loop_length_changed));
    eSampleLoopInfinite.signal_value_changed().connect(
        sigc::mem_fun(*this, &DimRegionEdit::loop_infinite_toggled));

    append_page(*table[0], "Sample");
    append_page(*table[1], "Amplitude (1)");
    append_page(*table[2], "Amplitude (2)");
    append_page(*table[3], "Filter (1)");
    append_page(*table[4], "Filter (2)");
    append_page(*table[5], "Pitch");
    append_page(*table[6], "Misc");
}