Example #1
0
FileReader::FileReader()
    : GenericProcessor ("File Reader")
    , Thread ("filereader_Async_Reader")
    , timestamp             (0)
    , currentSampleRate     (0)
    , currentNumChannels    (0)
    , currentSample         (0)
    , currentNumSamples     (0)
    , startSample           (0)
    , stopSample            (0)
    , counter               (0)
    , bufferCacheWindow     (0)
    , m_shouldFillBackBuffer(false)
	, m_bufferSize(1024)
	, m_sysSampleRate(44100)
{
    setProcessorType (PROCESSOR_TYPE_SOURCE);

    setEnabledState (false);

    const int numFileSources = AccessClass::getPluginManager()->getNumFileSources();
    for (int i = 0; i < numFileSources; ++i)
    {
        Plugin::FileSourceInfo info = AccessClass::getPluginManager()->getFileSourceInfo (i);

        StringArray extensions;
        extensions.addTokens (info.extensions, ";", "\"");

        const int numExtensions = extensions.size();
        for (int j = 0; j < numExtensions; ++j)
        {
            supportedExtensions.set (extensions[j].toLowerCase(), i + 1);
        }
    }
}
FileReaderEditor::FileReaderEditor (GenericProcessor* parentNode, bool useDefaultParameterEditors = true)
    : GenericEditor (parentNode, useDefaultParameterEditors)
    , fileReader   (static_cast<FileReader*> (parentNode))
    , recTotalTime              (0)
    , m_isFileDragAndDropActive (false)
{
    lastFilePath = File::getCurrentWorkingDirectory();

    fileButton = new UtilityButton ("F:", Font ("Small Text", 13, Font::plain));
    fileButton->addListener (this);
    fileButton->setBounds (5, 27, 20, 20);
    addAndMakeVisible (fileButton);

    fileNameLabel = new Label ("FileNameLabel", "No file selected.");
    fileNameLabel->setBounds (30, 25, 140, 20);
    addAndMakeVisible (fileNameLabel);

    recordSelector = new ComboBox ("Recordings");
    recordSelector->setBounds (30, 50, 120, 20);
    recordSelector->addListener (this);
    addAndMakeVisible (recordSelector);

    currentTime = new DualTimeComponent (this, false);
    currentTime->setBounds (5, 80, 175, 20);
    addAndMakeVisible (currentTime);

    timeLimits = new DualTimeComponent (this,true);
    timeLimits->setBounds (5, 105, 175, 20);
    addAndMakeVisible (timeLimits);

    desiredWidth = 180;

    setEnabledState (false);
}
JuliaProcessorEditor::JuliaProcessorEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors = true)
	: GenericEditor(parentNode, useDefaultParameterEditors)
{
	//Most used buttons are UtilityButton, which shows a simple button with text and ElectrodeButton, which is an on-off button which displays a channel.
	/*exampleButton = new UtilityButton("Button text", Font("Default", 15, Font::plain));
	exampleButton->setBounds(10, 10, 100, 100); //Set position and size (X, Y, XSize, YSize)
	exampleButton->addListener(this); //Specify which class will implement the listener methods, in the case of editors, always make the editor the listener
	exampleButton->setClickingTogglesState(true); //True for a on-off toggleable button, false for a single-click monostable button
	exampleButton->setTooltip("Mouseover tooltip text");
	addAndMakeVisible(exampleButton);*/
	//JuliaProcessor* juliaProcessor = (JuliaProcessor*) getProcessor();
	juliaProcessor = (JuliaProcessor*) parentNode;

    lastFilePath = File::getCurrentWorkingDirectory();

    fileButton = new UtilityButton("Select file",Font("Small Text", 13, Font::plain));
    fileButton->addListener(this);
    fileButton->setBounds(10,85,100,25);
    addAndMakeVisible(fileButton);

	reloadFileButton = new UtilityButton("refresh",Font("Small Text", 13, Font::plain));
    reloadFileButton->addListener(this);
    reloadFileButton->setBounds(100+10,85,60,25);
    addAndMakeVisible(reloadFileButton);


    fileNameLabel = new Label("FileNameLabel", "No file selected.");
    fileNameLabel->setBounds(10,85+20,140,25);
    addAndMakeVisible(fileNameLabel);


    bufferSizeSelection = new Label("Buffer Size","30000"); // this is currently set in RHD2000Thread, the cleaner would be to set it here again
    bufferSizeSelection->setEditable(true,false,false);
    bufferSizeSelection->addListener(this);
    bufferSizeSelection->setBounds(120,60,60,20);
    bufferSizeSelection->setColour(Label::textColourId, Colours::darkgrey);
    addAndMakeVisible(bufferSizeSelection);

	bufferSizeSelectionLabel = new Label("","NBuf.:");
	bufferSizeSelectionLabel->attachToComponent	(bufferSizeSelection,true);
	addAndMakeVisible(bufferSizeSelectionLabel);

    /*Image im;
    im = ImageCache::getFromMemory(BinaryData::JuliaIconActive_png,
                                   BinaryData::JuliaIconActive_pngSize);

    icon = new ImageIcon(im);
    addAndMakeVisible(icon);
    icon->setBounds(15,25,61,54);

    icon->setOpacity(0.3f);*/

    desiredWidth = 200;

    setEnabledState(false);
}
Example #4
0
ColorButton::ColorButton(String label_, Font font_) :
    Button(label_), label(label_), font(font_)
{
    userDefinedData = -1;
    fontColor = juce::Colours::white;
    backgroundColor = juce::Colours::darkgrey;
    vert = false;
    setEnabledState(true);
    showEnabledStatus = false;
}
void FileReaderEditor::clearEditor()
{
    fileNameLabel->setText ("No file selected.", dontSendNotification);
    recordSelector->clear (dontSendNotification);

    timeLimits->setTimeMilliseconds     (0, 0);
    timeLimits->setTimeMilliseconds     (1, 0);
    currentTime->setTimeMilliseconds    (0, 0);
    currentTime->setTimeMilliseconds    (1, 0);

    setEnabledState (false);
}
Example #6
0
void FileReaderEditor::setFile(String file)
{

    File fileToRead(file);
    lastFilePath = fileToRead.getParentDirectory();
    fileReader->setFile(fileToRead.getFullPathName());
    fileNameLabel->setText(fileToRead.getFileName(), dontSendNotification);

    setEnabledState(true);

    repaint();
}
Example #7
0
NetworkEventsEditor::NetworkEventsEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors=true)
    : GenericEditor(parentNode, useDefaultParameterEditors)

