Example #1
0
    void getAllCommands (Array<CommandID>& commands) override
    {
        // this returns the set of all commands that this target can perform..
        const CommandID ids[] = { MainAppWindow::showPreviousDemo,
                                  MainAppWindow::showNextDemo,
                                  MainAppWindow::welcome,
                                  MainAppWindow::componentsAnimation,
                                  MainAppWindow::componentsDialogBoxes,
                                  MainAppWindow::componentsKeyMappings,
                                  MainAppWindow::componentsMDI,
                                  MainAppWindow::componentsPropertyEditors,
                                  MainAppWindow::componentsTransforms,
                                  MainAppWindow::componentsWebBrowsers,
                                  MainAppWindow::componentsWidgets,
                                  MainAppWindow::useLookAndFeelV1,
                                  MainAppWindow::useLookAndFeelV2,
                                  MainAppWindow::useLookAndFeelV3,
                                  MainAppWindow::toggleRepaintDebugging,
                                 #if ! JUCE_LINUX
                                  MainAppWindow::goToKioskMode,
                                 #endif
                                  MainAppWindow::useNativeTitleBar
                                };

        commands.addArray (ids, numElementsInArray (ids));

        const CommandID engineIDs[] = { MainAppWindow::renderingEngineOne,
                                        MainAppWindow::renderingEngineTwo,
                                        MainAppWindow::renderingEngineThree };

        StringArray renderingEngines (MainAppWindow::getMainAppWindow()->getRenderingEngines());
        commands.addArray (engineIDs, renderingEngines.size());
    }
Example #2
0
File LoadSave::getPatchFile(int bank_index, int folder_index, int patch_index) {
  static const FileSorterAscending file_sorter;

  File bank_directory = getBankDirectory();
  Array<File> banks;
  bank_directory.findChildFiles(banks, File::findDirectories, false);
  banks.sort(file_sorter);

  if (banks.size() == 0)
    return File();

  if (bank_index >= 0) {
    File bank = banks[std::min(bank_index, banks.size() - 1)];
    banks.clear();
    banks.add(bank);
  }

  Array<File> folders;
  for (File bank : banks) {
    Array<File> bank_folders;
    bank.findChildFiles(bank_folders, File::findDirectories, false);
    bank_folders.sort(file_sorter);
    folders.addArray(bank_folders);
  }

  if (folders.size() == 0)
    return File();

  if (folder_index >= 0) {
    File folder = folders[std::min(folder_index, folders.size() - 1)];
    folders.clear();
    folders.add(folder);
  }

  Array<File> patches;
  for (File folder : folders) {
    Array<File> folder_patches;
    folder.findChildFiles(folder_patches, File::findFiles, false,
                          String("*.") + mopo::PATCH_EXTENSION);
    folder_patches.sort(file_sorter);
    patches.addArray(folder_patches);
  }

  if (patches.size() == 0 || patch_index < 0)
    return File();

  return patches[std::min(patch_index, patches.size() - 1)];
}
Example #3
0
 Array<double> getAvailableSampleRates() override
 {
     Array<double> rates;
     const double _rates[] = { 44100.0, 48000.0 };
     rates.addArray(_rates, 2);
     return rates;
 }
Example #4
0
void MainContentComponent::getAllCommands (Array <CommandID>& commands)
{
    // this returns the set of all commands that this target can perform..
    const CommandID ids[] = { newProject, quickSave, quickLoad, openProject};

    commands.addArray (ids, numElementsInArray (ids));
}
Example #5
0
    void getAllCommands (Array <CommandID>& commands)
    {
        // this returns the set of all commands that this target can perform..
        const CommandID ids[] = { showRendering,
                                  showFontsAndText,
                                  showWidgets,
                                  showThreading,
                                  showTreeView,
                                  showTable,
                                  showAudio,
                                  showDragAndDrop,
                                  showOpenGL,
                                  showQuicktime,
                                  showDirectShow,
                                  showCamera,
                                  showWebBrowser,
                                  showCodeEditor,
                                  showInterprocessComms,
                                  setDefaultLookAndFeel,
                                  setOldSchoolLookAndFeel,
                                  useNativeTitleBar
                                 #if JUCE_MAC
                                  , useNativeMenus
                                 #endif

                                 #if ! JUCE_LINUX
                                  , goToKioskMode
                                 #endif
        };

        commands.addArray (ids, numElementsInArray (ids));
    }
