Ejemplo n.º 1
0
StandaloneFilterWindow *SqueezerStandalone::createWindow()
{
    // load settings of stand-alone; this includes the directory in
    // which the current state is to be stored
    PropertiesFile::Options settings;

#ifdef SQUEEZER_MONO
    settings.applicationName     = "squeezer_mono";
#else
    settings.applicationName     = "squeezer_stereo";
#endif

    settings.filenameSuffix      = "ini";
    settings.folderName          = ".config";
    settings.osxLibrarySubFolder = "Application Support";

    PropertiesFile *propertiesFile = new PropertiesFile(settings);

    // instantiate GUI
    StandaloneFilterWindow *filterWindow = new StandaloneFilterWindow(
        getApplicationName(),
        Colours::lightgrey,
        propertiesFile,
        true);

    // GUI cannot be resized
    filterWindow->setResizable(false, true);

    return filterWindow;
}
	    void initialise (const String& commandLine)
	    {
			ApplicationProperties::getInstance()->setStorageParameters(T("bitMangler"),T(".options"),T("settings"),250,PropertiesFile::storeAsXML);
			wnd = new StandaloneFilterWindow(T("bitMangler"), Colours::white);

			wnd->centreWithSize (380, 155+28);
			wnd->setVisible (true);
		}
void HostFilterComponent::setCurrentSessionFile(const File& newFile)
{
   currentSessionFile = newFile;
   StandaloneFilterWindow* window = findParentComponentOfClass ((StandaloneFilterWindow*) 0);
   if (window)
   {
     String jostMainWindowName;
     String filename = currentSessionFile.getFileNameWithoutExtension();
     jostMainWindowName << JucePlugin_Name;
     if (!filename.isEmpty())
        jostMainWindowName << " - " << filename;
     window->setName(jostMainWindowName);
   }
}
Ejemplo n.º 4
0
// ButtonListener methods
void TransportComponent::buttonClicked (Button* button)
{
	if (button == playButton) {
		CustomPlayHead* customPlayHead = getPlayHead();
		if (customPlayHead->isPlaying()) {
			customPlayHead->stop();
			playButton->setButtonText ("Play");
		} else {
			customPlayHead->play();
			playButton->setButtonText ("Stop");
		}
	} else if (button == setupButton) {
		StandaloneFilterWindow* standaloneFilterWindow = (StandaloneFilterWindow*) getPeer()->getComponent();
		if (standaloneFilterWindow != 0) {
			standaloneFilterWindow->showAudioSettingsDialog();
		}
	}
}
bool HostFilterComponent::perform (const InvocationInfo& info)
{
    Config* config = Config::getInstance();

    GraphComponent* graph = main->getGraph ();
    Transport* transport = getFilter()->getTransport();

    switch (info.commandID)
    {
    //----------------------------------------------------------------------------------------------
    case CommandIDs::pluginOpen:
        {
            graph->loadAndAppendPlugin ();
            break;
        }
    case CommandIDs::pluginClose:
        {
            graph->closeSelectedPlugins ();
            break;
        }
    case CommandIDs::pluginClear:
        {
            graph->closeAllPlugins ();
            break;
        }
    case CommandIDs::showPluginListEditor:
        {
           if (PluginListWindow::currentPluginListWindow == 0)
               PluginListWindow::currentPluginListWindow = new PluginListWindow (knownPluginList);

           PluginListWindow::currentPluginListWindow->toFront (true);
            
            break;
        }

    //----------------------------------------------------------------------------------------------
#ifndef JOST_VST_PLUGIN
    case CommandIDs::audioOptions:
        {
            StandaloneFilterWindow* window = findParentComponentOfClass ((StandaloneFilterWindow*) 0);
            if (window)
                window->showAudioSettingsDialog ();

            break;
        }
#endif

    case CommandIDs::audioPlay:
        {
            transport->play ();
            break;
        }
    case CommandIDs::audioPlayPause:
        {
            transport->togglePlay ();
            break;
        }
    case CommandIDs::audioStop:
        {
            transport->stop ();
            break;
        }
    case CommandIDs::audioRecord:
        {
            transport->record ();
            break;
        }
    case CommandIDs::audioRewind:
        {
            transport->rewind ();
            break;
        }
    case CommandIDs::audioLoop:
        {
            transport->setLooping (! transport->isLooping());
            break;
        }

    //----------------------------------------------------------------------------------------------
    case CommandIDs::sessionNew:
        {
           bool retValue = 
               AlertWindow::showYesNoCancelBox (AlertWindow::WarningIcon,
                                             T("Unsaved Changes"),
                                             T("Are you sure you want to close the current session? You may lose any unsaved changes."));
            if (retValue)
            {
               closePluginEditorWindows ();
               getFilter()->getHost ()->closeAllPlugins (true);

               clearComponents ();
               Config::getInstance()->lastSessionFile = File::nonexistent;
               rebuildComponents ();
            }
            break;
        }
    
    case CommandIDs::sessionLoad:
        {
            FileChooser myChooser (T("Load a session file..."),
                                    Config::getInstance ()->lastSessionDirectory,
                                    JOST_SESSION_WILDCARD, JOST_USE_NATIVE_FILE_CHOOSER);

            if (myChooser.browseForFileToOpen())
            {
              bool retValue = 
               AlertWindow::showYesNoCancelBox (AlertWindow::WarningIcon,
                                             T("Unsaved Changes"),
                                             T("Are you sure you want to close the current session? You may lose any unsaved changes."));
               if (retValue)
               {

                MemoryBlock fileData;
                File fileToLoad = myChooser.getResult();

                if (fileToLoad.existsAsFile()
                    && fileToLoad.loadFileAsData (fileData))
                {
                    getFilter ()->setStateInformation (fileData.getData (), fileData.getSize());

                    Config::getInstance()->addRecentSession (fileToLoad);
                    Config::getInstance()->lastSessionFile = fileToLoad;
                }
               }
            }
            break;
        }
    case CommandIDs::sessionSave:
        {
            handleSaveCommand();
            break;
        }
    case CommandIDs::sessionSaveNoPrompt:
        {
            handleSaveCommand(true);
            break;
        }

    case CommandIDs::audioStemsStartStop:
        {
            getHost()->toggleStemRendering();
            break;
        }
    case CommandIDs::audioStemsSetup:
        {
            FileChooser myChooser (T("Save Rendered Stem Files To..."),
                                    Config::getInstance ()->lastStemsDirectory);
            if (myChooser.browseForDirectory ())
            {
                Config::getInstance ()->lastStemsDirectory = myChooser.getResult();
            }
            break; 
        }

    //----------------------------------------------------------------------------------------------
    case CommandIDs::appToolbar:
        {
            toolbar->showCustomisationDialog (*factory,
                                              Toolbar::allCustomisationOptionsEnabled);
                                              // (Toolbar::allowIconsOnlyChoice | Toolbar::showResetToDefaultsButton));
            break;
        }
    case CommandIDs::appBrowser:
        {
            setBrowserVisible (! config->showBrowser, config->browserLeft);
            break;
        }
    case CommandIDs::appFullScreen:
        {
            DocumentWindow* window = findParentComponentOfClass <DocumentWindow> ();
            if (window) {
                window->setFullScreen (! window->isFullScreen ());
                window->setMenuBar (window->isFullScreen () ? 0 : this);
            }
            break;
        }
    case CommandIDs::appExit:
        {
            deleteAndZero(PluginListWindow::currentPluginListWindow);
            JUCEApplication::getInstance()->systemRequestedQuit();
            break;
        }
    case CommandIDs::appAbout:
        {
//            Image* splashImage = ImageCache::getFromMemory (Resource::jost_about,
//                                                            Resource::jost_about_size);
         // todo: move appResourcesFolder() to somewhere everyone can use it
#if JUCE_MAC
			File appResourcesFolder(File::getSpecialLocation(File::currentApplicationFile).getChildFile("./Contents/Resources"));
#else
			File appResourcesFolder(File::getSpecialLocation(File::currentApplicationFile).getParentDirectory());
#endif
			File splashImageFile(appResourcesFolder.getChildFile("JiveAbout.png"));
            Image* splashImage = ImageFileFormat::loadFrom(splashImageFile);
            SplashScreen* splash = new SplashScreen();
            splash->show (T(JucePlugin_Name), splashImage, 3500, false);
            break;
        }

    //----------------------------------------------------------------------------------------------
    default:
        return false;
    }

    return true;
}