mirror of
https://gitlab.com/then-try-this/samplebrain.git
synced 2025-05-12 10:37:20 +00:00
comboboxes and sample enable stuff
This commit is contained in:
parent
1b0c6f04d5
commit
fa3d53141b
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -31,6 +31,15 @@ MainWindow::MainWindow() :
|
||||
m_Ui.setupUi(this);
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
|
||||
m_sound_item_enable_mapper = new QSignalMapper(this);
|
||||
m_Ui.brain_contents->setAlignment(Qt::AlignTop);
|
||||
m_Ui.brain_contents->setSpacing(0);
|
||||
m_Ui.brain_contents->setMargin(0);
|
||||
m_Ui.brain_contents->setContentsMargins(0,0,0,0);
|
||||
connect(m_sound_item_enable_mapper,
|
||||
SIGNAL(mapped(int)), this, SLOT(sound_enable(int)));
|
||||
m_current_sound_id=0;
|
||||
|
||||
// add default local dest
|
||||
// turn on first one
|
||||
|
||||
@ -108,9 +117,9 @@ void MainWindow::init_from_session(const string &filename) {
|
||||
float source_overlap;
|
||||
int t_int;
|
||||
// skip this...
|
||||
ifs||target_windowsize||target_overlap;
|
||||
ifs||source_windowsize||source_overlap;
|
||||
ifs||target_window||source_window;
|
||||
ifs||target_windowsize||target_overlap;
|
||||
ifs||source_window||target_window;
|
||||
// todo: probably don't need to load all the sample data too :/
|
||||
ifs||s;
|
||||
ifs||t;
|
||||
@ -133,12 +142,7 @@ void MainWindow::init_from_session(const string &filename) {
|
||||
m_Ui.sliderSearchStretch->setValue(r.get_stretch());
|
||||
m_Ui.spinBoxSearchStretch->setValue(r.get_stretch());
|
||||
|
||||
switch(r.get_search_algo()) {
|
||||
case renderer::BASIC: m_Ui.radioButtonAlgoBasic->setChecked(true); break;
|
||||
case renderer::REV_BASIC: m_Ui.radioButtonAlgoRevBasic->setChecked(true); break;
|
||||
case renderer::SYNAPTIC: m_Ui.radioButtonSynaptic->setChecked(true); break;
|
||||
case renderer::SYNAPTIC_SLIDE: m_Ui.radioButtonSynapticSlide->setChecked(true); break;
|
||||
};
|
||||
m_Ui.comboBoxAlgorithm->setCurrentIndex(r.get_search_algo());
|
||||
|
||||
m_Ui.sliderSynapses->setValue(p->m_num_synapses);
|
||||
m_Ui.spinBoxSynapses->setValue(p->m_num_synapses);
|
||||
@ -149,50 +153,22 @@ void MainWindow::init_from_session(const string &filename) {
|
||||
m_Ui.spinBoxBlockSizeTarget->setValue(t.get_block_size());
|
||||
m_Ui.doubleSpinBoxBlockOverlapTarget->setValue(t.get_overlap()/(float)t.get_block_size());
|
||||
|
||||
m_Ui.radioButton_dodgyTarget->setChecked(false);
|
||||
m_Ui.radioButton_bartlettTarget->setChecked(false);
|
||||
m_Ui.radioButton_blackmanTarget->setChecked(false);
|
||||
m_Ui.radioButton_flattopTarget->setChecked(false);
|
||||
m_Ui.radioButton_gaussianTarget->setChecked(false);
|
||||
m_Ui.radioButton_hammingTarget->setChecked(false);
|
||||
m_Ui.radioButton_hannTarget->setChecked(false);
|
||||
m_Ui.radioButton_rectangleTarget->setChecked(false);
|
||||
|
||||
switch(target_window) {
|
||||
case window::DODGY: m_Ui.radioButton_dodgyTarget->setChecked(true); break;
|
||||
case window::BARTLETT: m_Ui.radioButton_bartlettTarget->setChecked(true); break;
|
||||
case window::BLACKMAN: m_Ui.radioButton_blackmanTarget->setChecked(true); break;
|
||||
case window::FLAT_TOP: m_Ui.radioButton_flattopTarget->setChecked(true); break;
|
||||
case window::GAUSSIAN: m_Ui.radioButton_gaussianTarget->setChecked(true); break;
|
||||
case window::HAMMING: m_Ui.radioButton_hammingTarget->setChecked(true); break;
|
||||
case window::HANN: m_Ui.radioButton_hannTarget->setChecked(true); break;
|
||||
case window::RECTANGLE: m_Ui.radioButton_rectangleTarget->setChecked(true); break;
|
||||
default: break;
|
||||
};
|
||||
m_Ui.comboBoxTargetShape->setCurrentIndex(target_window);
|
||||
|
||||
// source
|
||||
m_Ui.spinBoxBlockSize->setValue(s.get_block_size());
|
||||
m_Ui.doubleSpinBoxBlockOverlap->setValue(s.get_overlap()/(float)s.get_block_size());
|
||||
switch(source_window) {
|
||||
case window::DODGY: m_Ui.radioButton_dodgy->setChecked(true); break;
|
||||
case window::BARTLETT: m_Ui.radioButton_bartlett->setChecked(true); break;
|
||||
case window::BLACKMAN: m_Ui.radioButton_blackman->setChecked(true); break;
|
||||
case window::FLAT_TOP: m_Ui.radioButton_flattop->setChecked(true); break;
|
||||
case window::GAUSSIAN: m_Ui.radioButton_gaussian->setChecked(true); break;
|
||||
case window::HAMMING: m_Ui.radioButton_hamming->setChecked(true); break;
|
||||
case window::HANN: m_Ui.radioButton_hann->setChecked(true); break;
|
||||
case window::RECTANGLE: m_Ui.radioButton_rectagle->setChecked(true); break;
|
||||
default: break;
|
||||
};
|
||||
m_Ui.comboBoxBrainShape->setCurrentIndex(source_window);
|
||||
|
||||
// brain samples
|
||||
m_Ui.listWidgetSounds->clear();
|
||||
// m_Ui.listWidgetSounds->clear();
|
||||
const std::list<brain::sound> samples = s.get_samples();
|
||||
for (std::list<brain::sound>::const_iterator i=samples.begin();
|
||||
i!=samples.end(); ++i) {
|
||||
m_Ui.listWidgetSounds->addItem(QString::fromStdString(i->m_filename));
|
||||
add_sound_item(i->m_filename);
|
||||
}
|
||||
|
||||
|
||||
// mix
|
||||
m_Ui.sliderTargetMix->setValue(r.get_target_mix()*100);
|
||||
m_Ui.doubleSpinBoxTargetMix->setValue(r.get_target_mix());
|
||||
@ -204,3 +180,53 @@ void MainWindow::init_from_session(const string &filename) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::add_sound_item(const string &name) {
|
||||
sound_item si;
|
||||
si.m_filename = name;
|
||||
si.m_id = m_current_sound_id++;
|
||||
QString style("background-color:lightblue;");
|
||||
if (m_sound_items.size()%2==0) style="background-color:pink;";
|
||||
|
||||
si.m_container = new QHBoxLayout();
|
||||
si.m_enable = new QCheckBox();
|
||||
si.m_enable->setChecked(true);
|
||||
si.m_enable->setStyleSheet(style);
|
||||
si.m_container->addWidget(si.m_enable);
|
||||
QLabel *l = new QLabel();
|
||||
|
||||
|
||||
QFileInfo fi(QString::fromStdString(name));
|
||||
l->setText(fi.fileName());
|
||||
l->setStyleSheet(style);
|
||||
si.m_container->addWidget(l);
|
||||
|
||||
QSpacerItem *spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
//spacer->setStyleSheet(style);
|
||||
si.m_container->addItem(spacer);
|
||||
|
||||
QPushButton *del = new QPushButton();
|
||||
del->setText("x");
|
||||
del->setMaximumWidth(20);
|
||||
del->setMaximumHeight(20);
|
||||
si.m_container->addWidget(del);
|
||||
|
||||
m_Ui.brain_contents->addLayout(si.m_container);
|
||||
|
||||
QObject::connect(si.m_enable, SIGNAL(clicked()), m_sound_item_enable_mapper, SLOT(map()));
|
||||
m_sound_item_enable_mapper->setMapping(si.m_enable, si.m_id);
|
||||
|
||||
m_sound_items.push_back(si);
|
||||
}
|
||||
|
||||
void MainWindow::clear_sound_items() {
|
||||
for (auto si:m_sound_items) {
|
||||
delete si.m_container;
|
||||
}
|
||||
m_sound_items.clear();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::delete_sound_item(const string &name) {
|
||||
}
|
||||
|
@ -128,11 +128,7 @@ private slots:
|
||||
}
|
||||
|
||||
void volume_slot(int s) { send_audio_osc("/volume","f",s/100.0f); }
|
||||
|
||||
void algo_basic(bool s) { if (s) send_audio_osc("/search_algo","i",0); }
|
||||
void algo_rev_basic(bool s) { if (s) send_audio_osc("/search_algo","i",1); }
|
||||
void algo_synaptic(bool s) { if (s) send_audio_osc("/search_algo","i",2); }
|
||||
void algo_synaptic_slide(bool s) { if (s) send_audio_osc("/search_algo","i",3); }
|
||||
void algo(int n) { send_audio_osc("/search_algo","i",n); }
|
||||
|
||||
void run_slot() {}
|
||||
void load_target() {
|
||||
@ -160,40 +156,26 @@ private slots:
|
||||
|
||||
send_process_osc("/load_sample","s",m_last_file.toStdString().c_str());
|
||||
|
||||
m_Ui.listWidgetSounds->addItem(m_last_file);
|
||||
add_sound_item(m_last_file.toStdString());
|
||||
//m_Ui.listWidgetSounds->addItem(m_last_file);
|
||||
}
|
||||
void delete_sound() {
|
||||
QList<QListWidgetItem *> itemList = m_Ui.listWidgetSounds->selectedItems();
|
||||
for (int i=0; i<itemList.size(); i++) {
|
||||
send_process_osc("/delete_sample","s",itemList[i]->text().toStdString().c_str());
|
||||
}
|
||||
qDeleteAll(m_Ui.listWidgetSounds->selectedItems());
|
||||
//QList<QListWidgetItem *> itemList = m_Ui.listWidgetSounds->selectedItems();
|
||||
//for (int i=0; i<itemList.size(); i++) {
|
||||
// send_process_osc("/delete_sample","s",itemList[i]->text().toStdString().c_str());
|
||||
//}
|
||||
//qDeleteAll(m_Ui.listWidgetSounds->selectedItems());
|
||||
}
|
||||
void clear_brain() {
|
||||
for (int i=0; i<m_Ui.listWidgetSounds->count(); i++) {
|
||||
send_process_osc("/delete_sample","s",m_Ui.listWidgetSounds->item(i)->text().toStdString().c_str());
|
||||
}
|
||||
m_Ui.listWidgetSounds->clear();
|
||||
//for (int i=0; i<m_Ui.listWidgetSounds->count(); i++) {
|
||||
// send_process_osc("/delete_sample","s",m_Ui.listWidgetSounds->item(i)->text().toStdString().c_str());
|
||||
//}
|
||||
//m_Ui.listWidgetSounds->clear();
|
||||
}
|
||||
void restart_audio() { send_audio_osc("/restart_audio",""); }
|
||||
|
||||
void window_dodgy(bool s) { if (s) send_process_osc("/window_type","i",window::DODGY); }
|
||||
void window_bartlett(bool s) { if (s) send_process_osc("/window_type","i",window::BARTLETT); }
|
||||
void window_blackman(bool s) { if (s) send_process_osc("/window_type","i",window::BLACKMAN); }
|
||||
void window_flattop(bool s) { if (s) send_process_osc("/window_type","i",window::FLAT_TOP); }
|
||||
void window_gaussian(bool s) { if (s) send_process_osc("/window_type","i",window::GAUSSIAN); }
|
||||
void window_hamming(bool s) { if (s) send_process_osc("/window_type","i",window::HAMMING); }
|
||||
void window_hann(bool s) { if (s) send_process_osc("/window_type","i",window::HANN); }
|
||||
void window_rectangle(bool s) { if (s) send_process_osc("/window_type","i",window::RECTANGLE); }
|
||||
|
||||
void window_target_dodgy(bool s) { if (s) send_process_osc("/target_window_type","i",window::DODGY); }
|
||||
void window_target_bartlett(bool s) { if (s) send_process_osc("/target_window_type","i",window::BARTLETT); }
|
||||
void window_target_blackman(bool s) { if (s) send_process_osc("/target_window_type","i",window::BLACKMAN); }
|
||||
void window_target_flattop(bool s) { if (s) send_process_osc("/target_window_type","i",window::FLAT_TOP); }
|
||||
void window_target_gaussian(bool s) { if (s) send_process_osc("/target_window_type","i",window::GAUSSIAN); }
|
||||
void window_target_hamming(bool s) { if (s) send_process_osc("/target_window_type","i",window::HAMMING); }
|
||||
void window_target_hann(bool s) { if (s) send_process_osc("/target_window_type","i",window::HANN); }
|
||||
void window_target_rectangle(bool s) { if (s) send_process_osc("/target_window_type","i",window::RECTANGLE); }
|
||||
void brain_shape(int n) { send_process_osc("/window_type","i",n); }
|
||||
void target_shape(int n) { send_process_osc("/target_window_type","i",n); }
|
||||
|
||||
void record() {
|
||||
if (m_save_wav=="") {
|
||||
@ -271,7 +253,6 @@ private slots:
|
||||
}
|
||||
|
||||
void net_enable(int id) {
|
||||
cerr<<"enable "<<id<<endl;
|
||||
osc_destination &d = m_destinations[id];
|
||||
|
||||
if (d.m_enable->isChecked()) {
|
||||
@ -290,13 +271,43 @@ private slots:
|
||||
|
||||
}
|
||||
|
||||
void net_connect(int id) {
|
||||
cerr<<"connect "<<id<<endl;
|
||||
|
||||
void sound_enable(int id) {
|
||||
// search for this id...
|
||||
for (auto si:m_sound_items) {
|
||||
if (si.m_id==id) {
|
||||
if (si.m_enable->isChecked()) {
|
||||
send_process_osc("/activate_sound","s",si.m_filename.c_str());
|
||||
} else {
|
||||
send_process_osc("/deactivate_sound","s",si.m_filename.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
///////////////////////////////////////////////
|
||||
|
||||
// we want to be able to send out to
|
||||
// multiple addresses over the network
|
||||
class sound_item {
|
||||
public:
|
||||
int m_id;
|
||||
string m_filename;
|
||||
// can't find a way to address these via qt
|
||||
QCheckBox *m_enable;
|
||||
QHBoxLayout *m_container;
|
||||
};
|
||||
|
||||
vector<sound_item> m_sound_items;
|
||||
|
||||
void add_sound_item(const string &name);
|
||||
void delete_sound_item(const string &name);
|
||||
void clear_sound_items();
|
||||
|
||||
////////////////////////////////////////////////
|
||||
|
||||
|
||||
// we want to be able to send out to
|
||||
// multiple addresses over the network
|
||||
class osc_destination {
|
||||
@ -358,4 +369,7 @@ private:
|
||||
u32 m_record_id;
|
||||
Ui_MainWindow m_Ui;
|
||||
feedback m_feedback;
|
||||
|
||||
int m_current_sound_id;
|
||||
QSignalMapper* m_sound_item_enable_mapper;
|
||||
};
|
||||
|
@ -175,6 +175,6 @@ void audio_thread::process(sample &s, sample &s2) {
|
||||
}
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
} else {
|
||||
cerr<<"audio no lock..."<<endl;
|
||||
//cerr<<"audio no lock..."<<endl;
|
||||
}
|
||||
}
|
||||
|
@ -1,29 +1,28 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'samplebrainZ17592.ui'
|
||||
** Form generated from reading UI file 'samplebrainu19467.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 4.8.6
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef SAMPLEBRAINZ17592_H
|
||||
#define SAMPLEBRAINZ17592_H
|
||||
#ifndef SAMPLEBRAINU19467_H
|
||||
#define SAMPLEBRAINU19467_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QDial>
|
||||
#include <QtGui/QDoubleSpinBox>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QListWidget>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QRadioButton>
|
||||
#include <QtGui/QScrollArea>
|
||||
#include <QtGui/QSlider>
|
||||
#include <QtGui/QSpacerItem>
|
||||
#include <QtGui/QSpinBox>
|
||||
@ -74,12 +73,9 @@ public:
|
||||
QLabel *label_28;
|
||||
QSlider *sliderSearchStretch;
|
||||
QSpinBox *spinBoxSearchStretch;
|
||||
QLabel *label_27;
|
||||
QHBoxLayout *horizontalLayout_18;
|
||||
QRadioButton *radioButtonAlgoBasic;
|
||||
QRadioButton *radioButtonAlgoRevBasic;
|
||||
QRadioButton *radioButtonSynaptic;
|
||||
QRadioButton *radioButtonSynapticSlide;
|
||||
QHBoxLayout *horizontalLayout_25;
|
||||
QLabel *label_32;
|
||||
QComboBox *comboBoxAlgorithm;
|
||||
QHBoxLayout *horizontalLayout_17;
|
||||
QLabel *label_26;
|
||||
QSlider *sliderSynapses;
|
||||
@ -88,7 +84,7 @@ public:
|
||||
QLabel *label_29;
|
||||
QSlider *sliderSlideError;
|
||||
QSpinBox *spinBoxSlideError;
|
||||
QSpacerItem *horizontalSpacer_2;
|
||||
QSpacerItem *verticalSpacer_3;
|
||||
QVBoxLayout *verticalLayout_6;
|
||||
QLabel *label_16;
|
||||
QPushButton *pushButtonLoadTarget;
|
||||
@ -98,16 +94,9 @@ public:
|
||||
QHBoxLayout *horizontalLayout_14;
|
||||
QLabel *label_18;
|
||||
QDoubleSpinBox *doubleSpinBoxBlockOverlapTarget;
|
||||
QGridLayout *gridLayout_2;
|
||||
QRadioButton *radioButton_bartlettTarget;
|
||||
QRadioButton *radioButton_blackmanTarget;
|
||||
QRadioButton *radioButton_gaussianTarget;
|
||||
QRadioButton *radioButton_hammingTarget;
|
||||
QRadioButton *radioButton_hannTarget;
|
||||
QRadioButton *radioButton_flattopTarget;
|
||||
QRadioButton *radioButton_dodgyTarget;
|
||||
QRadioButton *radioButton_rectangleTarget;
|
||||
QHBoxLayout *horizontalLayout_23;
|
||||
QLabel *label_14;
|
||||
QComboBox *comboBoxTargetShape;
|
||||
QPushButton *pushButtonGenerateTarget;
|
||||
QLabel *label_23;
|
||||
QHBoxLayout *horizontalLayout_22;
|
||||
@ -126,10 +115,12 @@ public:
|
||||
QSpacerItem *verticalSpacer;
|
||||
QVBoxLayout *verticalLayout_2;
|
||||
QLabel *label_3;
|
||||
QListWidget *listWidgetSounds;
|
||||
QScrollArea *scrollArea;
|
||||
QWidget *scrollAreaWidgetContents;
|
||||
QVBoxLayout *verticalLayout_5;
|
||||
QVBoxLayout *brain_contents;
|
||||
QHBoxLayout *horizontalLayout_2;
|
||||
QPushButton *pushButtonLoadSound;
|
||||
QPushButton *pushButtonDeleteSound;
|
||||
QPushButton *pushButtonClearBrain;
|
||||
QHBoxLayout *horizontalLayout_4;
|
||||
QLabel *label;
|
||||
@ -137,16 +128,9 @@ public:
|
||||
QHBoxLayout *horizontalLayout_6;
|
||||
QLabel *label_2;
|
||||
QDoubleSpinBox *doubleSpinBoxBlockOverlap;
|
||||
QGridLayout *gridLayout;
|
||||
QRadioButton *radioButton_gaussian;
|
||||
QRadioButton *radioButton_hamming;
|
||||
QRadioButton *radioButton_dodgy;
|
||||
QRadioButton *radioButton_blackman;
|
||||
QRadioButton *radioButton_rectagle;
|
||||
QRadioButton *radioButton_bartlett;
|
||||
QRadioButton *radioButton_flattop;
|
||||
QRadioButton *radioButton_hann;
|
||||
QLabel *label_4;
|
||||
QHBoxLayout *horizontalLayout_24;
|
||||
QLabel *label_15;
|
||||
QComboBox *comboBoxBrainShape;
|
||||
QPushButton *pushButtonGenerate;
|
||||
QHBoxLayout *horizontalLayout_7;
|
||||
QPushButton *pushButtonLoadBrain;
|
||||
@ -175,7 +159,7 @@ public:
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
||||
MainWindow->resize(910, 795);
|
||||
MainWindow->resize(910, 659);
|
||||
centralwidget = new QWidget(MainWindow);
|
||||
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
||||
verticalLayout_4 = new QVBoxLayout(centralwidget);
|
||||
@ -443,51 +427,23 @@ public:
|
||||
|
||||
verticalLayout_3->addLayout(horizontalLayout_19);
|
||||
|
||||
label_27 = new QLabel(controlTab);
|
||||
label_27->setObjectName(QString::fromUtf8("label_27"));
|
||||
horizontalLayout_25 = new QHBoxLayout();
|
||||
horizontalLayout_25->setObjectName(QString::fromUtf8("horizontalLayout_25"));
|
||||
label_32 = new QLabel(controlTab);
|
||||
label_32->setObjectName(QString::fromUtf8("label_32"));
|
||||
QFont font3;
|
||||
font3.setFamily(QString::fromUtf8("Comic Sans MS"));
|
||||
font3.setPointSize(10);
|
||||
font3.setBold(true);
|
||||
font3.setWeight(75);
|
||||
label_27->setFont(font3);
|
||||
font3.setPointSize(9);
|
||||
label_32->setFont(font3);
|
||||
|
||||
verticalLayout_3->addWidget(label_27);
|
||||
horizontalLayout_25->addWidget(label_32);
|
||||
|
||||
horizontalLayout_18 = new QHBoxLayout();
|
||||
horizontalLayout_18->setObjectName(QString::fromUtf8("horizontalLayout_18"));
|
||||
radioButtonAlgoBasic = new QRadioButton(controlTab);
|
||||
buttonGroup_3 = new QButtonGroup(MainWindow);
|
||||
buttonGroup_3->setObjectName(QString::fromUtf8("buttonGroup_3"));
|
||||
buttonGroup_3->addButton(radioButtonAlgoBasic);
|
||||
radioButtonAlgoBasic->setObjectName(QString::fromUtf8("radioButtonAlgoBasic"));
|
||||
radioButtonAlgoBasic->setChecked(true);
|
||||
comboBoxAlgorithm = new QComboBox(controlTab);
|
||||
comboBoxAlgorithm->setObjectName(QString::fromUtf8("comboBoxAlgorithm"));
|
||||
|
||||
horizontalLayout_18->addWidget(radioButtonAlgoBasic);
|
||||
|
||||
radioButtonAlgoRevBasic = new QRadioButton(controlTab);
|
||||
buttonGroup_3->addButton(radioButtonAlgoRevBasic);
|
||||
radioButtonAlgoRevBasic->setObjectName(QString::fromUtf8("radioButtonAlgoRevBasic"));
|
||||
|
||||
horizontalLayout_18->addWidget(radioButtonAlgoRevBasic);
|
||||
|
||||
radioButtonSynaptic = new QRadioButton(controlTab);
|
||||
buttonGroup_3->addButton(radioButtonSynaptic);
|
||||
radioButtonSynaptic->setObjectName(QString::fromUtf8("radioButtonSynaptic"));
|
||||
radioButtonSynaptic->setChecked(false);
|
||||
|
||||
horizontalLayout_18->addWidget(radioButtonSynaptic);
|
||||
|
||||
radioButtonSynapticSlide = new QRadioButton(controlTab);
|
||||
buttonGroup_3->addButton(radioButtonSynapticSlide);
|
||||
radioButtonSynapticSlide->setObjectName(QString::fromUtf8("radioButtonSynapticSlide"));
|
||||
radioButtonSynapticSlide->setEnabled(true);
|
||||
radioButtonSynapticSlide->setCheckable(true);
|
||||
|
||||
horizontalLayout_18->addWidget(radioButtonSynapticSlide);
|
||||
horizontalLayout_25->addWidget(comboBoxAlgorithm);
|
||||
|
||||
|
||||
verticalLayout_3->addLayout(horizontalLayout_18);
|
||||
verticalLayout_3->addLayout(horizontalLayout_25);
|
||||
|
||||
horizontalLayout_17 = new QHBoxLayout();
|
||||
horizontalLayout_17->setObjectName(QString::fromUtf8("horizontalLayout_17"));
|
||||
@ -551,9 +507,9 @@ public:
|
||||
|
||||
verticalLayout_3->addLayout(horizontalLayout_20);
|
||||
|
||||
horizontalSpacer_2 = new QSpacerItem(21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
verticalLayout_3->addItem(horizontalSpacer_2);
|
||||
verticalLayout_3->addItem(verticalSpacer_3);
|
||||
|
||||
|
||||
horizontalLayout_5->addLayout(verticalLayout_3);
|
||||
@ -609,66 +565,20 @@ public:
|
||||
|
||||
verticalLayout_6->addLayout(horizontalLayout_14);
|
||||
|
||||
gridLayout_2 = new QGridLayout();
|
||||
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
|
||||
radioButton_bartlettTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2 = new QButtonGroup(MainWindow);
|
||||
buttonGroup_2->setObjectName(QString::fromUtf8("buttonGroup_2"));
|
||||
buttonGroup_2->addButton(radioButton_bartlettTarget);
|
||||
radioButton_bartlettTarget->setObjectName(QString::fromUtf8("radioButton_bartlettTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_bartlettTarget, 3, 0, 1, 1);
|
||||
|
||||
radioButton_blackmanTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_blackmanTarget);
|
||||
radioButton_blackmanTarget->setObjectName(QString::fromUtf8("radioButton_blackmanTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_blackmanTarget, 4, 0, 1, 1);
|
||||
|
||||
radioButton_gaussianTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_gaussianTarget);
|
||||
radioButton_gaussianTarget->setObjectName(QString::fromUtf8("radioButton_gaussianTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_gaussianTarget, 2, 1, 1, 1);
|
||||
|
||||
radioButton_hammingTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_hammingTarget);
|
||||
radioButton_hammingTarget->setObjectName(QString::fromUtf8("radioButton_hammingTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_hammingTarget, 3, 1, 1, 1);
|
||||
|
||||
radioButton_hannTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_hannTarget);
|
||||
radioButton_hannTarget->setObjectName(QString::fromUtf8("radioButton_hannTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_hannTarget, 4, 1, 1, 1);
|
||||
|
||||
radioButton_flattopTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_flattopTarget);
|
||||
radioButton_flattopTarget->setObjectName(QString::fromUtf8("radioButton_flattopTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_flattopTarget, 5, 0, 1, 1);
|
||||
|
||||
radioButton_dodgyTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_dodgyTarget);
|
||||
radioButton_dodgyTarget->setObjectName(QString::fromUtf8("radioButton_dodgyTarget"));
|
||||
radioButton_dodgyTarget->setChecked(true);
|
||||
|
||||
gridLayout_2->addWidget(radioButton_dodgyTarget, 2, 0, 1, 1);
|
||||
|
||||
radioButton_rectangleTarget = new QRadioButton(controlTab);
|
||||
buttonGroup_2->addButton(radioButton_rectangleTarget);
|
||||
radioButton_rectangleTarget->setObjectName(QString::fromUtf8("radioButton_rectangleTarget"));
|
||||
|
||||
gridLayout_2->addWidget(radioButton_rectangleTarget, 5, 1, 1, 1);
|
||||
|
||||
horizontalLayout_23 = new QHBoxLayout();
|
||||
horizontalLayout_23->setObjectName(QString::fromUtf8("horizontalLayout_23"));
|
||||
label_14 = new QLabel(controlTab);
|
||||
label_14->setObjectName(QString::fromUtf8("label_14"));
|
||||
|
||||
gridLayout_2->addWidget(label_14, 1, 0, 1, 1);
|
||||
horizontalLayout_23->addWidget(label_14);
|
||||
|
||||
comboBoxTargetShape = new QComboBox(controlTab);
|
||||
comboBoxTargetShape->setObjectName(QString::fromUtf8("comboBoxTargetShape"));
|
||||
|
||||
horizontalLayout_23->addWidget(comboBoxTargetShape);
|
||||
|
||||
|
||||
verticalLayout_6->addLayout(gridLayout_2);
|
||||
verticalLayout_6->addLayout(horizontalLayout_23);
|
||||
|
||||
pushButtonGenerateTarget = new QPushButton(controlTab);
|
||||
pushButtonGenerateTarget->setObjectName(QString::fromUtf8("pushButtonGenerateTarget"));
|
||||
@ -793,10 +703,23 @@ public:
|
||||
|
||||
verticalLayout_2->addWidget(label_3);
|
||||
|
||||
listWidgetSounds = new QListWidget(controlTab);
|
||||
listWidgetSounds->setObjectName(QString::fromUtf8("listWidgetSounds"));
|
||||
scrollArea = new QScrollArea(controlTab);
|
||||
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
|
||||
scrollArea->setMinimumSize(QSize(0, 200));
|
||||
scrollArea->setWidgetResizable(true);
|
||||
scrollAreaWidgetContents = new QWidget();
|
||||
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
|
||||
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 259, 198));
|
||||
verticalLayout_5 = new QVBoxLayout(scrollAreaWidgetContents);
|
||||
verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5"));
|
||||
brain_contents = new QVBoxLayout();
|
||||
brain_contents->setObjectName(QString::fromUtf8("brain_contents"));
|
||||
|
||||
verticalLayout_2->addWidget(listWidgetSounds);
|
||||
verticalLayout_5->addLayout(brain_contents);
|
||||
|
||||
scrollArea->setWidget(scrollAreaWidgetContents);
|
||||
|
||||
verticalLayout_2->addWidget(scrollArea);
|
||||
|
||||
horizontalLayout_2 = new QHBoxLayout();
|
||||
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
|
||||
@ -806,20 +729,14 @@ public:
|
||||
|
||||
horizontalLayout_2->addWidget(pushButtonLoadSound);
|
||||
|
||||
pushButtonDeleteSound = new QPushButton(controlTab);
|
||||
pushButtonDeleteSound->setObjectName(QString::fromUtf8("pushButtonDeleteSound"));
|
||||
pushButtonDeleteSound->setFont(font);
|
||||
|
||||
horizontalLayout_2->addWidget(pushButtonDeleteSound);
|
||||
|
||||
|
||||
verticalLayout_2->addLayout(horizontalLayout_2);
|
||||
|
||||
pushButtonClearBrain = new QPushButton(controlTab);
|
||||
pushButtonClearBrain->setObjectName(QString::fromUtf8("pushButtonClearBrain"));
|
||||
pushButtonClearBrain->setFont(font);
|
||||
|
||||
verticalLayout_2->addWidget(pushButtonClearBrain);
|
||||
horizontalLayout_2->addWidget(pushButtonClearBrain);
|
||||
|
||||
|
||||
verticalLayout_2->addLayout(horizontalLayout_2);
|
||||
|
||||
horizontalLayout_4 = new QHBoxLayout();
|
||||
horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
|
||||
@ -858,66 +775,20 @@ public:
|
||||
|
||||
verticalLayout_2->addLayout(horizontalLayout_6);
|
||||
|
||||
gridLayout = new QGridLayout();
|
||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||
radioButton_gaussian = new QRadioButton(controlTab);
|
||||
buttonGroup = new QButtonGroup(MainWindow);
|
||||
buttonGroup->setObjectName(QString::fromUtf8("buttonGroup"));
|
||||
buttonGroup->addButton(radioButton_gaussian);
|
||||
radioButton_gaussian->setObjectName(QString::fromUtf8("radioButton_gaussian"));
|
||||
horizontalLayout_24 = new QHBoxLayout();
|
||||
horizontalLayout_24->setObjectName(QString::fromUtf8("horizontalLayout_24"));
|
||||
label_15 = new QLabel(controlTab);
|
||||
label_15->setObjectName(QString::fromUtf8("label_15"));
|
||||
|
||||
gridLayout->addWidget(radioButton_gaussian, 3, 1, 1, 1);
|
||||
horizontalLayout_24->addWidget(label_15);
|
||||
|
||||
radioButton_hamming = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_hamming);
|
||||
radioButton_hamming->setObjectName(QString::fromUtf8("radioButton_hamming"));
|
||||
comboBoxBrainShape = new QComboBox(controlTab);
|
||||
comboBoxBrainShape->setObjectName(QString::fromUtf8("comboBoxBrainShape"));
|
||||
|
||||
gridLayout->addWidget(radioButton_hamming, 4, 1, 1, 1);
|
||||
|
||||
radioButton_dodgy = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_dodgy);
|
||||
radioButton_dodgy->setObjectName(QString::fromUtf8("radioButton_dodgy"));
|
||||
radioButton_dodgy->setChecked(true);
|
||||
|
||||
gridLayout->addWidget(radioButton_dodgy, 3, 0, 1, 1);
|
||||
|
||||
radioButton_blackman = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_blackman);
|
||||
radioButton_blackman->setObjectName(QString::fromUtf8("radioButton_blackman"));
|
||||
|
||||
gridLayout->addWidget(radioButton_blackman, 5, 0, 1, 1);
|
||||
|
||||
radioButton_rectagle = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_rectagle);
|
||||
radioButton_rectagle->setObjectName(QString::fromUtf8("radioButton_rectagle"));
|
||||
|
||||
gridLayout->addWidget(radioButton_rectagle, 6, 1, 1, 1);
|
||||
|
||||
radioButton_bartlett = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_bartlett);
|
||||
radioButton_bartlett->setObjectName(QString::fromUtf8("radioButton_bartlett"));
|
||||
|
||||
gridLayout->addWidget(radioButton_bartlett, 4, 0, 1, 1);
|
||||
|
||||
radioButton_flattop = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_flattop);
|
||||
radioButton_flattop->setObjectName(QString::fromUtf8("radioButton_flattop"));
|
||||
|
||||
gridLayout->addWidget(radioButton_flattop, 6, 0, 1, 1);
|
||||
|
||||
radioButton_hann = new QRadioButton(controlTab);
|
||||
buttonGroup->addButton(radioButton_hann);
|
||||
radioButton_hann->setObjectName(QString::fromUtf8("radioButton_hann"));
|
||||
|
||||
gridLayout->addWidget(radioButton_hann, 5, 1, 1, 1);
|
||||
|
||||
label_4 = new QLabel(controlTab);
|
||||
label_4->setObjectName(QString::fromUtf8("label_4"));
|
||||
|
||||
gridLayout->addWidget(label_4, 2, 0, 1, 1);
|
||||
horizontalLayout_24->addWidget(comboBoxBrainShape);
|
||||
|
||||
|
||||
verticalLayout_2->addLayout(gridLayout);
|
||||
verticalLayout_2->addLayout(horizontalLayout_24);
|
||||
|
||||
pushButtonGenerate = new QPushButton(controlTab);
|
||||
pushButtonGenerate->setObjectName(QString::fromUtf8("pushButtonGenerate"));
|
||||
@ -1054,56 +925,35 @@ public:
|
||||
QObject::connect(dialVolume, SIGNAL(sliderMoved(int)), MainWindow, SLOT(volume_slot(int)));
|
||||
QObject::connect(pushButtonStopRecord, SIGNAL(released()), MainWindow, SLOT(stop_record()));
|
||||
QObject::connect(pushButtonRecord, SIGNAL(released()), MainWindow, SLOT(record()));
|
||||
QObject::connect(radioButton_dodgyTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_dodgy(bool)));
|
||||
QObject::connect(radioButton_blackmanTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_blackman(bool)));
|
||||
QObject::connect(spinBoxFFT1End, SIGNAL(valueChanged(int)), MainWindow, SLOT(fft1_end_slot(int)));
|
||||
QObject::connect(doubleSpinBoxRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(ratio_slot(double)));
|
||||
QObject::connect(radioButton_hannTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_hann(bool)));
|
||||
QObject::connect(radioButton_gaussianTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_gaussian(bool)));
|
||||
QObject::connect(sliderSynapses, SIGNAL(valueChanged(int)), spinBoxSynapses, SLOT(setValue(int)));
|
||||
QObject::connect(doubleSpinBoxTargetMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(target_mix_slot(double)));
|
||||
QObject::connect(pushButtonGenerateTarget, SIGNAL(released()), MainWindow, SLOT(generate_target_blocks()));
|
||||
QObject::connect(spinBoxBlockSizeTarget, SIGNAL(valueChanged(int)), MainWindow, SLOT(target_block_size(int)));
|
||||
QObject::connect(pushButtonLoadTarget, SIGNAL(released()), MainWindow, SLOT(load_target()));
|
||||
QObject::connect(spinBoxFFT1Start, SIGNAL(valueChanged(int)), MainWindow, SLOT(fft1_start_slot(int)));
|
||||
QObject::connect(radioButton_hammingTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_hamming(bool)));
|
||||
QObject::connect(radioButton_flattopTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_flattop(bool)));
|
||||
QObject::connect(radioButton_bartlettTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_bartlett(bool)));
|
||||
QObject::connect(doubleSpinBoxBlockOverlapTarget, SIGNAL(valueChanged(double)), MainWindow, SLOT(target_block_overlap(double)));
|
||||
QObject::connect(radioButton_rectangleTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_rectangle(bool)));
|
||||
QObject::connect(spinBoxSynapses, SIGNAL(valueChanged(int)), sliderSynapses, SLOT(setValue(int)));
|
||||
QObject::connect(spinBoxSynapses, SIGNAL(valueChanged(int)), MainWindow, SLOT(synapses(int)));
|
||||
QObject::connect(sliderRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(ratio_slot(int)));
|
||||
QObject::connect(sliderNRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_ratio_slot(int)));
|
||||
QObject::connect(doubleSpinBoxNRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_ratio_slot(double)));
|
||||
QObject::connect(radioButton_dodgy, SIGNAL(toggled(bool)), MainWindow, SLOT(window_dodgy(bool)));
|
||||
QObject::connect(sliderTargetMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(target_mix_slot(int)));
|
||||
QObject::connect(sliderNMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_mix_slot(int)));
|
||||
QObject::connect(doubleSpinBoxNMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_mix_slot(double)));
|
||||
QObject::connect(pushButtonLoadBrain, SIGNAL(released()), MainWindow, SLOT(load_brain()));
|
||||
QObject::connect(radioButtonSynaptic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_synaptic(bool)));
|
||||
QObject::connect(doubleSpinBoxBoredom, SIGNAL(valueChanged(double)), MainWindow, SLOT(boredom_slot(double)));
|
||||
QObject::connect(doubleSpinBoxNovelty, SIGNAL(valueChanged(double)), MainWindow, SLOT(novelty_slot(double)));
|
||||
QObject::connect(sliderNovelty, SIGNAL(valueChanged(int)), MainWindow, SLOT(novelty_slot(int)));
|
||||
QObject::connect(sliderBoredom, SIGNAL(valueChanged(int)), MainWindow, SLOT(boredom_slot(int)));
|
||||
QObject::connect(radioButton_bartlett, SIGNAL(toggled(bool)), MainWindow, SLOT(window_bartlett(bool)));
|
||||
QObject::connect(radioButton_blackman, SIGNAL(toggled(bool)), MainWindow, SLOT(window_blackman(bool)));
|
||||
QObject::connect(sliderSynapses, SIGNAL(valueChanged(int)), MainWindow, SLOT(synapses(int)));
|
||||
QObject::connect(radioButtonSynapticSlide, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_synaptic_slide(bool)));
|
||||
QObject::connect(spinBoxBlockSize, SIGNAL(valueChanged(int)), MainWindow, SLOT(block_size(int)));
|
||||
QObject::connect(doubleSpinBoxBlockOverlap, SIGNAL(valueChanged(double)), MainWindow, SLOT(block_overlap(double)));
|
||||
QObject::connect(radioButton_gaussian, SIGNAL(toggled(bool)), MainWindow, SLOT(window_gaussian(bool)));
|
||||
QObject::connect(radioButton_flattop, SIGNAL(toggled(bool)), MainWindow, SLOT(window_flattop(bool)));
|
||||
QObject::connect(radioButtonAlgoBasic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_basic(bool)));
|
||||
QObject::connect(radioButtonAlgoRevBasic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_rev_basic(bool)));
|
||||
QObject::connect(radioButton_rectagle, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_rectangle(bool)));
|
||||
QObject::connect(radioButton_hamming, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hamming(bool)));
|
||||
QObject::connect(pushButtonSaveBrain, SIGNAL(released()), MainWindow, SLOT(save_brain()));
|
||||
QObject::connect(pushButtonDeleteSound, SIGNAL(released()), MainWindow, SLOT(delete_sound()));
|
||||
QObject::connect(pushButtonClearBrain, SIGNAL(released()), MainWindow, SLOT(clear_brain()));
|
||||
QObject::connect(pushButtonGenerate, SIGNAL(released()), MainWindow, SLOT(generate()));
|
||||
QObject::connect(pushButtonLoadSound, SIGNAL(released()), MainWindow, SLOT(load_sound()));
|
||||
QObject::connect(radioButton_hann, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hann(bool)));
|
||||
QObject::connect(sliderSearchStretch, SIGNAL(valueChanged(int)), spinBoxSearchStretch, SLOT(setValue(int)));
|
||||
QObject::connect(spinBoxSearchStretch, SIGNAL(valueChanged(int)), sliderSearchStretch, SLOT(setValue(int)));
|
||||
QObject::connect(sliderSearchStretch, SIGNAL(valueChanged(int)), MainWindow, SLOT(search_stretch(int)));
|
||||
@ -1117,6 +967,9 @@ public:
|
||||
QObject::connect(pushButtonLoadSession, SIGNAL(released()), MainWindow, SLOT(load_session()));
|
||||
QObject::connect(pushButtonSaveSession, SIGNAL(released()), MainWindow, SLOT(save_session()));
|
||||
QObject::connect(checkBoxStereo, SIGNAL(clicked(bool)), MainWindow, SLOT(stereo_mode(bool)));
|
||||
QObject::connect(comboBoxAlgorithm, SIGNAL(currentIndexChanged(int)), MainWindow, SLOT(algo(int)));
|
||||
QObject::connect(comboBoxTargetShape, SIGNAL(currentIndexChanged(int)), MainWindow, SLOT(target_shape(int)));
|
||||
QObject::connect(comboBoxBrainShape, SIGNAL(currentIndexChanged(int)), MainWindow, SLOT(brain_shape(int)));
|
||||
|
||||
tabWidget->setCurrentIndex(0);
|
||||
|
||||
@ -1126,7 +979,7 @@ public:
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.15", 0, QApplication::UnicodeUTF8));
|
||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.16", 0, QApplication::UnicodeUTF8));
|
||||
label_19->setText(QApplication::translate("MainWindow", "brain tweaks", 0, QApplication::UnicodeUTF8));
|
||||
label_6->setText(QApplication::translate("MainWindow", "fft / mfcc", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
@ -1179,23 +1032,14 @@ public:
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
spinBoxSearchStretch->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
label_27->setText(QApplication::translate("MainWindow", "algorithm", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
radioButtonAlgoBasic->setToolTip(QApplication::translate("MainWindow", "full brain search", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
radioButtonAlgoBasic->setText(QApplication::translate("MainWindow", "basic", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
radioButtonAlgoRevBasic->setToolTip(QApplication::translate("MainWindow", "full brain reverse search", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
radioButtonAlgoRevBasic->setText(QApplication::translate("MainWindow", "rev basic", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
radioButtonSynaptic->setToolTip(QApplication::translate("MainWindow", "search based on synapse connections", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
radioButtonSynaptic->setText(QApplication::translate("MainWindow", "synaptic", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
radioButtonSynapticSlide->setToolTip(QApplication::translate("MainWindow", "search based on synapses and sonify search process", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
radioButtonSynapticSlide->setText(QApplication::translate("MainWindow", "synaptic slide", 0, QApplication::UnicodeUTF8));
|
||||
label_32->setText(QApplication::translate("MainWindow", "algorithm", 0, QApplication::UnicodeUTF8));
|
||||
comboBoxAlgorithm->clear();
|
||||
comboBoxAlgorithm->insertItems(0, QStringList()
|
||||
<< QApplication::translate("MainWindow", "basic", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "reversed", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "synaptic", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "slide", 0, QApplication::UnicodeUTF8)
|
||||
);
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
label_26->setToolTip(QString());
|
||||
#endif // QT_NO_TOOLTIP
|
||||
@ -1220,22 +1064,25 @@ public:
|
||||
pushButtonLoadTarget->setText(QApplication::translate("MainWindow", "load target", 0, QApplication::UnicodeUTF8));
|
||||
label_17->setText(QApplication::translate("MainWindow", "block size", 0, QApplication::UnicodeUTF8));
|
||||
label_18->setText(QApplication::translate("MainWindow", "block overlap", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_bartlettTarget->setText(QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_blackmanTarget->setText(QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_gaussianTarget->setText(QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_hammingTarget->setText(QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_hannTarget->setText(QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_flattopTarget->setText(QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_dodgyTarget->setText(QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_rectangleTarget->setText(QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8));
|
||||
label_14->setText(QApplication::translate("MainWindow", "window shape", 0, QApplication::UnicodeUTF8));
|
||||
comboBoxTargetShape->clear();
|
||||
comboBoxTargetShape->insertItems(0, QStringList()
|
||||
<< QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8)
|
||||
);
|
||||
pushButtonGenerateTarget->setText(QApplication::translate("MainWindow", "(re)generate blocks", 0, QApplication::UnicodeUTF8));
|
||||
label_23->setText(QApplication::translate("MainWindow", "mix", 0, QApplication::UnicodeUTF8));
|
||||
label_31->setText(QApplication::translate("MainWindow", "autotune", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
sliderAutotune->setToolTip(QApplication::translate("MainWindow", "amount to match the frequency", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
label_21->setText(QApplication::translate("MainWindow", "dynamic / normalised ", 0, QApplication::UnicodeUTF8));
|
||||
label_21->setText(QApplication::translate("MainWindow", "normalised ", 0, QApplication::UnicodeUTF8));
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
sliderNMix->setToolTip(QApplication::translate("MainWindow", "mix in the normalised blocks", 0, QApplication::UnicodeUTF8));
|
||||
#endif // QT_NO_TOOLTIP
|
||||
@ -1246,19 +1093,21 @@ public:
|
||||
checkBoxStereo->setText(QApplication::translate("MainWindow", "stereo mode", 0, QApplication::UnicodeUTF8));
|
||||
label_3->setText(QApplication::translate("MainWindow", "brain contents", 0, QApplication::UnicodeUTF8));
|
||||
pushButtonLoadSound->setText(QApplication::translate("MainWindow", "load sound", 0, QApplication::UnicodeUTF8));
|
||||
pushButtonDeleteSound->setText(QApplication::translate("MainWindow", "delete selected", 0, QApplication::UnicodeUTF8));
|
||||
pushButtonClearBrain->setText(QApplication::translate("MainWindow", "clear brain", 0, QApplication::UnicodeUTF8));
|
||||
label->setText(QApplication::translate("MainWindow", "block size", 0, QApplication::UnicodeUTF8));
|
||||
label_2->setText(QApplication::translate("MainWindow", "block overlap", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_gaussian->setText(QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_hamming->setText(QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_dodgy->setText(QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_blackman->setText(QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_rectagle->setText(QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_bartlett->setText(QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_flattop->setText(QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8));
|
||||
radioButton_hann->setText(QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8));
|
||||
label_4->setText(QApplication::translate("MainWindow", "window shape", 0, QApplication::UnicodeUTF8));
|
||||
label_15->setText(QApplication::translate("MainWindow", "window shape", 0, QApplication::UnicodeUTF8));
|
||||
comboBoxBrainShape->clear();
|
||||
comboBoxBrainShape->insertItems(0, QStringList()
|
||||
<< QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8)
|
||||
);
|
||||
pushButtonGenerate->setText(QApplication::translate("MainWindow", "(re)generate brain", 0, QApplication::UnicodeUTF8));
|
||||
pushButtonLoadBrain->setText(QApplication::translate("MainWindow", "load brain", 0, QApplication::UnicodeUTF8));
|
||||
pushButtonSaveBrain->setText(QApplication::translate("MainWindow", "save brain", 0, QApplication::UnicodeUTF8));
|
||||
@ -1281,4 +1130,4 @@ namespace Ui {
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // SAMPLEBRAINZ17592_H
|
||||
#endif // SAMPLEBRAINU19467_H
|
||||
|
@ -67,6 +67,19 @@ void process_thread::process() {
|
||||
m_source.delete_sound(cmd.get_string(0));
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/activate_sound") {
|
||||
cerr<<"recieved activate"<<endl;
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.activate_sound(cmd.get_string(0),1);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/deactivate_sound") {
|
||||
cerr<<"recieved deactivate"<<endl;
|
||||
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.activate_sound(cmd.get_string(0),0);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/source_block_size") {
|
||||
m_source_block_size = cmd.get_int(0);
|
||||
}
|
||||
@ -157,6 +170,9 @@ void process_thread::load_session(const std::string &filename) {
|
||||
ifs||m_source_block_size||m_source_overlap;
|
||||
ifs||m_target_block_size||m_target_overlap;
|
||||
ifs||m_window_type||m_target_window_type;
|
||||
|
||||
cerr<<"loading window type session "<<m_target_window_type<<endl;
|
||||
|
||||
ifs||m_source;
|
||||
ifs||m_left_target;
|
||||
ifs||m_right_target;
|
||||
@ -173,6 +189,9 @@ void process_thread::save_session(const std::string &filename) {
|
||||
ofs||(*m_right_renderer);
|
||||
ofs||m_source_block_size||m_source_overlap;
|
||||
ofs||m_target_block_size||m_target_overlap;
|
||||
|
||||
cerr<<"saving window type session "<<m_target_window_type<<endl;
|
||||
|
||||
ofs||m_window_type||m_target_window_type;
|
||||
ofs||m_source;
|
||||
ofs||m_left_target;
|
||||
|
@ -80,12 +80,24 @@ void brain::delete_sound(std::string filename) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
recompute_sample_sections();
|
||||
}
|
||||
|
||||
void brain::activate_sound(std::string filename, bool active) {
|
||||
for (vector<sample_section>::iterator i=m_sample_sections.begin();
|
||||
i!=m_sample_sections.end(); ++i) {
|
||||
if (filename==i->m_filename) {
|
||||
i->m_enabled=active;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void brain::clear() {
|
||||
m_blocks.clear();
|
||||
m_samples.clear();
|
||||
m_active_sounds.clear();
|
||||
m_sample_sections.clear();
|
||||
}
|
||||
|
||||
// rewrites whole brain
|
||||
@ -103,16 +115,40 @@ void brain::init(u32 block_size, u32 overlap, window::type t, bool ditchpcm) {
|
||||
status::update("all samples processed");
|
||||
}
|
||||
|
||||
void brain::chop_and_add(const sound &s, u32 count, bool ditchpcm) {
|
||||
u32 pos=0;
|
||||
if (m_overlap>=m_block_size) m_overlap=0;
|
||||
while (pos+m_block_size-1<s.m_sample.get_length()) {
|
||||
status::update("processing sample %d: %d%%",count,(int)(pos/(float)s.m_sample.get_length()*100));
|
||||
sample region;
|
||||
s.m_sample.get_region(region,pos,pos+m_block_size-1);
|
||||
m_blocks.push_back(block(m_blocks.size(),s.m_filename,region,44100,m_window,ditchpcm));
|
||||
pos += (m_block_size-m_overlap);
|
||||
}
|
||||
void brain::chop_and_add(sound &s, u32 count, bool ditchpcm) {
|
||||
sample_section ss;
|
||||
ss.m_filename = s.m_filename;
|
||||
ss.m_enabled = true;
|
||||
ss.m_start = m_blocks.size();
|
||||
u32 pos=0;
|
||||
if (m_overlap>=m_block_size) m_overlap=0;
|
||||
while (pos+m_block_size-1<s.m_sample.get_length()) {
|
||||
status::update("processing sample %d: %d%%",count,(int)(pos/(float)s.m_sample.get_length()*100));
|
||||
sample region;
|
||||
s.m_sample.get_region(region,pos,pos+m_block_size-1);
|
||||
m_blocks.push_back(block(m_blocks.size(),s.m_filename,region,44100,m_window,ditchpcm));
|
||||
pos += (m_block_size-m_overlap);
|
||||
}
|
||||
ss.m_end = m_blocks.size()-1;
|
||||
cerr<<"adding sample section "<<ss.m_start<<" "<<ss.m_end<<endl;
|
||||
s.m_num_blocks = ss.m_end-ss.m_start;
|
||||
|
||||
m_sample_sections.push_back(ss);
|
||||
}
|
||||
|
||||
// needed after we delete a sample from the brain
|
||||
void brain::recompute_sample_sections() {
|
||||
m_sample_sections.clear();
|
||||
u32 pos=0;
|
||||
for (auto s : m_samples) {
|
||||
sample_section ss;
|
||||
ss.m_filename = s.m_filename;
|
||||
ss.m_enabled = true;
|
||||
ss.m_start = pos;
|
||||
pos += s.m_num_blocks;
|
||||
ss.m_end = pos;
|
||||
m_sample_sections.push_back(ss);
|
||||
}
|
||||
}
|
||||
|
||||
const block &brain::get_block(u32 index) const {
|
||||
@ -143,14 +179,18 @@ u32 brain::stickify(const block &target, u32 closest_index, f32 dist, const sear
|
||||
u32 brain::search(const block &target, const search_params ¶ms) {
|
||||
double closest = FLT_MAX;
|
||||
u32 closest_index = 0;
|
||||
u32 index = 0;
|
||||
for (auto b : m_blocks) {
|
||||
double diff = target.compare(b,params);
|
||||
if (diff<closest) {
|
||||
// check each sample section
|
||||
for (auto ss : m_sample_sections) {
|
||||
if (ss.m_enabled) { // are we turned on?
|
||||
// loop through indexes for this section
|
||||
for (u32 i=ss.m_start; i<ss.m_end; ++i) {
|
||||
double diff = target.compare(m_blocks[i],params);
|
||||
if (diff<closest) {
|
||||
closest=diff;
|
||||
closest_index = index;
|
||||
closest_index = i;
|
||||
}
|
||||
}
|
||||
++index;
|
||||
}
|
||||
}
|
||||
deplete_usage();
|
||||
m_blocks[closest_index].get_usage()+=usage_factor;
|
||||
@ -161,16 +201,19 @@ u32 brain::search(const block &target, const search_params ¶ms) {
|
||||
u32 brain::rev_search(const block &target, const search_params ¶ms) {
|
||||
double furthest = 0;
|
||||
u32 furthest_index = 0;
|
||||
u32 index = 0;
|
||||
for (auto b:m_blocks) {
|
||||
double diff = target.compare(b,params);
|
||||
if (diff>furthest) {
|
||||
// check each sample section
|
||||
for (auto ss : m_sample_sections) {
|
||||
if (ss.m_enabled) { // are we turned on?
|
||||
// loop through indexes for this section
|
||||
for (u32 i=ss.m_start; i<ss.m_end; ++i) {
|
||||
double diff = target.compare(m_blocks[i],params);
|
||||
if (diff>furthest) {
|
||||
furthest=diff;
|
||||
furthest_index = index;
|
||||
furthest_index = i;
|
||||
}
|
||||
}
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
deplete_usage();
|
||||
m_blocks[furthest_index].get_usage()+=usage_factor;
|
||||
m_current_block_index = furthest_index;
|
||||
@ -252,7 +295,7 @@ void brain::build_synapses_fixed(search_params ¶ms) {
|
||||
status::update("Done: %d synapses grown for %d blocks",num_synapses*brain_size,brain_size);
|
||||
}
|
||||
|
||||
|
||||
// randomise the current block
|
||||
void brain::jiggle() {
|
||||
if (m_blocks.size()>0) {
|
||||
m_current_block_index=rand()%m_blocks.size();
|
||||
@ -261,6 +304,15 @@ void brain::jiggle() {
|
||||
}
|
||||
}
|
||||
|
||||
bool brain::is_block_active(u32 index) {
|
||||
// check each sample section
|
||||
for (auto ss : m_sample_sections) {
|
||||
if (index>=ss.m_start && index<ss.m_end && ss.m_enabled) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 brain::search_synapses(const block &target, search_params ¶ms) {
|
||||
const block ¤t = get_block(m_current_block_index);
|
||||
@ -281,14 +333,16 @@ u32 brain::search_synapses(const block &target, search_params ¶ms) {
|
||||
synapse_count<params.m_num_synapses) {
|
||||
//assert(*i<m_blocks.size());
|
||||
|
||||
if (is_block_active(*i)) {
|
||||
const block &other = get_block(*i);
|
||||
double diff = target.compare(other,params);
|
||||
if (diff<closest) {
|
||||
closest=diff;
|
||||
closest_index = *i;
|
||||
closest=diff;
|
||||
closest_index = *i;
|
||||
}
|
||||
++i;
|
||||
++synapse_count;
|
||||
}
|
||||
++i;
|
||||
++synapse_count;
|
||||
}
|
||||
|
||||
deplete_usage();
|
||||
@ -338,15 +392,26 @@ void brain::deplete_usage() {
|
||||
*/
|
||||
|
||||
ios &spiralcore::operator||(ios &s, brain::sound &b) {
|
||||
u32 version=0;
|
||||
u32 version=1;
|
||||
string id("brain::sound");
|
||||
s||id||version;
|
||||
s||b.m_filename||b.m_sample;
|
||||
if (version>0) {
|
||||
s||b.m_num_blocks;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
ios &spiralcore::operator||(ios &s, brain::sample_section &b) {
|
||||
u32 version=1;
|
||||
string id("sample_section");
|
||||
s||id||version;
|
||||
s||b.m_filename||b.m_enabled||b.m_start||b.m_end;
|
||||
return s;
|
||||
}
|
||||
|
||||
ios &spiralcore::operator||(ios &s, brain &b) {
|
||||
u32 version=0;
|
||||
u32 version=1;
|
||||
string id("brain");
|
||||
// changes here need to be reflected in interface loading
|
||||
s||id||version;
|
||||
@ -355,6 +420,9 @@ ios &spiralcore::operator||(ios &s, brain &b) {
|
||||
s||b.m_block_size||b.m_overlap||b.m_window;
|
||||
s||b.m_current_block_index||b.m_current_error||
|
||||
b.m_average_error||b.m_usage_falloff;
|
||||
if (version>0) {
|
||||
stream_vector(s,b.m_sample_sections);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -37,20 +37,6 @@ public:
|
||||
// rewrites whole brain
|
||||
void init(u32 block_size, u32 overlap, window::type t, bool ditchpcm=false);
|
||||
|
||||
// randomise the synaptic pointer
|
||||
void jiggle();
|
||||
|
||||
class sound {
|
||||
public:
|
||||
sound(const std::string &name, const sample &sample) :
|
||||
m_filename(name), m_sample(sample) {}
|
||||
|
||||
sound() {}; // needed for streaming
|
||||
|
||||
std::string m_filename;
|
||||
sample m_sample;
|
||||
};
|
||||
|
||||
void clear();
|
||||
|
||||
// load, chop up and add to brain
|
||||
@ -58,12 +44,9 @@ public:
|
||||
void load_sound(std::string filename, stereo_mode mode);
|
||||
void delete_sound(std::string filename);
|
||||
void clear_sounds() { m_samples.clear(); }
|
||||
// take another brain and rebuild this brain from bits of that one
|
||||
// (presumably this one is made from a single sample)
|
||||
//void resynth(const std::string &filename, const brain &other, const search_params ¶ms);
|
||||
// turns on/off a sound in realtime without reprocessing
|
||||
void activate_sound(std::string filename, bool active);
|
||||
|
||||
|
||||
const std::list<sound> &get_samples() { return m_samples; }
|
||||
const sample &get_block_pcm(u32 index) const;
|
||||
const sample &get_block_n_pcm(u32 index) const;
|
||||
const block &get_block(u32 index) const;
|
||||
@ -84,20 +67,49 @@ public:
|
||||
void build_synapses_fixed(search_params ¶ms);
|
||||
u32 search_synapses(const block &target, search_params ¶ms);
|
||||
double get_current_error() { return m_current_error; }
|
||||
// randomise the synaptic pointer
|
||||
void jiggle();
|
||||
|
||||
static bool unit_test();
|
||||
|
||||
friend ios &operator||(ios &s, brain &b);
|
||||
class sound {
|
||||
public:
|
||||
sound(const std::string &name, const sample &sample) :
|
||||
m_filename(name), m_sample(sample), m_num_blocks(0) {}
|
||||
sound() {}; // needed for streaming
|
||||
std::string m_filename;
|
||||
sample m_sample;
|
||||
// filled in during chop_and_add
|
||||
u32 m_num_blocks;
|
||||
};
|
||||
|
||||
const std::list<sound> &get_samples() { return m_samples; }
|
||||
|
||||
private:
|
||||
|
||||
void chop_and_add(const sound &s, u32 count, bool ditchpcm=false);
|
||||
void chop_and_add(sound &s, u32 count, bool ditchpcm=false);
|
||||
void deplete_usage();
|
||||
u32 stickify(const block &target, u32 closest_index, f32 dist, const search_params ¶ms);
|
||||
void recompute_sample_sections();
|
||||
// checks sample sections
|
||||
bool is_block_active(u32 index);
|
||||
|
||||
// we store the blocks in a flat list, so we can directly index
|
||||
// them, but we need to filter them by source sound - so we need
|
||||
// to be able to turn large contiguous sets of them on and off
|
||||
// (without a big impact on the processing time)
|
||||
class sample_section {
|
||||
public:
|
||||
std::string m_filename;
|
||||
bool m_enabled;
|
||||
u32 m_start,m_end;
|
||||
};
|
||||
|
||||
vector<block> m_blocks;
|
||||
std::list<sound> m_samples;
|
||||
vector<string> m_active_sounds;
|
||||
vector<sample_section> m_sample_sections;
|
||||
|
||||
|
||||
u32 m_block_size;
|
||||
u32 m_overlap;
|
||||
@ -108,9 +120,15 @@ private:
|
||||
double m_current_error;
|
||||
double m_average_error;
|
||||
float m_usage_falloff;
|
||||
|
||||
friend ios &operator||(ios &s, brain &b);
|
||||
friend ios &operator||(ios &s, sample_section &b);
|
||||
friend ios &operator||(ios &s, sound &b);
|
||||
|
||||
};
|
||||
|
||||
ios &operator||(ios &s, brain::sound &b);
|
||||
ios &operator||(ios &s, brain::sample_section &b);
|
||||
ios &operator||(ios &s, brain &b);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user