//==============================================================================
AudioProcessorValueTreeState::AudioProcessorValueTreeState (AudioProcessor& p, UndoManager* um)
    : processor (p),
      undoManager (um),
      valueType ("PARAM"),
      valuePropertyID ("value"),
      idPropertyID ("id"),
      updatingConnections (false)
{
    startTimerHz (10);
    state.addListener (this);
}
Esempio n. 2
0
void PlayList::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
    //[/UserbuttonClicked_Pre]
    
    if(buttonThatWasClicked == loadList)
    {
      
        getlist();

        Logger* log = Logger::getCurrentLogger();
        String testtext= sublist.getProperty(sublistId);
        log->writeToLog(testtext);
        log->writeToLog("test");
    }
    else if (buttonThatWasClicked == saveList)
    {
        setlist();

    }
    else if (buttonThatWasClicked == savesublist)
    {

       String testsubId= sublist.getProperty(sublistId);

        
       String testmusicId = music.getProperty(musicId);
        ValueTree newsublist = setsublist(testsubId, testmusicId);

        Logger* log = Logger::getCurrentLogger();
        log->writeToLog(testmusicId);
        log->writeToLog(testsubId);
        playlist.addChild(newsublist, 0, nullptr);
    }
    else if (buttonThatWasClicked == path){
        FileChooser chooser ("Select Music",File::nonexistent);
        if (chooser.browseForFileToOpen()) {
            File file (chooser.getResult());
            String musicname=file.getFileName();
            File path(file.getCurrentWorkingDirectory());
            String actpath= (file.getFullPathName());
            
            ValueTree newmusic= ValueTree(musicId);
            ValueTree newmusicpath = ValueTree(pathId);
            newmusic.addListener(this);
            newmusicpath.addListener(this);
            newmusic.addChild(newmusicpath, 0, nullptr);
            newmusicpath.setProperty(pathId, actpath, nullptr);
            newmusic.setProperty(musicId, musicname, nullptr);
            //ValueTree newsublist = ValueTree(sublistId);
            //newsublist.addListener(this);
            //newsublist.setProperty(sublistId, "New Playlist", nullptr);
            sublist.addChild(newmusic,0, nullptr);
        }
        
       
    }
    else if (buttonThatWasClicked == newsublist)
    {
        NativeMessageBox::showMessageBox(AlertWindow::QuestionIcon, "New Playlist Name", "Please input a new playlist name",testlabel);
        testlabel->setEditable(true,true,true);
        testlabel->addListener(this);
    }
    
}
Esempio n. 3
0
//==============================================================================
AudioProcessorValueTreeState::AudioProcessorValueTreeState (AudioProcessor& p, UndoManager* um)
    : processor (p), undoManager (um)
{
    startTimerHz (10);
    state.addListener (this);
}