InterfaceComponent::InterfaceComponent()
{
    btnGenerate.setButtonText ("Generate");
    btnGenerate.setTooltip ("Generates a module at a specified folder");
    btnGenerate.addListener (this);
    btnGenerate.setColour (juce::TextButton::buttonColourId, juce::Colour (0xff3dc40d));
    btnGenerate.setColour (juce::TextButton::buttonOnColourId, juce::Colour (0xff007a06));

    btnBrowse.setButtonText ("Browse folder...");
    btnBrowse.setConnectedEdges (juce::Button::ConnectedOnRight);
    btnBrowse.setColour (juce::TextButton::buttonColourId, juce::Colour (0xffbababa));
    btnBrowse.setColour (juce::TextButton::buttonOnColourId, juce::Colour (0xff909090));
    btnBrowse.addListener (this);

    btnRefresh.setButtonText ("Refresh");
    btnRefresh.setConnectedEdges (juce::Button::ConnectedOnLeft);
    btnRefresh.setColour (juce::TextButton::buttonColourId, juce::Colour (0xffbababa));
    btnRefresh.setColour (juce::TextButton::buttonOnColourId, juce::Colour (0xff909090));
    btnRefresh.addListener (this);

    fileListBox.setColour (juce::ListBox::outlineColourId, juce::Colours::white.withAlpha (0.5f));
    fileListBox.setColour (juce::ListBox::textColourId, juce::Colours::white);
    fileListBox.setColour (juce::ListBox::backgroundColourId, juce::Colours::darkgrey.brighter().withAlpha (0.5f));
    fileListBox.setMultipleSelectionEnabled (true);
    fileListBox.setModel (this);

    grpClassConfiguration.setColour (juce::GroupComponent::ColourIds::textColourId, juce::Colours::white);
    grpClassConfiguration.setText ("Module Class Configuration");

    addLabel (lblFileName, "Module Name:", "Will be the name for header and CPP files");
    addLabel (lblHeaderGuard, "Header Guard:", "Will be the header file\'s include guard.");
    addLabel (lblNamespace, "Namespace:", "Optional. Will wrap the headers and source files with the namespace name.");
    addLabel (lblDestinationFolder, "Destination Folder:", "Folder that will contain the newly created module file for the listed files.");

    addTextEditor (txtSourceFileFolder, juce::String::empty, true);
    addTextEditor (txtModuleFilename, "MyModule");
    addTextEditor (txtHeaderGuard, "MYMODULE_H");
    addTextEditor (txtNamespace);
    addTextEditor (txtDestinationFolder);

    addAndMakeVisible (&fileListBox);
    addAndMakeVisible (&grpClassConfiguration);
    addAndMakeVisible (&btnRefresh);
    addAndMakeVisible (&btnGenerate);
    addAndMakeVisible (&btnBrowse);

    setSize (800, 600);
    startTimer (timerIntervalMS);
}
	SampleResolver(ModulatorSamplerSoundPool *pool_, Processor *synthChain_):
		DialogWindowWithBackgroundThread("Sample Resolver"),
		pool(pool_),
		mainSynthChain(synthChain_)
	{
		pool->getMissingSamples(missingSounds);

		if (missingSounds.size() == 0)
		{
			
			addBasicComponents(false);
		}
		else
		{
			numMissingSounds = missingSounds.size();

			remainingSounds = numMissingSounds;

			String textToShow = "Remaining missing sounds: " + String(remainingSounds) + " / " + String(numMissingSounds) + " missing sounds.";

            addCustomComponent(spacer = new HorizontalSpacer());

			String fileNames = missingSounds[0]->getFileName(true);
            
            String path;

            if(ProjectHandler::isAbsolutePathCrossPlatform(fileNames))
            {
                path = File(fileNames).getParentDirectory().getFullPathName();

            }
            else path = fileNames;
            
			addTextEditor("fileNames", fileNames, "Filenames:");
           
            addTextEditor("search", path, "Search for:");
			addTextEditor("replace", path, "Replace with:");
            
            addButton("Search in Finder", 5);
            
            addBasicComponents(true);
            
            
            
            showStatusMessage(textToShow);
		}
        

	};