Пример #1
0
AudioConfigurationWindow::AudioConfigurationWindow(AudioDeviceManager& adm, Button* cButton)
    : DocumentWindow("Audio Settings",
                     Colours::red,
                     DocumentWindow::closeButton),
    controlButton(cButton)

{
    centreWithSize(360,300);
    setUsingNativeTitleBar(true);
    setResizable(false,false);

    //std::cout << "Audio CPU usage:" << adm.getCpuUsage() << std::endl;

    AudioDeviceSelectorComponent* adsc = new AudioDeviceSelectorComponent
    (adm,
     0, // minAudioInputChannels
     2, // maxAudioInputChannels
     0, // minAudioOutputChannels
     2, // maxAudioOutputChannels
     false, // showMidiInputOptions
     false, // showMidiOutputSelector
     false, // showChannelsAsStereoPairs
     false); // hideAdvancedOptionsWithButton

    adsc->setBounds(0,0,450,240);

    setContentOwned(adsc, true);
    setVisible(false);
    //setContentComponentSize(getWidth(), getHeight());
}
Пример #2
0
MLAppWindow::MLAppWindow() :
	mpAppView(0),
	DocumentWindow (MLProjectInfo::projectName,
	  Colour::fromHSV(0.5f, 0.0f, 0.30f, 1.f),
	  DocumentWindow::allButtons,
	  true),
	mpConstrainer(0),
	mUsingGL(false),
	mGridUnitsX(0.),
	mGridUnitsY(0.)
{
    setResizable(true, false);
	setResizeLimits (400, 300, 8192, 8192);

    commandManager.registerAllCommandsForTarget (JUCEApplication::getInstance());
    
    // this lets the command manager use keypresses that arrive in our window to send
    // out commands
    addKeyListener (commandManager.getKeyMappings());
    
	mpBorder = std::unique_ptr<MLAppBorder>(new MLAppBorder());
    setContentOwned(mpBorder.get()->getComponent(), false);
	
	mpConstrainer = new MLBoundsConstrainer();
	setConstrainer (mpConstrainer);

	setUsingNativeTitleBar (true);
        
    // tells our menu bar model that it should watch this command manager for
    // changes, and send change messages accordingly.
    //&mBorder->setApplicationCommandManagerToWatch (&commandManager);

    //setVisible (true);
}
Пример #3
0
 MainWindow() : DocumentWindow("Arooo", Colours::lightgrey,
   DocumentWindow::closeButton | DocumentWindow::minimiseButton, true) {
   mainComponent = new MainComponent();
   setContentOwned(mainComponent, true);
   centreWithSize(getWidth(), getHeight());
   setVisible(true);
 }
Пример #4
0
 MainWindow() : DocumentWindow ("MainWindow", Colours::lightgrey, DocumentWindow::allButtons) 
 {
     setContentOwned (new MainComponent(), true);
     centreWithSize (getWidth(), getHeight());
     setResizable (true, true);
     setUsingNativeTitleBar (true);
 }
