# HG changeset patch # User unc0rr # Date 1232131041 0 # Node ID b3f4ec08f0a4c9534c3c78b490320a4dc44ade50 # Parent af34da5726aa3f2af8fcef67a4a5d435564ca96a A button for checking voicepack (doesn't work yet) diff -r af34da5726aa -r b3f4ec08f0a4 QTfrontend/SDLs.cpp --- a/QTfrontend/SDLs.cpp Fri Jan 16 15:43:19 2009 +0000 +++ b/QTfrontend/SDLs.cpp Fri Jan 16 18:37:21 2009 +0000 @@ -69,3 +69,8 @@ { Mix_FadeOutMusic(2000); } + +void SDLInteraction::PlaySound(const QString & filename) +{ + +} \ No newline at end of file diff -r af34da5726aa -r b3f4ec08f0a4 QTfrontend/SDLs.h --- a/QTfrontend/SDLs.h Fri Jan 16 15:43:19 2009 +0000 +++ b/QTfrontend/SDLs.h Fri Jan 16 18:37:21 2009 +0000 @@ -37,6 +37,7 @@ QStringList getResolutions() const; void StartMusic(); void StopMusic(); + void PlaySound(const QString & filename); }; #endif diff -r af34da5726aa -r b3f4ec08f0a4 QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Fri Jan 16 15:43:19 2009 +0000 +++ b/QTfrontend/pages.cpp Fri Jan 16 18:37:21 2009 +0000 @@ -164,16 +164,23 @@ CBGrave->setMaxCount(65535); CBGrave->setIconSize(QSize(32, 32)); GBTLayout->addWidget(CBGrave); - - CBVoicepack = new QComboBox(GBoxTeam); + { - QDir tmpdir; - tmpdir.cd(datadir->absolutePath()); - tmpdir.cd("Sounds/voices"); - QStringList list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name); - CBVoicepack->addItems(list); + QHBoxLayout * hbox = new QHBoxLayout(); + CBVoicepack = new QComboBox(GBoxTeam); + { + QDir tmpdir; + tmpdir.cd(datadir->absolutePath()); + tmpdir.cd("Sounds/voices"); + QStringList list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name); + CBVoicepack->addItems(list); + } + hbox->addWidget(CBVoicepack, 100); + BtnTestSound = addButton(":/res/lightbulb_on.png", hbox, 1, true); + hbox->setStretchFactor(BtnTestSound, 1); + connect(BtnTestSound, SIGNAL(clicked()), this, SLOT(testSound())); + GBTLayout->addLayout(hbox); } - GBTLayout->addWidget(CBVoicepack); GBoxFort = new QGroupBox(this); GBoxFort->setTitle(QGroupBox::tr("Fort")); @@ -257,6 +264,17 @@ FortPreview->setPixmap(pix); } +void PageEditTeam::testSound() +{ + QDir tmpdir; + tmpdir.cd(datadir->absolutePath()); + tmpdir.cd("Sounds/voices"); + tmpdir.cd(CBVoicepack->currentText()); + QStringList list = tmpdir.entryList(QStringList() << "*.ogg", QDir::Files); + if (list.size()) + ;//QSound::play(tmpdir.absolutePath() + list[rand() % list.size()]); +} + PageMultiplayer::PageMultiplayer(QWidget* parent) : AbstractPage(parent) { diff -r af34da5726aa -r b3f4ec08f0a4 QTfrontend/pages.h --- a/QTfrontend/pages.h Fri Jan 16 15:43:19 2009 +0000 +++ b/QTfrontend/pages.h Fri Jan 16 18:37:21 2009 +0000 @@ -157,6 +157,7 @@ QWidget *page_O; QPushButton *BtnTeamDiscard; QPushButton *BtnTeamSave; + QPushButton * BtnTestSound; QLineEdit * TeamNameEdit; QLineEdit * HHNameEdit[8]; QComboBox * HHHats[8]; @@ -167,6 +168,9 @@ private: QLabel * LBind[BINDS_NUMBER]; + +private slots: + void testSound(); }; class PageMultiplayer : public AbstractPage