void ProjectContentComponent::getAllCommands (Array <CommandID>& commands)
{
    const CommandID ids[] = { CommandIDs::saveProject,
                              CommandIDs::closeProject,
                              CommandIDs::saveDocument,
                              CommandIDs::saveDocumentAs,
                              CommandIDs::closeDocument,
                              CommandIDs::goToPreviousDoc,
                              CommandIDs::goToNextDoc,
                              CommandIDs::goToCounterpart,
                              CommandIDs::showProjectSettings,
                              CommandIDs::showProjectTab,
                              CommandIDs::showBuildTab,
                              CommandIDs::showFileExplorerPanel,
                              CommandIDs::showModulesPanel,
                              CommandIDs::showExportersPanel,
                              CommandIDs::showExporterSettings,
                              CommandIDs::openInIDE,
                              CommandIDs::saveAndOpenInIDE,
                              CommandIDs::createNewExporter,
                              CommandIDs::deleteSelectedItem,
                              CommandIDs::showTranslationTool,
                              CommandIDs::cleanAll,
                              CommandIDs::toggleBuildEnabled,
                              CommandIDs::buildNow,
                              CommandIDs::toggleContinuousBuild,
                              CommandIDs::launchApp,
                              CommandIDs::killApp,
                              CommandIDs::reinstantiateComp,
                              CommandIDs::showWarnings,
                              CommandIDs::nextError,
                              CommandIDs::prevError };

    commands.addArray (ids, numElementsInArray (ids));
}
// this returns the set of all commands that this target can perform..
void HostFilterComponent::getAllCommands (Array <CommandID>& commands)
{
    const CommandID ids[] = {
                                CommandIDs::pluginOpen,
                                CommandIDs::pluginClose,
                                CommandIDs::pluginClear,
                                CommandIDs::showPluginListEditor,
#ifndef JOST_VST_PLUGIN
                                CommandIDs::audioOptions,
#endif
                                CommandIDs::audioPlay,
                                CommandIDs::audioStop,
                                CommandIDs::audioRecord,
                                CommandIDs::audioRewind,
                                CommandIDs::audioLoop,
                                CommandIDs::audioPlayPause,
                                CommandIDs::audioStemsSetup,
                                CommandIDs::audioStemsStartStop,

                                CommandIDs::sessionNew,
                                CommandIDs::sessionLoad,
                                CommandIDs::sessionSave,
                                CommandIDs::sessionSaveNoPrompt,

                                CommandIDs::appToolbar,
                                CommandIDs::appBrowser,
                                CommandIDs::appFullScreen,
                                CommandIDs::appAbout,
                                CommandIDs::appExit
    };

    commands.addArray (ids, sizeof (ids) / sizeof (ids [0]));
}
Example #8
0
    void getLevels (int64 startSample, int numSamples, Array<float>& levels)
    {
        const ScopedLock sl (readerLock);

        if (reader == nullptr)
        {
            createReader();

            if (reader != nullptr)
            {
                lastReaderUseTime = Time::getMillisecondCounter();
                owner.cache.getTimeSliceThread().addTimeSliceClient (this);
            }
        }

        if (reader != nullptr)
        {
            float l[4] = { 0 };
            reader->readMaxLevels (startSample, numSamples, l[0], l[1], l[2], l[3]);

            levels.clearQuick();
            levels.addArray ((const float*) l, 4);

            lastReaderUseTime = Time::getMillisecondCounter();
        }
    }
Example #9
0
 Array<int> getAvailableBufferSizes() override
 {
     Array<int> sizes;
     const int _sizes[] = { 256, 512, 1024, 2048 };
     sizes.addArray(_sizes, 4);
     return sizes;
 }