Пример #5
0
SettingsWindow::SettingsWindow ()
: DialogWindow (TRANS("Settings"),
                Colour (192,192,192),
                true,
                false) // do not add to desktop yet
{
  SettingsPanel* contentComp = new SettingsPanel;

  setOpaque (true);
  //setDropShadowEnabled (false);

  // iOS doesn't have a native title bar
  //setUsingNativeTitleBar (true);

  // must happen AFTER setUsingNativeTitleBar()
  Component::addToDesktop (getDesktopWindowStyleFlags());

  // must happen after addToDesktop()
  setContentOwned (contentComp, true);

  centreWithSize (getWidth(), getHeight());
  setVisible (true);

  enterModalState ();
}
Пример #6
0
MainDPCWindow::~MainDPCWindow()
{
    int		status;

    status = m_dpc.close();
    if (status != DPC_NO_ERROR)
    {
        DBG( String::formatted( "Unable to close DPC Checker (error: %d)", status ));
    }

    status = m_dpc.remove();
    if (status != DPC_NO_ERROR)
    {
        DBG( String::formatted( "Unable to uninstall DPC Checker (error: %d)", status ));
    }

    // setting our content component to 0 will delete the current one, and
    // that will in turn delete all its child components. You don't always
    // have to do this explicitly, because the base class's destructor will
    // also delete the content component, but in this case we need to
    // make sure our content comp has gone away before deleting our command
    // manager.
    setContentOwned( 0, false );
    delete commandManager;
}
Пример #7
0
//==============================================================================
MainWindow::MainWindow ()
    : DocumentWindow ("JSDSP",
      Colours::azure,
      DocumentWindow::allButtons,
      true)
{
    setResizable (true, true); // resizability is a property of ResizableWindow
    setResizeLimits (1200, 500, 1200, 500);

    setSize (1200, 500);

	setUsingNativeTitleBar(true);
	mainComponent = new MainComponent();
	setContentNonOwned(mainComponent, false);
	mainComponent->setVisible(true);
    mainComponent->setSize(this->getWidth(), this->getHeight());

#if HIDE
	MainMenuBar *menuBar = new MainMenuBar();
    setContentOwned (menuBar, false);

    // this tells the DocumentWindow to automatically create and manage a MenuBarComponent
    // which uses our contentComp as its MenuBarModel
    setMenuBar (menuBar);
#endif
}
Пример #8
0
//=================================================================================================
MainWindow::MainWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
                      Colours::lightgrey,
                      DocumentWindow::allButtons)
{   
    // 创建基础组件和读写文档的对象
    baseComponent = new BaseComponent();
    appDoc = LoadAndSaveDoc::getInstance();
    appDoc->addChangeListener(this);  // FileBasedDocument 对象绑定可变捕获器
    
    // 获取全局性的撤销管理器、命令管理器和程序属性
    undoManager     = AppSingleton::getInstance()->getUndoManager(); 
    commandManager  = AppSingleton::getInstance()->getCommandManager();
    appProperties   = AppSingleton::getInstance()->getAppProperties();
    
    // 注册命令目标
    commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance());
    commandManager->registerAllCommandsForTarget (this); 

    // 获取所有命令默认的快捷键
    commandManager->getKeyMappings()->resetToDefaultMappings();

    // 获取用户自定义的快捷键
    ScopedPointer<XmlElement> keys(appProperties->getUserSettings()->getXmlValue("keyMappings")); 

    if (keys != nullptr)        
        commandManager->getKeyMappings()->restoreFromXml(*keys);

    // 本类绑定按键捕获器
    addKeyListener (commandManager->getKeyMappings());

    // 设置本类的默认属性
    centreWithSize (1280, 800);
    setResizable(true, false);
    setResizeLimits(800, 600, 4096, 4096);
    setVisible (true);
    setUsingNativeTitleBar(true);

    // 主菜单随时关注命令的变化
    setApplicationCommandManagerToWatch(commandManager);

    // 设置主菜单  
#ifdef JUCE_MAC
    setMacMainMenu(this);
#else
    setMenuBar(this);   
#endif

    // 恢复上次退出时的窗口状态
    restoreWindowStateFromString(appProperties->getUserSettings()->getValue("mainWindowState"));
    setName(AppString::appNameOnTitleBar + TRANS("Untitled"));      // 设置标题栏默认显示的文本

    // 设置并添加基础组件
    baseComponent->setSize(getWidth(), getHeight());
    setContentOwned(baseComponent, false);  

    // 设置当前进程为高优先级
    Process::setPriority (Process::HighPriority);
}
Пример #9
0
 MainWindow (String name)  : DocumentWindow (name,Colour(0xff3f3f3f),DocumentWindow::allButtons)
 {
     setUsingNativeTitleBar (true);
     setContentOwned (new MainContentComponent(), true);
     LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV1);
     centreWithSize (getWidth(), getHeight());
     setVisible (true);
 }
