示例#1
0
void Project::Item::setFile (const RelativePath& file)
{
    jassert (file.getRoot() == RelativePath::projectFolder);
    jassert (isFile());
    state.setProperty (Ids::file, file.toUnixStyle(), getUndoManager());
    state.setProperty (Ids::name, file.getFileName(), getUndoManager());
}
示例#2
0
void Project::Item::setFile (const File& file)
{
    jassert (isFile());
    node.setProperty (Ids::file, project->getRelativePathForFile (file), getUndoManager());
    node.setProperty (Ids::name, file.getFileName(), getUndoManager());

    jassert (getFile() == file);
}
示例#3
0
void Project::Item::sortAlphabetically (bool keepGroupsAtStart)
{
    if (keepGroupsAtStart)
    {
        ItemSorterWithGroupsAtStart sorter;
        state.sort (sorter, getUndoManager(), true);
    }
    else
    {
        ItemSorter sorter;
        state.sort (sorter, getUndoManager(), true);
    }
}
示例#4
0
void EnabledModuleList::addModule (const File& moduleManifestFile, bool copyLocally)
{
    ModuleDescription info (moduleManifestFile);

    if (info.isValid())
    {
        const String moduleID (info.getID());

        if (! isModuleEnabled (moduleID))
        {
            ValueTree module (Ids::MODULES);
            module.setProperty (Ids::ID, moduleID, nullptr);

            state.addChild (module, -1, getUndoManager());
            sortAlphabetically();

            shouldShowAllModuleFilesInProject (moduleID) = true;
            shouldCopyModuleFilesLocally (moduleID) = copyLocally;

            RelativePath path (moduleManifestFile.getParentDirectory().getParentDirectory(),
                               project.getProjectFolder(), RelativePath::projectFolder);

            for (Project::ExporterIterator exporter (project); exporter.next();)
                exporter->getPathForModuleValue (moduleID) = path.toUnixStyle();
        }
    }
}
示例#5
0
void CtrlrPanel::setRestoreState(const bool _restoreStateStatus)
{
	const ScopedWriteLock lock (panelLock);

	getUndoManager()->clearUndoHistory();
	restoreStateStatus = _restoreStateStatus;
}
示例#6
0
void Project::Item::sortAlphabetically (bool keepGroupsAtStart, bool recursive)
{
    sortGroup (state, keepGroupsAtStart, getUndoManager());

    if (recursive)
        for (int i = getNumChildren(); --i >= 0;)
            getChild(i).sortAlphabetically (keepGroupsAtStart, true);
}
示例#7
0
void EnabledModuleList::removeModule (String moduleID) // must be pass-by-value, and not a const ref!
{
    for (int i = state.getNumChildren(); --i >= 0;)
        if (state.getChild(i) [Ids::ID] == moduleID)
            state.removeChild (i, getUndoManager());

    for (Project::ExporterIterator exporter (project); exporter.next();)
        exporter->removePathForModule (moduleID);
}
示例#8
0
void EnabledModuleList::removeModule (const String& moduleID)
{
    for (int i = state.getNumChildren(); --i >= 0;)
        if (state.getChild(i) [Ids::ID] == moduleID)
            state.removeChild (i, getUndoManager());

    for (Project::ExporterIterator exporter (project); exporter.next();)
        exporter->removePathForModule (moduleID);
}
bool ComponentDocument::loadFromXml (const XmlElement& xml)
{
    if (JucerDocument::loadFromXml (xml))
    {
        components->clearComponents();

        forEachXmlChildElement (xml, e)
        {
            if (e->hasTagName (PaintRoutine::xmlTagName))
                backgroundGraphics->loadFromXml (*e);
            else
                components->addComponentFromXml (*e, false);
        }

        changed();
        getUndoManager().clearUndoHistory();
        return true;
    }

    return false;
}
示例#10
0
bool ButtonDocument::loadFromXml (const XmlElement& xml)
{
    if (JucerDocument::loadFromXml (xml))
    {
        for (int i = 7; --i >= 0;)
            paintStatesEnabled [i] = false;

        forEachXmlChildElementWithTagName (xml, e, PaintRoutine::xmlTagName)
        {
            const int stateIndex = stateNameToIndex (e->getStringAttribute ("buttonState"));

            paintRoutines [stateIndex]->loadFromXml (*e);
            paintStatesEnabled [stateIndex] = e->getBoolAttribute ("enabled", stateIndex < normalOn);
        }

        changed();
        getUndoManager().clearUndoHistory();
        return true;
    }

    return false;
}
示例#11
0
bool JucerDocument::loadFromXml (const XmlElement& xml)
{
    if (xml.hasTagName (jucerCompXmlTag)
         && getTypeName().equalsIgnoreCase (xml.getStringAttribute ("documentType")))
    {
        className = xml.getStringAttribute ("className", defaultClassName);
        templateFile = xml.getStringAttribute ("template", String::empty);
        componentName = xml.getStringAttribute ("componentName", String::empty);
        parentClasses = xml.getStringAttribute ("parentClasses", defaultParentClasses);
        constructorParams = xml.getStringAttribute ("constructorParams", String::empty);
        variableInitialisers = xml.getStringAttribute ("variableInitialisers", String::empty);

        fixedSize = xml.getBoolAttribute ("fixedSize", false);
        initialWidth = xml.getIntAttribute ("initialWidth", 300);
        initialHeight = xml.getIntAttribute ("initialHeight", 200);

        snapGridPixels = xml.getIntAttribute ("snapPixels", snapGridPixels);
        snapActive = xml.getBoolAttribute ("snapActive", snapActive);
        snapShown = xml.getBoolAttribute ("snapShown", snapShown);

        componentOverlayOpacity = (float) xml.getDoubleAttribute ("overlayOpacity", 0.0);

        activeExtraMethods.clear();

        if (XmlElement* const methods = xml.getChildByName ("METHODS"))
            forEachXmlChildElementWithTagName (*methods, e, "METHOD")
                activeExtraMethods.addIfNotAlreadyThere (e->getStringAttribute ("name"));

        activeExtraMethods.trim();
        activeExtraMethods.removeEmptyStrings();

        changed();
        getUndoManager().clearUndoHistory();
        return true;
    }

    return false;
}
示例#12
0
Value Project::Item::getShouldInhibitWarningsValue()        { return state.getPropertyAsValue (Ids::noWarnings, getUndoManager()); }
示例#13
0
CtrlrPanel::CtrlrPanel(CtrlrManager &_owner, const String &panelName, const int idx)
	:	owner(_owner),
		panelTree(Ids::panel),
		panelWindowManager(*this),
		ctrlrSysexProcessor(*this),
		processor(*this),
		snapshot(*this),
		panelEvaluationScope(*this),
		globalEvaluationScope(*this),
		resourceManager(*this),
		midiInputThread(*this, false),
		midiControllerInputThread(*this, true),
		restoreStateStatus(true),
		ctrlrMIDILibrary(0),
		ctrlrLuaManager(0),
		ctrlrPanelEditor(nullptr),
		initialProgram(Ids::panelState),
		boostrapStateStatus(false),
		outputDevice(nullptr),
		ctrlrPanelUndoManager(nullptr)

