Пример #1
0
void MainWindow::createMiscGroupBox() {
    miscGroupBox = new QGroupBox(tr("Misc"));
    miscGroupBox->setStyleSheet("QGroupBox{color:white}");
    miscGroupBox->setFont(QFont("MS Shell Dlg 2", 9, QFont::Bold));

    QVBoxLayout *miscLayout = new QVBoxLayout;

    QPushButton *about = new QPushButton(tr("A&bout"));
    about->setFixedSize(112,36);
    about->setFont(QFont("MS Shell Dlg 2", 9, QFont::Bold));
    about->setStyleSheet("QPushButton{background-image:url(:/program/images/About.png); color: white; border-width: 3px; border-color: #181D1F; border-style: outset; border-radius: 7;}"
                         "QPushButton:hover{background-image:url(:/program/images/About-Hover.png);}"
                         "QPushButton:pressed{background-image:url(:/program/images/About-Clicked.png);}");
    connect(about, SIGNAL(clicked()), this, SLOT(aboutButtonClicked()));

    QPushButton *quit = new QPushButton(tr("&Quit"));
    quit->setFixedSize(112,36);
    quit->setFont(QFont("MS Shell Dlg 2", 9, QFont::Bold));
    quit->setStyleSheet("QPushButton{background-image:url(:/program/images/Quit.png); color: white; border-width: 3px; border-color: #181D1F; border-style: outset; border-radius: 7;}"
                        "QPushButton:hover{background-image:url(:/program/images/Quit-Hover.png);}"
                        "QPushButton:pressed{background-image:url(:/program/images/Quit-Clicked.png);}");
    connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));

    miscLayout->addWidget(about, 0, Qt::AlignHCenter);
    miscLayout->addWidget(quit, 0, Qt::AlignHCenter);

    miscGroupBox->setLayout(miscLayout);
    miscGroupBox->setFixedWidth(160);
}
bool KStreamRipper::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: browseButtonClicked(); break;
    case 1: addStreamButtonClicked(); break;
    case 2: deleteStreamButtonClicked(); break;
    case 3: tuneInButtonClicked(); break;
    case 4: ripButtonClicked(); break;
    case 5: stopRipButtonClicked(); break;
    case 6: addStreamFinished((AddNewStreamImpl*)static_QUType_ptr.get(_o+1)); break;
    case 7: readStdout(); break;
    case 8: setEmptyText(); break;
    case 9: quitButtonClicked(); break;
    case 10: aboutButtonClicked(); break;
    default:
	return KStreamRipperBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
