void CtrlrPanelMIDISnapshot::gatherSnapshotData()
{
    buffer.clear();

    for (int i=0; i<owner.getModulators().size(); i++)
    {
        CtrlrModulator *m = owner.getModulators()[i];
        if (m->getMidiMessagePtr())
        {
            if (m->getComponent())
            {
                if ((int)m->getComponent()->getProperty(Ids::componentRadioGroupId) > 0)
                {
                    if (m->getComponent()->getToggleState() == false)
                        continue;
                    else if (!(bool)m->getProperty(Ids::modulatorExcludeFromSnapshot))
                        addCtrlrMidiMessageToBuffer (buffer, m->getMidiMessage());
                }
                else if (!(bool)m->getProperty(Ids::modulatorExcludeFromSnapshot))
                {
                    addCtrlrMidiMessageToBuffer (buffer, m->getMidiMessage());
                }
            }
        }
    }
}
void CtrlrPanelMIDISnapshot::gatherSnapshotData()
{
	buffer.clear();

	for (int i=0; i<owner.getModulators().size(); i++)
	{
		CtrlrModulator *m = owner.getModulators()[i];
		if (m->getMidiMessagePtr())
		{
			if (m->getComponent())
			{
				if ((int)m->getComponent()->getProperty(Ids::componentRadioGroupId) > 0)
				{
					if (m->getComponent()->getToggleState() == false)
						continue;
					else if (!(bool)m->getProperty(Ids::modulatorExcludeFromSnapshot))
						addCtrlrMidiMessageToBuffer (buffer, m->getMidiMessage());
				}
				else if (!(bool)m->getProperty(Ids::modulatorExcludeFromSnapshot))
				{
					addCtrlrMidiMessageToBuffer (buffer, m->getMidiMessage());
				}
			}
		}
	}

	showDialog = owner.getProperty(Ids::panelMidiSnapshotShowProgress);

	if (showDialog)
    {
        if (alertWindow == nullptr)
            alertWindow = LookAndFeel::getDefaultLookAndFeel().createAlertWindow ("MIDI Snapshot", String(), "Stop", String(), String(), AlertWindow::NoIcon, 1, nullptr);

        alertWindow->setEscapeKeyCancels (false);
        alertWindow->addProgressBarComponent (progress);
    }
    else
    {
        alertWindow = nullptr;
    }

    if (luaPanelMidiSnapshotPreCbk && !luaPanelMidiSnapshotPreCbk.wasObjectDeleted())
	{
		if (luaPanelMidiSnapshotPreCbk->isValid())
		{
			owner.getCtrlrLuaManager().getMethodManager().call (luaPanelMidiSnapshotPreCbk, &buffer);
		}
	}
}
Example #3
0
ValueTree CtrlrPanel::getProgram(ValueTree treeToWriteTo)
{
	if (treeToWriteTo.isValid())
	{
		treeToWriteTo.removeAllChildren(0);
	}

	ValueTree program(Ids::panelState);
	program.setProperty (Ids::panelVersionMajor, getProperty(Ids::panelVersionMajor), 0);
	program.setProperty (Ids::panelVersionMinor, getProperty(Ids::panelVersionMinor), 0);
	program.setProperty (Ids::time, Time::getCurrentTime().currentTimeMillis(), 0);

	for (int i=0; i<ctrlrModulators.size(); i++)
	{
		CtrlrModulator *m = ctrlrModulators[i];

		ValueTree v(Ids::value);

		if ((bool)m->getProperty (Ids::modulatorIsStatic) == true)
			continue;

		v.setProperty(Ids::name, m->getName(),0);
		v.setProperty(Ids::value, m->getModulatorValue(),0);

		if (treeToWriteTo.isValid())
		{
			treeToWriteTo.addChild (v,-1,0);
		}
		else
		{
			program.addChild (v,-1,0);
		}
	}

	return (program);
}