예제 #1
0
AudioFileSelector::AudioFileSelector()
{
    AudioFormatManager formatManager;
	formatManager.registerBasicFormats();
    
    
    
    playButton = new TextButton ("u", "click here to play the current audio file");
    playButton->addListener (this);
    playButton->setColour (TextButton::buttonColourId, Colours::white);
    playButton->setColour (TextButton::buttonOnColourId, Colours::grey);
    playButton->setConnectedEdges (Button::ConnectedOnRight | Button::ConnectedOnLeft);
    
    fileChooser = new FilenameComponent ("AudioFile",
                                         File::nonexistent,
                                         true, false, false,
                                         formatManager.getWildcardForAllFormats(),
                                         String::empty,
                                         "(choose an audio file)");
    
    addAndMakeVisible (playButton);
    addAndMakeVisible (fileChooser);
    
    fileChooser->addListener (this);
    fileChooser->setBrowseButtonText ("...");
}