OSDN Git Service

Added "tick" sound when switching tabs.
authorLoRd_MuldeR <mulder2@gmx.de>
Sun, 27 Oct 2013 23:26:54 +0000 (00:26 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Sun, 27 Oct 2013 23:26:54 +0000 (00:26 +0100)
LameXP.rc
res/sounds/tick.wav [new file with mode: 0644]
src/Config.h
src/Dialog_About.cpp
src/Dialog_About.h
src/Dialog_MainWindow.cpp
src/Dialog_MainWindow.h
src/Resource.h

index 8294a12..9addb48 100644 (file)
--- a/LameXP.rc
+++ b/LameXP.rc
@@ -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"
 
 /////////////////////////////////////////////////////////////////////////////
 //
diff --git a/res/sounds/tick.wav b/res/sounds/tick.wav
new file mode 100644 (file)
index 0000000..b4c5746
Binary files /dev/null and b/res/sounds/tick.wav differ
index 9219abc..41df9a0 100644 (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
 
 ///////////////////////////////////////////////////////////////////////////////
index e573900..44f893c 100644 (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/");
index 219c77e..239ca62 100644 (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);
 
index d9e1660..ce58559 100644 (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();
 
index b45246e..52880ba 100644 (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);
index 493f6e0..858bee2 100644 (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