Added "tick" sound when switching tabs.

This commit is contained in:
LoRd_MuldeR 2013-10-28 00:26:54 +01:00
parent bff76873d0
commit 083af203a3
8 changed files with 26 additions and 7 deletions

View File

@ -118,6 +118,7 @@ IDR_WAVE_BEEP WAVE "res\\sounds\\beep.wav"
IDR_WAVE_BEEP_LONG WAVE "res\\sounds\\beep2.wav"
IDR_WAVE_WAITING WAVE "res\\sounds\\waiting.wav"
IDR_WAVE_BLAST WAVE "res\\sounds\\blast.wav"
IDR_WAVE_TICK WAVE "res\\sounds\\tick.wav"
/////////////////////////////////////////////////////////////////////////////
//

BIN
res/sounds/tick.wav Normal file

Binary file not shown.

View File

@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 9
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 4
#define VER_LAMEXP_BUILD 1430
#define VER_LAMEXP_BUILD 1433
#define VER_LAMEXP_CONFG 1348
///////////////////////////////////////////////////////////////////////////////

View File

@ -255,7 +255,7 @@ int AboutDialog::exec()
} \
while(0)
void AboutDialog::tabChanged(int index)
void AboutDialog::tabChanged(int index, const bool silent)
{
bool bInitialized = m_initFlags->value(ui->tabWidget->widget(index), false);
@ -288,6 +288,12 @@ void AboutDialog::tabChanged(int index)
qApp->restoreOverrideCursor();
}
//Play tick sound
if(m_settings->soundsEnabled() && (!silent))
{
lamexp_play_sound(IDR_WAVE_TICK, true);
}
//Scroll to the top
if(QWidget *tab = ui->tabWidget->widget(index))
{
@ -428,7 +434,7 @@ void AboutDialog::showEvent(QShowEvent *e)
QDialog::showEvent(e);
ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->infoTab));
tabChanged(m_lastTab = ui->tabWidget->currentIndex());
tabChanged(m_lastTab = ui->tabWidget->currentIndex(), true);
if(m_firstShow)
{
@ -591,6 +597,10 @@ void AboutDialog::initContributorsTab(void)
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Qt Developer Network"), spaces, "http://qt-project.org/");
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("BerliOS Developer"), spaces, "http://developer.berlios.de/");
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("CodePlex"), spaces, "http://www.codeplex.com/");
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Marius Hudea"), spaces, "http://savedonthe.net/");
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Codecs.com"), spaces, "http://www.codecs.com/");

View File

@ -53,7 +53,7 @@ public slots:
void gotoLicenseTab(void);
void showAboutQt(void);
void moveDisque(void);
void tabChanged(int index);
void tabChanged(int index, const bool silent = false);
void adjustSize(void);
void geometryUpdated(void);

View File

@ -1014,7 +1014,7 @@ void MainWindow::changeEvent(QEvent *e)
lamexp_update_sysmenu(this, IDM_ABOUTBOX, ui->buttonAbout->text());
//Force resize, if needed
tabPageChanged(ui->tabWidget->currentIndex());
tabPageChanged(ui->tabWidget->currentIndex(), true);
}
}
@ -1616,10 +1616,11 @@ void MainWindow::closeButtonClicked(void)
/*
* Tab page changed
*/
void MainWindow::tabPageChanged(int idx)
void MainWindow::tabPageChanged(int idx, const bool silent)
{
resizeEvent(NULL);
//Update "view" menu
QList<QAction*> actions = m_tabActionGroup->actions();
for(int i = 0; i < actions.count(); i++)
{
@ -1631,6 +1632,12 @@ void MainWindow::tabPageChanged(int idx)
}
}
//Play tick sound
if(m_settings->soundsEnabled() && (!silent))
{
lamexp_play_sound(IDR_WAVE_TICK, true);
}
int initialWidth = this->width();
int maximumWidth = QApplication::desktop()->availableGeometry().width();

View File

@ -155,7 +155,7 @@ private slots:
void sourceModelChanged(void);
void styleActionActivated(QAction *action);
void tabActionActivated(QAction *action);
void tabPageChanged(int idx);
void tabPageChanged(int idx, const bool silent = false);
void toneAdjustBassChanged(double value);
void toneAdjustTrebleChanged(double value);
void toneAdjustTrebleReset(void);

View File

@ -36,6 +36,7 @@
#define IDR_WAVE_BEEP_LONG 674
#define IDR_WAVE_WAITING 675
#define IDR_WAVE_BLAST 676
#define IDR_WAVE_TICK 677
/*
* Next default values for new objects