diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-02-18 21:44:39 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-02-18 21:44:39 +0000 |
| commit | 09d1eb079182e06e01cc9bea8bf9410e40a189c2 (patch) | |
| tree | ba6228fb3e81cd38e41fcc32e0d89246b357c5f8 /src/ui/display.cpp | |
| parent | 390cf22010e4f10be06010bbaff1dcf388f88c3c (diff) | |
| download | qmmp-09d1eb079182e06e01cc9bea8bf9410e40a189c2.tar.gz qmmp-09d1eb079182e06e01cc9bea8bf9410e40a189c2.tar.bz2 qmmp-09d1eb079182e06e01cc9bea8bf9410e40a189c2.zip | |
improved text scroller, added numerical values for balance and volume
(Closes issue 415)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2057 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/display.cpp')
| -rw-r--r-- | src/ui/display.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/ui/display.cpp b/src/ui/display.cpp index d8897d0a4..9598262b2 100644 --- a/src/ui/display.cpp +++ b/src/ui/display.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * + * Copyright (C) 2006-2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -99,12 +99,17 @@ MainDisplay::MainDisplay (QWidget *parent) m_playstatus = new PlayStatus(this); m_volumeBar = new VolumeBar(this); - connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); m_volumeBar->setToolTip(tr("Volume")); + connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); + connect(m_volumeBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); + connect(m_volumeBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); m_balanceBar = new BalanceBar(this); - connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); m_balanceBar->setToolTip(tr("Balance")); + connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); + connect(m_balanceBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); + connect(m_balanceBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); + m_timeIndicator = new TimeIndicator(this); m_aboutWidget = new QWidget(this); m_core = SoundCore::instance(); @@ -122,7 +127,6 @@ MainDisplay::MainDisplay (QWidget *parent) updateMask(); } - MainDisplay::~MainDisplay() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); @@ -284,6 +288,17 @@ bool MainDisplay::isEqualizerVisible() const void MainDisplay::updateVolume() { + if(sender() == m_volumeBar) + m_text->setText(tr("Volume: %1%").arg(m_volumeBar->value())); + if(sender() == m_balanceBar) + { + if(m_balanceBar->value() > 0) + m_text->setText(tr("Balance: %1% right").arg(m_balanceBar->value())); + else if(m_balanceBar->value() < 0) + m_text->setText(tr("Balance: %1% left").arg(-m_balanceBar->value())); + else + m_text->setText(tr("Balance: center")); + } m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); } |
