Ejemplo n.º 1
0
/// Static helper function to create a dialog window for validation
/// settings.
///
/// @param pluginEditor audio plug-in editor
///
/// @param audioProcessor audio processor
///
/// @return created dialog window
///
DialogWindow *WindowValidationContent::createDialogWindow(
    AudioProcessorEditor *pluginEditor,
    KmeterAudioProcessor *audioProcessor)

{
    // prepare dialog window
    DialogWindow::LaunchOptions windowValidationLauncher;

    // create content component
    WindowValidationContent *contentComponent =
        new WindowValidationContent(audioProcessor);

    // initialise dialog window settings
    windowValidationLauncher.dialogTitle = String("Validation");
    windowValidationLauncher.dialogBackgroundColour = Colours::white;
    windowValidationLauncher.content.setOwned(contentComponent);
    windowValidationLauncher.componentToCentreAround = pluginEditor;

    windowValidationLauncher.escapeKeyTriggersCloseButton = true;
    windowValidationLauncher.useNativeTitleBar = false;
    windowValidationLauncher.resizable = false;
    windowValidationLauncher.useBottomRightCornerResizer = false;

    // launch dialog window
    DialogWindow *windowValidation = windowValidationLauncher.launchAsync();
    windowValidation->setAlwaysOnTop(true);

    return windowValidation;
}
Ejemplo n.º 2
0
void ProjucerApplication::showLoginForm()
{
    if (ProjucerLicences::getInstance()->isDLLPresent())
    {
        jassert (MessageManager::getInstance()->isThisTheMessageThread());

        if (loginForm != nullptr)
            return;

        DialogWindow::LaunchOptions lo;

        lo.dialogTitle = "Log-in to Projucer";
        lo.dialogBackgroundColour = Colour (0xffdddddd);
        lo.content.setOwned (loginForm = new LoginForm());
        lo.escapeKeyTriggersCloseButton = true;
        lo.componentToCentreAround = nullptr;
        lo.escapeKeyTriggersCloseButton = true;
        lo.resizable = false;
        lo.useBottomRightCornerResizer = false;
        lo.useNativeTitleBar = true;

        lo.launchAsync();

        getGlobalProperties().setValue ("lastLoginAttemptTime",
                                        (int) (Time::getCurrentTime().toMilliseconds() / 1000));
    }
}
Ejemplo n.º 3
0
//==============================================================================
void TestComponent::showInDialogBox (JucerDocument& document)
{
    DialogWindow::LaunchOptions o;
    o.content.setOwned (new TestComponent (nullptr, document.createCopy(), true));
    o.dialogTitle                   = "Testing: " + document.getClassName();
    o.dialogBackgroundColour        = Colours::azure;
    o.escapeKeyTriggersCloseButton  = true;
    o.useNativeTitleBar             = false;
    o.resizable                     = true;

    o.launchAsync();
}
//==============================================================================
void PreferencesPanel::showInDialogBox (const String& dialogTitle, int dialogWidth, int dialogHeight, Colour backgroundColour)
{
    setSize (dialogWidth, dialogHeight);

    DialogWindow::LaunchOptions o;
    o.content.setNonOwned (this);
    o.dialogTitle                   = dialogTitle;
    o.dialogBackgroundColour        = backgroundColour;
    o.escapeKeyTriggersCloseButton  = false;
    o.useNativeTitleBar             = false;
    o.resizable                     = false;

    o.launchAsync();
}
void CtrlrPanelResourceEditor::showResourceInfo(const int resourceIndex)
{
	CtrlrPanelResource *res = resources[resourceIndex];
	if (res == nullptr)
		return;

	String message;
	message << "Load time: " + res->getLoadedTime().toString(true, true, true, true) + "\n";
	message << "Data file: " + res->getFile().getFullPathName() + "\n";
	message << "Source file: " + res->getSourceFile().getFullPathName() + "\n";
	message << "Source hash: " + STR(res->getHashCode()) + "\n";
	AudioFormatReader *afr = res->asAudioFormat();
	if (afr)
	{
		message << "Type: Audio\n";
		message << "Format name: " << afr->getFormatName() << "\n";
		message << "Sample rate: " << afr->sampleRate << "\n";
		message << "Bits per sample: " << ((int)afr->bitsPerSample) << "\n";
		message << "Length in samples: " << afr->lengthInSamples << "\n";
		message << "Number of channels: " << ((int)afr->numChannels) << "\n";
		message << "Metadata:\n";
		message << "\t" << afr->metadataValues.getDescription();
	}


	if (!res->asImage().isNull())
	{
		Image i = res->asImage();
		message << "Type: Image\n";
		message << "Width: " + STR(i.getWidth()) + "\n";
		message << "Height: " + STR(i.getHeight()) + "\n";
		message << "Has alpha: " + STR(i.hasAlphaChannel()) + "\n";
	}

	DialogWindow::LaunchOptions lo;
	Label *l = new Label ("", message);
	l->setSize (400, 150);
	l->setJustificationType (Justification::centred);
	l->setFont (Font(12.0f));
	lo.content.set(l, true);
	lo.componentToCentreAround		= this;
	lo.dialogBackgroundColour		= Colours::whitesmoke;
	lo.dialogTitle					= "Resource information";
	lo.resizable					= true;
	lo.useBottomRightCornerResizer	= false;
	lo.useNativeTitleBar			= true;
	lo.launchAsync();
}
Ejemplo n.º 6
0
bool CodeWindow::perform (const InvocationInfo& info)
{
	Logger::writeToLog(String(info.commandID));
	//---------------------------------------------------------------------------------------------
	if(info.commandID==CommandIDs::fileNew)
		{		
			String tempFile = File::getSpecialLocation(File::userHomeDirectory).getFullPathName()+"/liveCodeSession.csd";
			Logger::writeToLog(tempFile);
			csdFile = tempFile;
			csoundDoc.replaceAllContent(csdFile.loadFileAsString());			
			toggleTextWindows();
		}
	else if(info.commandID==CommandIDs::fileSave)
		{
			Logger::writeToLog("fileSaved");
			sendActionMessage("fileSaved");
		}
	else if(info.commandID==CommandIDs::fileSaveAs)
		{
			Logger::writeToLog("fileSaveAs");
			sendActionMessage("fileSaveAs");
		}
	else if(info.commandID==CommandIDs::fileOpen)
		{			
			Logger::writeToLog("fileOpen");
			sendActionMessage("fileOpen");
		}
	else if(info.commandID==CommandIDs::AudioSettings)
		{			
			sendActionMessage("audioSettings");
		}
	else if(info.commandID==CommandIDs::fileQuit)
		{			
		JUCEApplication::getInstance()->systemRequestedQuit();	
		}
		
	else if(info.commandID==CommandIDs::editUndo)
		{			
			textEditor->undo();
		}
		
	else if(info.commandID==CommandIDs::fileKeyboardShorts)
		{				
			DialogWindow::LaunchOptions o;
			o.content.setOwned(new ShortcutsPanel());
			o.dialogTitle                   = TRANS("Keyboard Shortcuts");
			o.dialogBackgroundColour        = Colours::black;
			o.resizable                     = false;
			o.useNativeTitleBar				= false;
			o.escapeKeyTriggersCloseButton  = true;
			//o.content->setLookAndFeel(&this->getLookAndFeel());
			o.launchAsync();			
		}
		
	else if(info.commandID==CommandIDs::editCut)
		{			
			textEditor->cutToClipboard();
		}
	else if(info.commandID==CommandIDs::editCopy)
		{			
			textEditor->copyToClipboard();
		}
	else if(info.commandID==CommandIDs::editPaste)
		{			
			textEditor->pasteFromClipboard();
		}

	else if(info.commandID==CommandIDs::editRedo)
		{			
			textEditor->redo();
		}
	else if(info.commandID==CommandIDs::editToggleText)
		{			
		toggleTextWindows();
		}
		
	else if(info.commandID==CommandIDs::editZoomIn)
		{			
			setFontSize("in");
		}
	else if(info.commandID==CommandIDs::editZoomOut)
		{			
			setFontSize("out");
		}
	else if(info.commandID==CommandIDs::whiteBackground)
		{			
		setEditorColourScheme("white");
		}

	else if(info.commandID==CommandIDs::blackBackground)
		{			
		setEditorColourScheme("dark");
		}

	else if(info.commandID==CommandIDs::insertRecentEvent)
		{
			
		}
	else if(info.commandID==CommandIDs::insertFromRepo)
		{			
		popupDisplay->setVisible(false);
		CodeWindow::insertFromRepo();
		}

	else if(info.commandID==CommandIDs::openPythonEditor)
		{	
		/*if(pythonEditor==nullptr){
			pythonEditor = new PythonEditor("Python Editor");
			//pythonEditor->textEditor->setLookAndFeel(lookAndFeel);
			//pythonEditor->setLookAndFeel(lookAndFeel);
			pythonEditor->addActionListener(this);
			pythonEditor->setAlwaysOnTop(true);
			pythonEditor->setVisible(true);
			pythonEditor->textEditor->setColour(CodeEditorComponent::backgroundColourId, Colour::fromRGB(40, 40, 40));
		}
		
		pythonEditor->toFront(true);
		cabbageTimer->startTimedEvent(1, "pythonFocus");
		//pythonEditor->textEditor->highlightLine("oscil 1");
		
		 */
		}	
		
	else if(info.commandID==CommandIDs::addFromRepo)
		{	
		textEditor->addToRepository();
		}	

	else if(info.commandID==CommandIDs::viewCsoundHelp)
		{
		toggleManuals("Csound");
		}
	
	else if(info.commandID==CommandIDs::viewCabbageHelp)
		{
		toggleManuals("Cabbage");
		}
				
return true;
}