Esempio n. 1
0
void spnp::Parameter::fromXML(XMLNode *xml)
{
    AbstractData::fromXML(xml);
    delete this->ivalues;
    delete this->fvalues;

    this->ivalues = new std::map<int, int>();
    this->fvalues = new std::map<int, float>();

    std::vector<XMLNode*> *v = xml->getChildrenByName("ivalue");
    for(auto it = v->begin(); it != v->end(); ++it)
    {
        XMLNode *node = *it;
        Parameter::IOPTIONS key = getIValue(node->getAttributeS("iopt"));
        int value = node->getAttributeI("value");

        this->setOption(key, value);
    }
    delete v;

    v = xml->getChildrenByName("fvalue");
    for(auto it = v->begin(); it != v->end(); ++it)
    {
        XMLNode *node = *it;
        Parameter::FOPTIONS key = getFValue(node->getAttributeS("fopt"));
        int value = node->getAttributeI("value");

        this->setOption(key, value);
    }
    delete v;
}
Esempio n. 2
0
void send(int b1, int b2, int b3) {
	if (!G_midiStatus)
		return;
		msg[0] = b1;
		msg[1] = b2;
		msg[2] = b3;
		midiOut->sendMessage(&msg);
	printf("[KM] send msg=0x%X\n", getIValue(b1, b2, b3));
}
Esempio n. 3
0
int Database_Config_General::getTimezone ()
{
  // If the global offset variable is set, that is,
  // within certain limits, then take that.
  if ((config_globals_timezone_offset_utc < MINIMUM_TIMEZONE)
      || (config_globals_timezone_offset_utc > MAXIMUM_TIMEZONE)) {
    return getIValue ("timezone", 0);
  }
  // Else take variable as set in the configuration.
  return config_globals_timezone_offset_utc;
}
Esempio n. 4
0
int Database_Config_General::getUnreceivedBibleDataTime ()
{
  return getIValue ("unreceived-bible-data-time", 0);
}
Esempio n. 5
0
int Database_Config_General::getUnsentBibleDataTime ()
{
  return getIValue ("unsent-bible-data-time", 0);
}
Esempio n. 6
0
int Database_Config_General::getLastSendReceive ()
{
  return getIValue ("last-send-receive", 0);
}
Esempio n. 7
0
int Database_Config_General::getRepeatSendReceive ()
{
  return getIValue ("repeat-send-receive", 0);
}
Esempio n. 8
0
int Database_Config_General::getServerPort ()
{
  return getIValue ("server-port", 8080);
}
Esempio n. 9
0
int Database_Config_Bible::getLetterSpacing (string bible)
{
  return getIValue (bible, "letter-spacing", 0);
}
Esempio n. 10
0
int Database_Config_Bible::getLineHeight (string bible)
{
  return getIValue (bible, "line-height", 100);
}
Esempio n. 11
0
int Database_Config_Bible::getTextDirection (string bible)
{
  return getIValue (bible, "text-direction", 0);
}
Esempio n. 12
0
int Database_Config_Bible::getRepeatSendReceive (string bible)
{
  return getIValue (bible, "repeat-send-receive", 0);
}
Esempio n. 13
0
void callback(double t, std::vector<unsigned char> *msg, void *data) {

	/* 0.8.0 - for now we handle other midi signals (common and real-time
	 * messages) as unknown, for debugging purposes */

	if (msg->size() < 3) {
		printf("[KM] MIDI received - unkown signal - size=%d, value=0x", (int) msg->size());
		for (unsigned i=0; i<msg->size(); i++)
			printf("%X", (int) msg->at(i));
		printf("\n");
		return;
	}

	/* in this place we want to catch two things: a) note on/note off
	 * from a keyboard and b) knob/wheel/slider movements from a
	 * controller */

	uint32_t input = getIValue(msg->at(0), msg->at(1), msg->at(2));
	uint32_t chan  = input & 0x0F000000;
	uint32_t value = input & 0x0000FF00;
	uint32_t pure  = input & 0xFFFF0000;   // input without 'value' byte

	printf("[KM] MIDI received - 0x%X (chan %d)", input, chan >> 24);

	/* start dispatcher. If midi learn is on don't parse channels, just
	 * learn incoming midi signal. Otherwise process master events first,
	 * then each channel in the stack. This way incoming signals don't
	 * get processed by glue_* when midi learning is on. */

	if (cb_learn)	{
		printf("\n");
		cb_learn(pure, cb_data);
	}
	else {

		/* process master events */

		if      (pure == G_Conf.midiInRewind) {
			printf(" >>> rewind (global) (pure=0x%X)", pure);
			glue_rewindSeq();
		}
		else if (pure == G_Conf.midiInStartStop) {
			printf(" >>> startStop (global) (pure=0x%X)", pure);
			glue_startStopSeq();
		}
		else if (pure == G_Conf.midiInActionRec) {
			printf(" >>> actionRec (global) (pure=0x%X)", pure);
			glue_startStopActionRec();
		}
		else if (pure == G_Conf.midiInInputRec) {
			printf(" >>> inputRec (global) (pure=0x%X)", pure);
			glue_startStopInputRec(false, false);   // update gui, no popup messages
		}
		else if (pure == G_Conf.midiInMetronome) {
			printf(" >>> metronome (global) (pure=0x%X)", pure);
			glue_startStopMetronome(false);
		}
		else if (pure == G_Conf.midiInVolumeIn) {
			float vf = (value >> 8)/127.0f;
			printf(" >>> input volume (global) (pure=0x%X, value=%d, float=%f)", pure, value >> 8, vf);
			glue_setInVol(vf, false);
		}
		else if (pure == G_Conf.midiInVolumeOut) {