void AudioSourceManager::loadPackage(std::string pathOnDisk)
{
    auto parse = JSON::parse(File(pathOnDisk));
    
    var package = parse[Identifier("package")];
    parsePackage(parse);
    
    std::vector<std::string> sampleNames;
    
    for(auto& package: packages)
    {
        for(auto& source: package.getSources())
        {
            sampleNames.emplace_back(source.info);
        }
    }

    auto files = swapNames(pathOnDisk, sampleNames);
    fileManager.loadFiles(files);
}
Example #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //code to add non buttons to toolbar
    gameComboBox = new QComboBox(this);
    gameComboBox->setMinimumContentsLength(20);
    QLabel* spaceLabel = new QLabel("   ");
    QLabel* gameLabel = new QLabel("Game ");

    QAction* actionAddGame = new QAction(this);
    actionAddGame->setObjectName(QString("actionAddGame"));
    QIcon addIcon;
    addIcon.addFile(QString::fromUtf8(":/StreamControl/icons/fugue/bonus/icons-24/plus.png"), QSize(), QIcon::Normal, QIcon::Off);
    actionAddGame->setIcon(addIcon);

    QAction* actionDelGame = new QAction(this);
    actionDelGame->setObjectName(QString("actionDelGame"));
    QIcon delIcon;
    delIcon.addFile(QString::fromUtf8(":/StreamControl/icons/fugue/bonus/icons-24/minus.png"), QSize(), QIcon::Normal, QIcon::Off);
    actionDelGame->setIcon(delIcon);

    ui->toolBar->addWidget(spaceLabel);
    ui->toolBar->addWidget(gameLabel);
    ui->toolBar->addWidget(gameComboBox);
    ui->toolBar->addAction(actionAddGame);
    ui->toolBar->addAction(actionDelGame);


    connect(ui->actionConfig,SIGNAL( triggered() ),this,SLOT( openConfig() ));
    connect(ui->actionSave,SIGNAL( triggered() ),this,SLOT( saveData() ));
    connect(ui->resetButton,SIGNAL( clicked() ),this,SLOT( resetScores() ));
    connect(ui->swapButton,SIGNAL( clicked() ),this,SLOT( swapNames() ));
    connect(actionAddGame,SIGNAL( triggered() ),this,SLOT( addGame() ));
    connect(actionDelGame,SIGNAL( triggered() ),this,SLOT( delGame() ));

    cWindow = new ConfigWindow(this);

}
Example #3
0
	bool doRedo()
	{
		swapNames();
		return true;
	}
Example #4
0
	bool doUndo()
	{
		swapNames();
		archive->getDir(path)->getDirEntry()->setState(prev_state);
		return true;
	}
Example #5
0
	bool doRedo() override
	{
		swapNames();
		return true;
	}
Example #6
0
	bool doUndo() override
	{
		swapNames();
		archive_->dir(path_)->dirEntry()->setState(prev_state_);
		return true;
	}