{
	desiredWidth = 180;

    urlLabel = new Label("Port", "Port:");
    urlLabel->setBounds(20,80,140,25);
    addAndMakeVisible(urlLabel);
	NetworkEvents *p= (NetworkEvents *)getProcessor();

	restartConnection = new UtilityButton("Restart Connection",Font("Default", 15, Font::plain));
    restartConnection->setBounds(20,45,150,18);
    restartConnection->addListener(this);
    addAndMakeVisible(restartConnection);

	
	/*
	trialSimulation = new UtilityButton("Trial",Font("Default", 15, Font::plain));
    trialSimulation->setBounds(20,25,80,18);
    trialSimulation->addListener(this);
    addAndMakeVisible(trialSimulation);

	
	startRecord = new UtilityButton("Start Record",Font("Default", 15, Font::plain));
    startRecord->setBounds(20,55,100,18);
    startRecord->addListener(this);
    addAndMakeVisible(startRecord);
	*/

	labelPort = new Label("Port", String(p->urlport));
    labelPort->setBounds(70,85,80,18);
    labelPort->setFont(Font("Default", 15, Font::plain));
    labelPort->setColour(Label::textColourId, Colours::white);



//		NetworkEvents *processor  = (NetworkEvents*) getProcessor();

	//if (processor->threadRunning)
		labelPort->setColour(Label::backgroundColourId, Colours::grey);
//	else
//		labelPort->setColour(Label::backgroundColourId, Colours::red);


    labelPort->setEditable(true);
    labelPort->addListener(this);
    addAndMakeVisible(labelPort);

    setEnabledState(false);

}
Example #8
0
UtilityButton::UtilityButton(String label_, Font font_) :
    Button(label_), label(label_), font(font_)
{

    roundUL = true;
    roundUR = true;
    roundLL = true;
    roundLR = true;

    radius = 5.0f;

    font.setHeight(12.0f);

    setEnabledState(true);

}
void FileReaderEditor::setFile (String file)
{
    File fileToRead (file);
    lastFilePath = fileToRead.getParentDirectory();

    if (fileReader->setFile (fileToRead.getFullPathName()))
    {
        fileNameLabel->setText (fileToRead.getFileName(), dontSendNotification);

        setEnabledState (true);
    }
    else
    {
        clearEditor();
    }

    CoreServices::updateSignalChain (this);
    repaint();
}
Example #10
0
FileReaderEditor::FileReaderEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors=true)
    : GenericEditor(parentNode, useDefaultParameterEditors)

{

    fileReader = (FileReader*) parentNode;

    lastFilePath = File::getCurrentWorkingDirectory();

    fileButton = new UtilityButton("Select file",Font("Small Text", 13, Font::plain));
    fileButton->addListener(this);
    fileButton->setBounds(30,50,120,25);
    addAndMakeVisible(fileButton);

    fileNameLabel = new Label("FileNameLabel", "No file selected.");
    fileNameLabel->setBounds(20,80,140,25);
    addAndMakeVisible(fileNameLabel);

    desiredWidth = 180;

    setEnabledState(false);

}
Example #11
0
void OpenNIC::tcpConnected()
{
	mBalloonStatus=tr("Connecting...");
	setEnabledState();
	pollAllKeys();
}