Example #10
0
Array<int> getAsStackedChord(Array<int> &chord, bool reduce)
{
	Array<int> temp;
	if (reduce) {
		//remove duplicate notes
		for (int i=0;i<chord.size();i++) {
			temp.addIfNotAlreadyThere(chord[i]%12);
		}
		if (temp.size()==1)
			return temp;
	}
	else
		temp.addArray(chord);

	//sort 
	DefaultElementComparator<int> intsorter;
	temp.sort(intsorter);

	int Minimum = -1;
	//the base chord is the one with the minimal energy function
	//the energy function is the sum of the number of half steps between successive notes in the chord
	//hence, the canonic chord is the chord in which the notes lie as closely spaced as possible
	Array<PizChord> MinimumEnergyChordList;

	PizChord tempChord0(temp);
	//DBG("permutation: " + tempChord0.getStringPattern());
	Minimum = tempChord0.getSum();
	MinimumEnergyChordList.add(tempChord0);

	while(std::next_permutation(temp.begin(),temp.end()))
	{
		PizChord tempChord(temp);
		//DBG("permutation: " + tempChord.getStringPattern());
		int S = tempChord.getSum();
		if (S < Minimum || Minimum == -1) 
		{
			//new minimum found => discard what we found up to now
			Minimum = S;
			MinimumEnergyChordList.clear();
			MinimumEnergyChordList.add(tempChord);
		}
		else if (S==Minimum)
		{
			//another chord with minimum energy => add it to the list
			MinimumEnergyChordList.add(tempChord);
		}
	}
	//now we face a problem: multiple minimum energy chords can exist if more than 3 notes are present
	//we need a way of picking one chord that will always lead to the same interval pattern, no matter
	//what note names are used. Normal "sort" will sort alphabetically. This is unusable.
	//We need to sort on the interval patterns instead, but return the chord that corresponds to the pattern.
	DefaultElementComparator<PizChord> sorter;
	MinimumEnergyChordList.sort(sorter);
	//DBG("picked" + MinimumEnergyChordList.getFirst().getStringPattern());
	return MinimumEnergyChordList.getFirst().getChord();
}
Example #11
0
void MainWindow::getAllCommands (Array <CommandID>& commands)
{
    for (int i = 0; i < ObjectTypes::numDocumentTypes; ++i)
        commands.add (CommandIDs::newDocumentBase + i);

    const CommandID ids[] = { CommandIDs::open,
                              CommandIDs::showPrefs,
                              CommandIDs::useTabbedWindows };

    commands.addArray (ids, numElementsInArray (ids));
}
Example #12
0
void MainWindow::getAllCommands (Array <CommandID>& commands)
{
    const CommandID ids[] =
    {
        CommandIDs::closeWindow,
        CommandIDs::goToPreviousWindow,
        CommandIDs::goToNextWindow
    };

    commands.addArray (ids, numElementsInArray (ids));
}
Example #13
0
void MainContentComponent::getAllCommands (Array<CommandID>& commands)
{
    const CommandID ids[] = {
        Ananke::menuFileOption,
        Ananke::menuExitOption,
        Ananke::menuSettingsOption,
        Ananke::menuHelpOption
    };

    commands.addArray (ids, numElementsInArray (ids));
}
Example #14
0
void MainApp::getAllCommands (Array <CommandID>& commands)
{
  JUCEApplication::getAllCommands (commands);

  const CommandID ids[] = {
    cmdSettings,
    cmdAbout
  };

  commands.addArray (ids, numElementsInArray (ids));
}
Example #15
0
    /*
     Gets an array of all the commands.
     */
    void Engine::getAllCommands(Array<CommandID>& commands) const {
        const CommandID ids[] = {
            start,
            pause,
            stop,
            rewind,
            forward,
            record
        };

        commands.addArray(ids, numElementsInArray(ids));
    }
void CodeEditorComponent::getAllCommands (Array <CommandID>& commands)
{
    const CommandID ids[] = { StandardApplicationCommandIDs::cut,
                              StandardApplicationCommandIDs::copy,
                              StandardApplicationCommandIDs::paste,
                              StandardApplicationCommandIDs::del,
                              StandardApplicationCommandIDs::selectAll,
                              StandardApplicationCommandIDs::undo,
                              StandardApplicationCommandIDs::redo };

    commands.addArray (ids, numElementsInArray (ids));
}
//==============================================================================
void MainContentComponent::getAllCommands(Array<CommandID> &commands)
{
    //> this returns the set of all commands that this target can perform
    const CommandID ids[] = { MainWindow::fileOpen,
                              MainWindow::useLookAndFeelV1,
                              MainWindow::useLookAndFeelV2,
                              MainWindow::useLookAndFeelV3,
                              MainWindow::useNativeStyle,
                              MainWindow::showFileTreeView };

    commands.addArray(ids, numElementsInArray(ids));
}
Example #18
0
 void getAllCommands (Array<CommandID>& commands) override
 {
     const CommandID ids[] = {
         MainWindow::newProject,
         MainWindow::openProject,
         MainWindow::saveProject,
         MainWindow::saveAsProject,
         
         MainWindow::showPreferences
     };
     
     commands.addArray (ids, numElementsInArray (ids));
 }