Пример #3
0
void MainWindow::createActions() {
    // Allows the user to return to menu
    returnAct = new QAction(tr("&Back to Main Menu"), this);
    returnAct->setShortcut(tr("Ctrl+Z"));
    returnAct->setStatusTip(tr("Return to main menu"));
    connect(returnAct, SIGNAL(triggered()), this, SLOT(backToMainMenu()));

    // Allows the user to exit the app through the menu bar
    exitAct = new QAction(tr("&Exit Guess Who"), this);
    exitAct->setShortcut(tr("Ctrl+Q"));
    exitAct->setStatusTip(tr("Exit the application"));
    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

    // Allows the user to see the About info about the application
    aboutAct = new QAction(tr("About Guess &Who"), this);
    aboutAct->setStatusTip(tr("Shows info about game"));
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(aboutButtonClicked()));

    // Allows the user to create a new text file for character selection
    createAct = new QAction(tr("Edit characters text"), this);
    createAct->setStatusTip(tr("Create/Edit text file for character selection"));
    connect(createAct, SIGNAL(triggered()), this, SLOT(createText()));
}
Пример #4
0
/*!
    \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
}
Пример #5
0
void MainWindow::createMainMenuWidget() {
    // Sets up each menu button along with their styleSheet
    QPushButton *start = new QPushButton(tr("Start"));
    start->setFixedSize(172,48);
    start->setFont(QFont("MS Shell Dlg 2", 11, QFont::Bold));
    start->setStyleSheet("QPushButton{background-image:url(:/program/images/Default.png); color: white; border-width: 3px; border-color: #181D1F; border-style: outset; border-radius: 7;}"
                         "QPushButton:hover{background-image:url(:/program/images/Hover.png);}"
                         "QPushButton:pressed{background-image:url(:/program/images/Clicked.png);}");
    connect(start, SIGNAL(clicked()), this, SLOT(startButtonClicked()));

    QPushButton *howToPlay = new QPushButton(tr("How to Play"));
    howToPlay->setFixedSize(172,48);
    howToPlay->setFont(QFont("MS Shell Dlg 2", 11, QFont::Bold));
    howToPlay->setStyleSheet("QPushButton{background-image:url(:/program/images/About.png); color: white; border-width: 3px; border-color: #181D1F; border-style: outset; border-radius: 7;}"
                             "QPushButton:hover{background-image:url(:/program/images/About-Hover.png);}"
                             "QPushButton:pressed{background-image:url(:/program/images/About-Clicked.png);}"
                             "QPushButton:disabled{background-image:url(:/program/images/Quit.png);};");
    connect(howToPlay, SIGNAL(clicked()), this, SLOT(howToPlayButtonClicked()));

    QPushButton *about = new QPushButton(tr("About Guess Who"));
    about->setFixedSize(172,48);
    about->setFont(QFont("MS Shell Dlg 2", 11, QFont::Bold));
    about->setStyleSheet("QPushButton{background-image:url(:/program/images/About.png); color: white; border-width: 3px; border-color: #181D1F; border-style: outset; border-radius: 7;}"
                         "QPushButton:hover{background-image:url(:/program/images/About-Hover.png);}"
                         "QPushButton:pressed{background-image:url(:/program/images/About-Clicked.png);}");
    connect(about, SIGNAL(clicked()), this, SLOT(aboutButtonClicked()));

    QPushButton *quit = new QPushButton(tr("Quit"));
    quit->setFixedSize(172,48);
    quit->setFont(QFont("MS Shell Dlg 2", 11, QFont::Bold));
    quit->setStyleSheet("QPushButton{background-image:url(:/program/images/Quit.png); color: white; border-width: 3px; border-color: #181D1F; border-style: outset; border-radius: 7;}"
                        "QPushButton:hover{background-image:url(:/program/images/Quit-Hover.png);}"
                        "QPushButton:pressed{background-image:url(:/program/images/Quit-Clicked.png);}");
    connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));

    // Creates the layout for the buttons
    QVBoxLayout *buttonLayout = new QVBoxLayout;
    buttonLayout->addSpacing(20);
    buttonLayout->addWidget(start, 0, Qt::AlignHCenter);
    buttonLayout->addSpacing(15);
    buttonLayout->addWidget(howToPlay, 0, Qt::AlignHCenter);
    buttonLayout->addSpacing(15);
    buttonLayout->addWidget(about, 0, Qt::AlignHCenter);
    buttonLayout->addSpacing(15);
    buttonLayout->addWidget(quit, 0, Qt::AlignHCenter);
    buttonLayout->addSpacing(20);

    QGroupBox *choiceGroupBox = new QGroupBox(tr(""));
    choiceGroupBox->setStyleSheet("QGroupBox{color:white}");
    choiceGroupBox->setLayout(buttonLayout);
    choiceGroupBox->setFixedSize(260, 400);

    // Creates 2 labels that will hold images for the menu screen
    QLabel *leftLabel = new QLabel(tr(""));
    QPixmap leftImage(":/program/images/Left.png");
    leftLabel->setPixmap(leftImage);
    leftLabel->setFixedSize(480,570);

    QLabel *rightLabel = new QLabel(tr(""));
    QPixmap rightImage(":/program/images/Right.png");
    rightLabel->setPixmap(rightImage);
    rightLabel->setFixedSize(480,570);

    // Creates the bottom layout for the page
    QHBoxLayout *bottomLayout = new QHBoxLayout;
    bottomLayout->addWidget(leftLabel, 0, Qt::AlignHCenter);
    bottomLayout->addWidget(choiceGroupBox);
    bottomLayout->addWidget(rightLabel, 0, Qt::AlignHCenter);

    // Creates the main layout for the page
    QVBoxLayout *mainLayout = new QVBoxLayout;

    QPixmap titleImage(":/program/images/Title.png");
    QLabel *titleName = new QLabel(tr(""));
    titleName->setPixmap(titleImage);
    titleName->setFixedSize(980,300);

    mainLayout->addSpacing(100);
    mainLayout->addWidget(titleName, 0, Qt::AlignHCenter);
    mainLayout->addLayout(bottomLayout);

    mainMenuWidget = new QWidget;
    mainMenuWidget->setLayout(mainLayout);
}