IndiWidgetGroup::IndiWidgetGroup(const QString& name, FClass* parent) : FWidget(parent, FUNC) , mSetName("") , mBars(0) { init(); loadSetup(name); }
bool Pipeline::load() { std::string path = getPath(); std::string directory = core::FileSystem::getDirectory(path); // Parse XML file TiXmlDocument xml(path.c_str()); if (!loadResourceFile(xml)) { finishLoading(false); return false; } // Load XML file TiXmlNode *root = xml.FirstChild("Pipeline"); if (!root) { getManager()->getLog()->error("%s: <Pipeline> not found.", getName().c_str()); finishLoading(false); return false; } // Load render target setup TiXmlElement *setupelem = root->FirstChildElement("Setup"); if (setupelem) { if (!loadSetup(setupelem)) { finishLoading(false); return false; } } // Load commands TiXmlElement *commandelem = root->FirstChildElement("Commands"); if (!commandelem) { getManager()->getLog()->error("%s: <Commands> not found.", getName().c_str()); finishLoading(false); return false; } if (!loadCommands(commandelem)) { finishLoading(false); return false; } finishLoading(true); return true; }
/*! \fn SimpleSynthGui::SimpleSynthGui() */ SimpleSynthGui::SimpleSynthGui() { SS_TRACE_IN setupUi(this); simplesynthgui_ptr = this; pluginGui = new SS_PluginGui(this); pluginGui->hide(); for (int i=0; i<SS_NR_OF_CHANNELS; i++) { channelButtonGroups[i] = new QGroupBox(this); // channelButtonGroups[i]->setMinimumSize(SS_BTNGRP_WIDTH, SS_BTNGRP_HEIGHT); channelButtonGroups[i]->setTitle(QString::number(i + 1)); QString name = QString("volumeSlider"); name.append(i + 1); channelLayout->addWidget(channelButtonGroups[i]); QVBoxLayout* inchnlLayout = new QVBoxLayout(channelButtonGroups[i]); //, 2, 0, "channelinternallayout"); inchnlLayout->setAlignment(Qt::AlignHCenter); inchnlLayout->setSpacing(1); inchnlLayout->setMargin(0); onOff[i] = new QChannelCheckbox(channelButtonGroups[i], i); // onOff[i]->setMinimumSize(SS_ONOFF_WIDTH, SS_ONOFF_HEIGHT); onOff[i]->setToolTip("Channel " + QString::number(i + 1) + " on/off"); inchnlLayout->addWidget(onOff[i]); connect(onOff[i], SIGNAL(channelState(int, bool)), SLOT(channelOnOff(int, bool))); ///volumeSliders[i] = new QInvertedChannelSlider(Qt::Vertical, i, channelButtonGroups[i]); // By Tim. p4.0.27 Inverted was not correct type. Maybe was work in progress, rest of code was not converted yet? QHBoxLayout *volLayout = new QHBoxLayout(channelButtonGroups[i]); volumeSliders[i] = new QChannelSlider(Qt::Vertical, i, channelButtonGroups[i]); volumeSliders[i]->setMinimum(SS_VOLUME_MIN_VALUE); volumeSliders[i]->setMaximum(SS_VOLUME_MAX_VALUE); ///volumeSliders[i]->setValue(SS_VOLUME_MAX_VALUE - SS_VOLUME_DEFAULT_VALUE); volumeSliders[i]->setValue(SS_VOLUME_DEFAULT_VALUE); // p4.0.27 // volumeSliders[i]->setMinimumSize(SS_VOLSLDR_WIDTH, SS_VOLSLDR_LENGTH); volumeSliders[i]->setToolTip("Volume, channel " + QString::number(i + 1)); // setMinimumSize(SS_VOLSLDR_WIDTH, SS_VOLSLDR_LENGTH); volLayout->addWidget(volumeSliders[i]); chnMeter[i] = new MusEGui::Meter(channelButtonGroups[i]); chnMeter[i]->setFixedWidth(9); chnMeter[i]->setVal(0.0, 0.0, false); meterVal[i] = peakVal[i] = 0.0; chnMeter[i]->setRange(MusEGlobal::config.minMeter, 10.0); chnMeter[i]->show(); volLayout->addWidget(chnMeter[i]); inchnlLayout->addLayout(volLayout); //inchnlLayout->addWidget(volumeSliders[i]); connect(volumeSliders[i], SIGNAL(valueChanged(int, int)), SLOT(volumeChanged(int, int))); pitchKnobs[i] = new QChannelDial(channelButtonGroups[i], i, 0); pitchKnobs[i]->setRange(-63,63); pitchKnobs[i]->setValue(0); pitchKnobs[i]->setToolTip("Pitch, channel " + QString::number(i + 1)); pitchKnobs[i]->setFixedSize(30,30); inchnlLayout->addWidget(pitchKnobs[i]); connect(pitchKnobs[i], SIGNAL(valueChanged(int,int,int)), SLOT(pitchChanged(int,int, int))); nOffLabel[i] = new QLabel(channelButtonGroups[i]); nOffLabel[i]->setText("nOff"); inchnlLayout->addWidget(nOffLabel[i]); nOffIgnore[i] = new QChannelCheckbox(channelButtonGroups[i], i); nOffIgnore[i]->setToolTip("Note off ignore, channel " + QString::number(i + 1)); inchnlLayout->addWidget(nOffIgnore[i]); connect(nOffIgnore[i], SIGNAL(channelState(int, bool)),SLOT(channelNoteOffIgnore(int, bool))); panSliders[i] = new QChannelSlider(Qt::Horizontal, i, channelButtonGroups[i]); panSliders[i]->setRange(0, 127); panSliders[i]->setValue(SS_PANSLDR_DEFAULT_VALUE); panSliders[i]->setToolTip("Pan, channel " + QString::number(i + 1)); inchnlLayout->addWidget(panSliders[i]); connect(panSliders[i], SIGNAL(valueChanged(int, int)), SLOT(panChanged(int, int))); QGridLayout* dialGrid = new QGridLayout; inchnlLayout->addLayout(dialGrid); sendFxDial[i][0] = new QChannelDial(channelButtonGroups[i], i, 0); sendFxDial[i][0]->setRange(0, 127); sendFxDial[i][0]->setMaximumSize(SS_SENDFX_WIDTH, SS_SENDFX_HEIGHT); sendFxDial[i][0]->setToolTip("Fx 1 send amount"); dialGrid->addWidget(sendFxDial[i][0], 0, 0, Qt::AlignCenter | Qt::AlignTop); connect(sendFxDial[i][0], SIGNAL(valueChanged(int, int, int)), SLOT(sendFxChanged(int, int, int))); sendFxDial[i][1] = new QChannelDial(channelButtonGroups[i], i, 1); sendFxDial[i][1]->setRange(0, 127); dialGrid->addWidget(sendFxDial[i][1], 0, 1, Qt::AlignCenter | Qt::AlignTop); sendFxDial[i][1]->setMaximumSize(SS_SENDFX_WIDTH, SS_SENDFX_HEIGHT); sendFxDial[i][1]->setToolTip("Fx 2 send amount"); connect(sendFxDial[i][1], SIGNAL(valueChanged(int, int, int)), SLOT(sendFxChanged(int, int, int))); sendFxDial[i][2] = new QChannelDial(channelButtonGroups[i], i, 2); sendFxDial[i][2]->setRange(0, 127); sendFxDial[i][2]->setMaximumSize(SS_SENDFX_WIDTH, SS_SENDFX_HEIGHT); dialGrid->addWidget(sendFxDial[i][2], 1, 0, Qt::AlignCenter | Qt::AlignTop); sendFxDial[i][2]->setToolTip("Fx 3 send amount"); connect(sendFxDial[i][2], SIGNAL(valueChanged(int, int, int)), SLOT(sendFxChanged(int, int, int))); sendFxDial[i][3] = new QChannelDial(channelButtonGroups[i], i, 3); sendFxDial[i][3]->setRange(0, 127); sendFxDial[i][3]->setMaximumSize(SS_SENDFX_WIDTH, SS_SENDFX_HEIGHT); sendFxDial[i][3]->setToolTip("Fx 4 send amount"); dialGrid->addWidget(sendFxDial[i][3], 1, 1, Qt::AlignCenter | Qt::AlignTop); connect(sendFxDial[i][3], SIGNAL(valueChanged(int, int, int)), SLOT(sendFxChanged(int, int, int))); chnRoutingCb[i] = new QComboBox(channelButtonGroups[i]); chnRoutingCb[i]->addItem(tr("Mix"), QVariant(0)); chnRoutingCb[i]->addItem(tr("Chn"), QVariant(1)); chnRoutingCb[i]->setMaximumSize(SS_PANSLDR_WIDTH, SS_PANSLDR_LENGTH); chnRoutingCb[i]->setToolTip(tr("Channel routing")); QFont chnRFont; chnRFont.setPointSize(6); chnRoutingCb[i]->setFont(chnRFont); connect(chnRoutingCb[i], SIGNAL(currentIndexChanged(int)), this, SLOT(routeChanged(int))); inchnlLayout->addWidget(chnRoutingCb[i]); inchnlLayout->activate(); } masterSlider = new QSlider(Qt::Vertical, this); masterSlider->setToolTip("Master volume"); channelLayout->addWidget(masterSlider); masterSlider->setRange(0, 127); masterSlider->setValue((int)(SS_MASTERVOL_DEFAULT_VALUE*SS_VOLUME_MAX_VALUE)); // p4.0.27 connect(masterSlider, SIGNAL(valueChanged(int)), SLOT(masterVolChanged(int))); // p4.0.27 int i=0; for (int c=0; c<2; c++) { for (int r=0; r<SS_NR_OF_CHANNELS/2; r++) { QHBoxLayout* strip = new QHBoxLayout; mgbLayout->addLayout(strip, r, c); QLabel* channelLabel = new QLabel(QString::number(i + 1) + ": (" +labelStrings[i] + ")", mainGroupBox); strip->addWidget(channelLabel); sampleNameLineEdit[i] = new QLineEdit(mainGroupBox); sampleNameLineEdit[i]->setReadOnly(true); sampleNameLineEdit[i]->setFixedWidth(180); strip->addWidget(sampleNameLineEdit[i]); loadSampleButton[i] = new QChannelButton(mainGroupBox, "L", i); loadSampleButton[i]->setToolTip("Load sample on channel " + QString::number(i + 1)); loadSampleButton[i]->setFixedSize(23,23); strip->addWidget(loadSampleButton[i]); connect(loadSampleButton[i], SIGNAL(channelState(int, bool)), SLOT(loadSampleDialogue(int))); clearSampleButton[i] = new QChannelButton(mainGroupBox, "C", i); clearSampleButton[i]->setToolTip("Clear sample on channel " + QString::number(i + 1)); clearSampleButton[i]->setFixedSize(23,23); strip->addWidget(clearSampleButton[i]); connect(clearSampleButton[i], SIGNAL(channelState(int, bool)), SLOT(clearSample(int))); i++; } } // Right bottom panel: QGroupBox* rbPanel= new QGroupBox(mainGroupBox); mgbLayout->addWidget(rbPanel, 1, 3, 7, 1, Qt::AlignCenter); QGridLayout* rbLayout = new QGridLayout(rbPanel); openPluginsButton = new QPushButton("&Send Effects"); openPluginsButton->setToolTip("Configure LADSPA send effects"); connect(openPluginsButton, SIGNAL(clicked()), SLOT(openPluginButtonClicked())); rbLayout->addWidget(openPluginsButton, 2, 1, Qt::AlignCenter | Qt::AlignVCenter); rbLayout->setSpacing(0); rbLayout->setMargin(0); aboutButton = new QPushButton("About SimpleDrums"); connect(aboutButton, SIGNAL(clicked()), SLOT(aboutButtonClicked())); rbLayout->addWidget(aboutButton, 4, 1, Qt::AlignLeft | Qt::AlignVCenter); loadButton = new QPushButton(tr("&Load setup"), rbPanel); connect(loadButton, SIGNAL(clicked()), SLOT(loadSetup())); saveButton = new QPushButton(tr("&Save setup"), rbPanel); connect(saveButton, SIGNAL(clicked()), SLOT(saveSetup())); rbLayout->addWidget(loadButton, 3, 1, Qt::AlignCenter | Qt::AlignVCenter); rbLayout->addWidget(saveButton, 4, 1, Qt::AlignCenter | Qt::AlignVCenter); rbLayout->addWidget(aboutButton, 6, 1, Qt::AlignCenter | Qt::AlignVCenter); lastDir = ""; //Connect socketnotifier to fifo QSocketNotifier* s = new QSocketNotifier(readFd, QSocketNotifier::Read); connect(s, SIGNAL(activated(int)), SLOT(readMessage(int))); //connect heartBeat timer (for channel meters) connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); SS_TRACE_OUT }