Example #19
0
void MainHostWindow::getAllCommands (Array <CommandID>& commands)
{
    // this returns the set of all commands that this target can perform..
    const CommandID ids[] = { CommandIDs::open,
                              CommandIDs::save,
                              CommandIDs::saveAs,
                              CommandIDs::showPluginListEditor,
                              CommandIDs::showAudioSettings,
                              CommandIDs::aboutBox
                            };

    commands.addArray (ids, numElementsInArray (ids));
}
Example #20
0
static void findWildcardMatches (const File& folder, Array<File>& result)
{
    Array<File> tempList;
    FileSorter sorter;

    DirectoryIterator iter (folder, false, "*");
    bool isHiddenFile;

    while (iter.next (nullptr, &isHiddenFile, nullptr, nullptr, nullptr, nullptr))
        if (! isHiddenFile)
            tempList.addSorted (sorter, iter.getFile());

    result.addArray (tempList);
}
Example #21
0
void LibraryModule::findBrowseableFiles (const File& folder, Array<File>& filesFound) const
{
    Array<File> tempList;
    FileSorter sorter;

    DirectoryIterator iter (folder, true, "*", File::findFiles);
    bool isHiddenFile;

    while (iter.next (nullptr, &isHiddenFile, nullptr, nullptr, nullptr, nullptr))
        if (! isHiddenFile && iter.getFile().hasFileExtension (browseableFileExtensions))
            tempList.addSorted (sorter, iter.getFile());

    filesFound.addArray (tempList);
}
Example #22
0
//==============================================================================
void ProjucerApplication::getAllCommands (Array <CommandID>& commands)
{
    JUCEApplication::getAllCommands (commands);

    const CommandID ids[] = { CommandIDs::newProject,
                              CommandIDs::open,
                              CommandIDs::closeAllDocuments,
                              CommandIDs::saveAll,
                              CommandIDs::showGlobalPreferences,
                              CommandIDs::showUTF8Tool,
                              CommandIDs::showSVGPathTool,
                              CommandIDs::loginLogout };

    commands.addArray (ids, numElementsInArray (ids));
}
void PMixInterpolationSpaceLayout::getAllCommands (Array <CommandID>& commands)
{
  // this returns the set of all commands that this target can perform..
  const CommandID ids[] = {
    CommandIDs::copy ,
    CommandIDs::paste ,
    CommandIDs::del ,
    CommandIDs::selectAll ,
    CommandIDs::zoomIn ,
    CommandIDs::zoomOut ,
    CommandIDs::zoomNormal
  };
  
  commands.addArray (ids, numElementsInArray (ids));
}
Example #24
0
void LibraryModule::findWildcardMatches (const File& localModuleFolder, const String& wildcardPath, Array<File>& result) const
{
    String path (wildcardPath.upToLastOccurrenceOf ("/", false, false));
    String wildCard (wildcardPath.fromLastOccurrenceOf ("/", false, false));

    Array<File> tempList;
    FileSorter sorter;

    DirectoryIterator iter (localModuleFolder.getChildFile (path), false, wildCard);
    bool isHiddenFile;

    while (iter.next (nullptr, &isHiddenFile, nullptr, nullptr, nullptr, nullptr))
        if (! isHiddenFile)
            tempList.addSorted (sorter, iter.getFile());

    result.addArray (tempList);
}
Example #25
0
void UIComponent::getAllCommands (Array <CommandID>& commands)
{
	 const CommandID ids[] = {openConfiguration,
	 					      saveConfiguration,
	 					      undo,
	 					      redo,
	 					      copySignalChain,
	 					      pasteSignalChain,
	 					      clearSignalChain,
	 					      toggleProcessorList,
	 					      toggleSignalChain,
	 					      toggleFileInfo,
	 					      showHelp};

	 commands.addArray (ids, numElementsInArray (ids));

}
Example #26
0
//=================================================================================================
// 本类能识别并处理的命令ID
void MainWindow::getAllCommands (Array<CommandID>& commands)
{    
    const CommandID ids[] = {AppCommandIDs::newDoc,
                             AppCommandIDs::open,
                             AppCommandIDs::close,
                             AppCommandIDs::save,
                             AppCommandIDs::saveAs,             // 以上为读写文档的命令
                             AppCommandIDs::systemPreferences, 
                             AppCommandIDs::setupAudioDevice, 
                             AppCommandIDs::keyboardShortcuts, 
                             AppCommandIDs::aboutThisApp,
                             AppCommandIDs::undoAction,
                             AppCommandIDs::redoAction,
                             AppCommandIDs::clearUndoHistory
    };

    commands.addArray(ids, numElementsInArray(ids));
}
Example #27
0
/*
Retrieves all commands related to the project manager
@param commands An array of the commands
*/
void ProjectManager::getAllCommands(Array<CommandID>& commands) const
{
    const CommandID ids[] = {
        newProject,
        openProject,
        saveProject,
        saveProjectAs,
		closeProject,
		exportWav,
        StandardApplicationCommandIDs::cut,
        StandardApplicationCommandIDs::copy,
        StandardApplicationCommandIDs::paste,
        addTrack,
        addRegion,
    };

    commands.addArray(ids, numElementsInArray(ids));
}
Example #28
0
void SAMApplication::getAllCommands (Array <CommandID>& commands)
{
    JUCEApplication::getAllCommands (commands);

    const CommandID ids[] = { CommandIDs::newFile,
                              CommandIDs::open,
                              CommandIDs::showPrefs,
                              CommandIDs::showPostWindow,
                              CommandIDs::clearOutputConsole,
                              CommandIDs::openDataDir,
                              CommandIDs::showHelp,
                              CommandIDs::showPropertiesWindow,
                              CommandIDs::propertiesWindowOnTop,
                              CommandIDs::showPreviousWindow,
                              CommandIDs::showNextWindow,
    };

    commands.addArray (ids, numElementsInArray (ids));
}
void ScumblerComponent::getAllCommands(Array<CommandID>& commands)
{
  const CommandID ids[] = {
    //CommandIds::kNew,
    //CommandIds::kOpen,
    //CommandIds::kSave,
    //CommandIds::kSaveAs,
    CommandIds::kPlay,
    //CommandIds::kPause,
    //CommandIds::kRewind,
    //CommandIds::kToggleRecord,
    CommandIds::kAddTrack,
#ifdef qUnitTests
    CommandIds::kRunUnitTests
#endif
  };

  commands.addArray(ids, numElementsInArray(ids));

}
//==============================================================================
void JucerDocumentEditor::getAllCommands (Array <CommandID>& commands)
{
    const CommandID ids[] =
    {
        JucerCommandIDs::test,
        JucerCommandIDs::toFront,
        JucerCommandIDs::toBack,
        JucerCommandIDs::group,
        JucerCommandIDs::ungroup,
        JucerCommandIDs::bringBackLostItems,
        JucerCommandIDs::enableSnapToGrid,
        JucerCommandIDs::showGrid,
        JucerCommandIDs::editCompLayout,
        JucerCommandIDs::editCompGraphics,
        JucerCommandIDs::zoomIn,
        JucerCommandIDs::zoomOut,
        JucerCommandIDs::zoomNormal,
        JucerCommandIDs::spaceBarDrag,
        JucerCommandIDs::compOverlay0,
        JucerCommandIDs::compOverlay33,
        JucerCommandIDs::compOverlay66,
        JucerCommandIDs::compOverlay100,
        StandardApplicationCommandIDs::undo,
        StandardApplicationCommandIDs::redo,
        StandardApplicationCommandIDs::cut,
        StandardApplicationCommandIDs::copy,
        StandardApplicationCommandIDs::paste,
        StandardApplicationCommandIDs::del,
        StandardApplicationCommandIDs::selectAll,
        StandardApplicationCommandIDs::deselectAll
    };

    commands.addArray (ids, numElementsInArray (ids));

    for (int i = 0; i < ObjectTypes::numComponentTypes; ++i)
        commands.add (JucerCommandIDs::newComponentBase + i);

    for (int i = 0; i < ObjectTypes::numElementTypes; ++i)
        commands.add (JucerCommandIDs::newElementBase + i);
}