Пример #10
0
ProcessesWindow::ProcessesWindow() : DocumentWindow("Processes", Colours::white, DocumentWindow::closeButton)
{
	processesComponent = new ProcessesComponent();
	setResizable(false, false);
	setContentOwned(processesComponent, true);
	centreWithSize(getWidth(), getHeight());
	setVisible(false);
}
Пример #11
0
MidiConfigurationWindow::MidiConfigurationWindow(MTCSender& mtcSender)
    : DialogWindow(TRANS("Configure MIDI"), Colours::lightgrey, true, true)
    , m_mtcSender(mtcSender)
{
    setContentOwned(new MidiConfigurationComponent(this, m_mtcSender.getDevice()), true);
    centreWithSize(getWidth(), getHeight());
    setVisible(true);
    setResizable(true, true);
}
Пример #12
0
 MainWindow()  : DocumentWindow ("FPT Analyzer 2.0",
                                 Colours::lightgrey,
                                 DocumentWindow::allButtons)
 {
     setContentOwned (new MainContentComponent(), true);
     Rectangle<int> r = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
     centreWithSize (r.getWidth(), r.getHeight());
     setVisible (true);
 }
Пример #13
0
    MainWindow(String name) : DocumentWindow(name, Colours::lightgrey,
                                             DocumentWindow::closeButton) {
      setUsingNativeTitleBar(true);
      setContentOwned(new HelmStandaloneEditor(), true);
      setResizable(true, true);

      centreWithSize(getWidth(), getHeight());
      setVisible(true);
    }
Пример #14
0
  CContourPickerDialog ()
    : DocumentWindow ("Edit Contour", Colours::grey, DocumentWindow::closeButton, true)
  {
    CContourCurveEditor* c = new CContourCurveEditor;
    setContentOwned (c, true);

    centreWithSize (getWidth(), getHeight());
    setVisible (true);
  }