{
	ctrlrPanelUndoManager	= new CtrlrPanelUndoManager(*this);
	ctrlrLuaManager 		= new CtrlrLuaManager(*this);
	ctrlrMIDILibrary 		= new CtrlrMIDILibrary(*this);

	ctrlrLuaManager->getMethodManager().setDebug ((bool)owner.getProperty(Ids::ctrlrLuaDebug));
	ctrlrPanelUndoManager->addChangeListener (this);

	getUndoManager()->beginNewTransaction ("Panel::ctor");
	setProperty (Ids::name, panelName);
	panelTree.addChild (ctrlrMIDILibrary->getObjectTree(), -1, 0);
	panelTree.addChild (ctrlrLuaManager->getLuaManagerTree(), -1, 0);
	panelTree.addChild (panelWindowManager.getManagerTree(), -1, 0);
	panelTree.addChild (resourceManager.getManagerTree(), -1, 0);

	panelTree.addListener (this);
	setProperty (Ids::panelScheme, CTRLR_PANEL_SCHEME);
	setProperty (Ids::panelShowDialogs, true);
	setProperty (Ids::panelMessageTime, 10000);
	setProperty (Ids::panelAuthorName, "");
	setProperty (Ids::panelAuthorEmail, "");
	setProperty (Ids::panelAuthorUrl, "");
	setProperty (Ids::panelAuthorDesc, "");
	setProperty (Ids::panelVersionMajor, 1);
	setProperty (Ids::panelVersionMinor, 0);
	setProperty (Ids::panelVersionName, "Hell-O-Kitty");
	setProperty (Ids::panelVendor, "");
	setProperty (Ids::panelDevice, "");
	setProperty (Ids::panelMidiSnapshotAfterLoad, false);
	setProperty (Ids::panelMidiSnapshotAfterProgramChange, false);
	setProperty (Ids::panelMidiSnapshotDelay, 10);
	setProperty (Ids::panelMidiInputChannelDevice, 1);
	setProperty (Ids::panelMidiInputDevice, COMBO_NONE_ITEM);
	setProperty (Ids::panelMidiControllerChannelDevice, 1);
	setProperty (Ids::panelMidiControllerDevice, COMBO_NONE_ITEM);
	setProperty (Ids::panelMidiOutputChannelDevice, 1);
	setProperty (Ids::panelMidiOutputDevice, COMBO_NONE_ITEM);

	setProperty (Ids::panelMidiInputFromHost, false);
	setProperty (Ids::panelMidiInputChannelHost, 1);
	setProperty (Ids::panelMidiOutputToHost, false);
	setProperty (Ids::panelMidiOutputChannelHost, 1);

	setProperty (Ids::panelMidiThruH2H, false);
	setProperty (Ids::panelMidiThruH2HChannelize, false);
	setProperty (Ids::panelMidiThruH2D, false);
	setProperty (Ids::panelMidiThruH2DChannelize, false);
	setProperty (Ids::panelMidiThruD2D, false);
	setProperty (Ids::panelMidiThruD2DChannelize, false);
	setProperty (Ids::panelMidiThruD2H, false);
	setProperty (Ids::panelMidiThruD2HChannelize, false);
	setProperty (Ids::panelMidiRealtimeIgnore, true);
	setProperty (Ids::panelMidiInputThreadPriority, 7);
	setProperty (Ids::panelMidiProgram, 0);
	setProperty (Ids::panelMidiBankLsb, 0);
	setProperty (Ids::panelMidiBankMsb, 0);
	setProperty (Ids::panelMidiSendProgramChangeOnLoad, false);
	setProperty (Ids::panelMidiProgramCalloutOnprogramChange, false);
	setProperty (Ids::panelMidiMatchCacheSize, 32);
	setProperty (Ids::panelMidiGlobalDelay, 0);

    setProperty (Ids::luaPanelMidiChannelChanged, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelMidiReceived, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelLoaded, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelBeforeLoad, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelSaved, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelResourcesLoaded, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelProgramChanged, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelGlobalChanged, COMBO_ITEM_NONE);
	setProperty (Ids::luaPanelMessageHandler, COMBO_ITEM_NONE);

	setProperty (Ids::panelFilePath, COMBO_ITEM_NONE);
	setProperty (Ids::panelUID, generateRandomUnique());
	setProperty (Ids::panelInstanceUID, generateRandomUniquePluginId());
    setProperty (Ids::panelInstanceManufacturerID, generateRandomUniquePluginId());
	setProperty (Ids::panelModulatorListColumns, COMBO_ITEM_NONE);
	setProperty (Ids::panelModulatorListCsvDelimiter, ",");
	setProperty (Ids::panelModulatorListXmlRoot, "ctrlrModulatorList");
	setProperty (Ids::panelModulatorListXmlModulator, "ctrlrModulator");
	setProperty (Ids::panelModulatorListSortOption, true);
	setProperty (Ids::panelGlobalVariables, "-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1:-1");
	setProperty (Ids::panelResources, COMBO_ITEM_NONE);
	setProperty (Ids::panelPropertyDisplayIDs, false);

	setProperty (Ids::ctrlrMenuItemBackgroundColour, 		Colours::white.toString());
	setProperty (Ids::ctrlrMenuItemTextColour, 				Colours::black.toString());
	setProperty (Ids::ctrlrMenuItemHighlightedTextColour, 	Colours::white.toString());
	setProperty (Ids::ctrlrMenuItemHighlightColour, 		Colour(HIGHLIGHT_COLOUR).toString());
	setProperty (Ids::ctrlrMenuItemFont, 					String::empty);
	setProperty (Ids::ctrlrMenuItemSeparatorColour,			Colour (0x44000000).toString());
	setProperty (Ids::ctrlrMenuItemHeaderColour,			Colours::black.toString());

	setProperty (Ids::ctrlrMenuBarBackgroundColour1, 		Colour(0xfff7f7f7).toString());
	setProperty (Ids::ctrlrMenuBarBackgroundColour2, 		Colour(0xffcccccc).toString());
	setProperty (Ids::ctrlrMenuBarTextColour, 				Colours::black.toString());
	setProperty (Ids::ctrlrMenuBarHighlightedTextColour, 	Colours::white.toString());
	setProperty (Ids::ctrlrMenuBarHighlightColour, 			Colour(HIGHLIGHT_COLOUR).toString());
	setProperty (Ids::ctrlrMenuBarFont, 					String::empty);
	setProperty (Ids::ctrlrUseEditorWrapper, false);

	owner.addChangeListener (this);
	midiMessageCollector.reset (SAMPLERATE);

	midiInputThread.startThread(5);
	midiControllerInputThread.startThread(5);
}
示例#14
0
Value Project::Item::getShouldCompileValue()                { return state.getPropertyAsValue (Ids::compile, getUndoManager()); }
示例#15
0
Value Project::Item::getShouldAddToResourceValue()          { return state.getPropertyAsValue (Ids::resource, getUndoManager()); }
示例#16
0
void Project::Item::sortAlphabetically (bool keepGroupsAtStart)
{
    sortGroup (state, keepGroupsAtStart, getUndoManager());
}
示例#17
0
Value EnabledModuleList::getShouldUseGlobalPathValue (const String& moduleID) const
{
    return state.getChildWithProperty (Ids::ID, moduleID)
                .getPropertyAsValue (Ids::useGlobalPath, getUndoManager());
}
示例#18
0
void EnabledModuleList::sortAlphabetically()
{
    ModuleTreeSorter sorter;
    state.sort (sorter, getUndoManager(), false);
}
示例#19
0
void Project::Item::sortAlphabetically()
{
    ItemSorter sorter;
    node.sort (sorter, getUndoManager(), true);
}
示例#20
0
Value EnabledModuleList::shouldNotOverwriteModuleCodeOnSave (const String& moduleID)
{
    return state.getChildWithProperty (Ids::ID, moduleID)
                .getPropertyAsValue (Ids::overwriteOnSave, getUndoManager());
}
示例#21
0
Value EnabledModuleList::shouldShowAllModuleFilesInProject (const String& moduleID)
{
    return state.getChildWithProperty (Ids::ID, moduleID)
                .getPropertyAsValue (Ids::showAllCode, getUndoManager());
}
示例#22
0
Value Project::Item::getName() const
{
    return node.getPropertyAsValue (Ids::name, getUndoManager());
}
示例#23
0
void Project::Item::removeItemFromProject()
{
    state.getParent().removeChild (state, getUndoManager());
}
示例#24
0
void JucerDocument::beginTransaction (const String& name)
{
    getUndoManager().beginNewTransaction (name);
}
示例#25
0
Value Project::Item::getNameValue()
{
    return state.getPropertyAsValue (Ids::name, getUndoManager());
}
示例#26
0
Value EnabledModuleList::shouldCopyModuleFilesLocally (const String& moduleID) const
{
    return state.getChildWithProperty (Ids::ID, moduleID)
                .getPropertyAsValue (Ids::useLocalCopy, getUndoManager());
}
示例#27
0
void Project::Item::addChild (const Item& newChild, int insertIndex)
{
    state.addChild (newChild.state, insertIndex, getUndoManager());
}
示例#28
0
void Project::Item::addChild (const Item& newChild, int insertIndex)
{
    node.addChild (newChild.getNode(), insertIndex, getUndoManager());
}
示例#29
0
void JucerDocument::beginTransaction()
{
    getUndoManager().beginNewTransaction();
}
示例#30
0
void CtrlrPanel::redo()
{
	getUndoManager()->redo();
}