Пример #15
0
void MainWindow::createProjectContentCompIfNeeded()
{
    if (getProjectContentComponent() == nullptr)
    {
        clearContentComponent();
        setContentOwned (new ProjectContentComponent(), false);
        jassert (getProjectContentComponent() != nullptr);
    }
}
Пример #16
0
void MainWindow::showNewProjectWizard()
{
    jassert (currentProject == nullptr);
    setContentOwned (createNewProjectWizardComponent(), true);
    centreWithSize (900, 630);
    setVisible (true);
    addToDesktop();
    getContentComponent()->grabKeyboardFocus();
}
        MainWindow()  : DocumentWindow ("MainWindow",
                                        Colours::lightgrey,
                                        DocumentWindow::allButtons)
        {
            setContentOwned (new MainContentComponent(), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
Пример #18
0
        MainWindow (String name)
            : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MPETestClasses::MainComponent(), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
Пример #19
0
//==============================================================================
MainWindow::MainWindow()
    : DocumentWindow ("The Jucer",
                      Colours::azure,
                      DocumentWindow::allButtons)
{
    if (oldLook == 0)
        oldLook = new OldSchoolLookAndFeel();

    setContentOwned (multiDocHolder = new MultiDocHolder(), false);

    setApplicationCommandManagerToWatch (commandManager);

   #if JUCE_MAC
    setMacMainMenu (this);
   #else
    setMenuBar (this);
   #endif

    setResizable (true, false);

    centreWithSize (700, 600);

    // restore the last size and position from our settings file..
    restoreWindowStateFromString (StoredSettings::getInstance()->getProps()
                                    .getValue ("lastMainWindowPos"));

    // Register all the app commands..
    {
        commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance());
        commandManager->registerAllCommandsForTarget (this);

        // use a temporary one of these to harvest its commands..
        JucerDocumentHolder tempDesignHolder (ObjectTypes::createNewDocument (0));
        commandManager->registerAllCommandsForTarget (&tempDesignHolder);
    }

    commandManager->getKeyMappings()->resetToDefaultMappings();

    XmlElement* const keys = StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings");

    if (keys != 0)
    {
        commandManager->getKeyMappings()->restoreFromXml (*keys);
        delete keys;
    }

    addKeyListener (commandManager->getKeyMappings());

    // don't want the window to take focus when the title-bar is clicked..
    setWantsKeyboardFocus (false);

   #ifndef JUCE_DEBUG
    // scan for fonts before the app gets started rather than glitching later
    FontPropertyComponent::preloadAllFonts();
   #endif
}
Пример #20
0
//==============================================================================
MainAppWindow::MainAppWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
                      Colours::lightgrey,
                      DocumentWindow::allButtons)
{
    setContentOwned(new MainComponent(), false);

	centreWithSize (400, 200);
    setVisible (true);	
}
Пример #21
0
        AserveWindow (String name, Audio& audio)  :     DocumentWindow (name,
                    Colours::lightgrey,
                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new AserveComponent (audio), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
Пример #22
0
 MainWindow()  : DocumentWindow (ProjectInfo::projectName,
                                 Colours::lightgrey,
                                 DocumentWindow::allButtons)
 {
     setUsingNativeTitleBar (true);
     setContentOwned (new StringDemoComponent(), true);
     setResizable (true, false);
     centreWithSize (getWidth(), getHeight());
     setVisible (true);
 }
        MainWindow (String name)  : DocumentWindow (name,
                                                    Colours::lightgrey,
                                                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new CONTENTCOMPCLASS(), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
Пример #24
0
        MainWindow()  : DocumentWindow ("Roomote",
                                        Colours::black,
                                        0)
        {
            setContentOwned (new MainContentComponent(), false);

            setTitleBarHeight(0);
            centreWithSize (322, 242); // Not sure why 2 more pixels need to be added
            setVisible (true);
        }
Пример #25
0
        MainWindow (const String& name)
            : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (createMainContentComponent(), true);
            setResizable (true, true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
void StandaloneFilterWindow::loadFile(String filename)
{
    File file(filename);
    pluginHolder->stopPlaying();
    pluginHolder->reloadAudioDeviceState();
    deleteEditorComp();
    pluginHolder->deletePlugin();

    if(file.existsAsFile())
    {
        //cUtils::showMessage(file.loadFileAsString());
        float originalPluginWidth=100;
        float originalPluginHeight=100;
        StringArray csdArray;
        csdArray.addLines(file.loadFileAsString());
        for(int i=0; i<csdArray.size(); i++)
        {
            if(csdArray[i].contains("form "))
            {
                CabbageGUIType cAttr(csdArray[i], -99);
                originalPluginWidth = cAttr.getNumProp(CabbageIDs::width);
                originalPluginHeight = cAttr.getNumProp(CabbageIDs::height);
                this->getProperties().set("colour", cAttr.getStringProp(CabbageIDs::colour));
                this->lookAndFeelChanged();
            }
        }

        Point<float> scale;

        if(originalPluginWidth>=originalPluginHeight)
        {
            scale = Point<float>(desktopRect.getWidth()/originalPluginWidth,
                                 (desktopRect.getHeight()/originalPluginHeight)*.95);
        }
        else
        {
            scale = Point<float>(desktopRect.getHeight()/originalPluginHeight,
                                 (desktopRect.getHeight()/originalPluginHeight)*.95);
        }

        pluginHolder->createPlugin(file.getFullPathName(), scale);
        AudioProcessorEditor* ed = createEditorComp();
        setContentOwned(ed, true);
        //createEditorComp();

        ed->setSize(desktopRect.getWidth(), desktopRect.getHeight());
        //this->resized();

        setName(pluginHolder->processor->getName());
        pluginHolder->startPlaying();

    }

}
MainWindow::MainWindow() :
    juce::DocumentWindow ("Friendly Binary Builder",
                          juce::Colours::darkgrey,
                          juce::DocumentWindow::closeButton)
{
    setUsingNativeTitleBar (true);
    setContentOwned (new MainComponent(), true);

    centreWithSize (getWidth(), getHeight());
    setVisible (true);
}
Пример #28
0
        MainWindow (String name, const PropertiesFile::Options & options) :
			DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons),
			main_content_(options)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (&main_content_, true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
			setResizable(true, true);
        }
Пример #29
0
        MainWindow (String name)  : DocumentWindow (name,
                                                    LookAndFeel::getDefaultLookAndFeel()
                                                                 .findColour (ResizableWindow::backgroundColourId),
                                                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MainContentComponent(), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
Пример #30
0
		MainWindow(String name) : DocumentWindow(name,
			Colours::lightgrey,
			DocumentWindow::minimiseButton |
			DocumentWindow::closeButton)
		{
			setUsingNativeTitleBar(true);
			setContentOwned(new MainContentComponent(), true);

			centreWithSize(getWidth(), getHeight());
			setVisible(true);
		}