]> git.pld-linux.org Git - packages/falf.git/commitdiff
- add voume patch
authorBartłomiej Zimoń <cactus@pld-linux.org>
Wed, 13 Apr 2011 21:31:36 +0000 (21:31 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    falf-volume.patch -> 1.1
    falf.spec -> 1.7

falf-volume.patch [new file with mode: 0644]
falf.spec

diff --git a/falf-volume.patch b/falf-volume.patch
new file mode 100644 (file)
index 0000000..344344d
--- /dev/null
@@ -0,0 +1,195 @@
+--- player.cpp 2008/09/16 19:41:09     274
++++ player.cpp 2009/04/21 20:44:39     275
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2006-2008 by amdfanatyk <amdfanatyk@o2.pl>
++    Copyright (c) 2006-2009 by amdfanatyk <amdfanatyk@o2.pl>
+     *************************************************************************
+     *                                                                       *
+@@ -26,6 +26,8 @@
+       ao_port = xine_open_audio_driver(xine, NULL, NULL);
+       term = true;
++      restoring = false;
++
+       pos = 0;
+       stream = 0;
+@@ -98,6 +100,9 @@
+ void Player::setVolume(const int & vol)
+ {
+       volume = vol;
++
++      if (stream)
++              xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, volume);
+ }
+ int Player::getLength() const
+@@ -115,6 +120,11 @@
+       return pos;
+ }
++bool Player::getRestoring() const
++{
++      return restoring;
++}
++
+ void Player::setPos(const int & p)
+ {
+       pos = p;
+@@ -155,6 +165,11 @@
+       term = false;
+ }
++void Player::setRestoring(const bool value)
++{
++      restoring = value;
++}
++
+ void Player::run()
+ {
+       if (!xine)
+@@ -168,16 +183,21 @@
+       if (!xine_open(stream, (const char *)track.local8Bit()) || !xine_play(stream, 0, pos))
+               goto cleanup;
++      setVolume(volume);
++
+       while ((xine_get_status(stream) == XINE_STATUS_PLAY) && (!term))
+       {
+-              xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, volume);
++              if (restoring)
++                      setVolume(volume);
++              else
++                      volume = xine_get_param(stream, XINE_PARAM_AUDIO_VOLUME);
++
+               xine_get_pos_length(stream, NULL, &pos, &length);
+       
+               QThread::msleep(250);
+       }
+ cleanup:
+-
+       xine_close(stream);
+       xine_dispose(stream);
+--- frmmain.ui.h       2008/09/16 19:41:09     274
++++ frmmain.ui.h       2009/04/21 20:44:39     275
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2006-2008 by amdfanatyk <amdfanatyk@o2.pl>
++    Copyright (c) 2006-2009 by amdfanatyk <amdfanatyk@o2.pl>
+     *************************************************************************
+     *                                                                       *
+@@ -571,6 +571,8 @@
+                                       player.setPos(frame);
+                                       sldPos->setValue(frame);
++                                      player.setRestoring(true);
++
+                                       QTimer::singleShot(0, this, SLOT(onAction()));
+                               }
+                       }
+@@ -1154,6 +1156,9 @@
+       sldPos->setMaxValue(player.getLength()); // doesn't work without it ;[
+       sldPos->setValue(player.getPos());
++      if (!player.getRestoring())
++              sldVol->setValue(player.getVolume());
++
+       if (!player.running())
+       {
+               eqAdj = false;
+@@ -3231,17 +3236,18 @@
+ void frmMain::restoreVolume()
+ {
+-      const int & vol = player.getVolume();
++      const int vol = (player.getVolume() + 5);
+-      if (vol < desiredVolume)
++      if (vol >= desiredVolume)
+       {
+-              if ((vol + 5) > desiredVolume)
+-                      sldVol->setValue(desiredVolume);
+-              else
+-                      player.setVolume(vol + 5);
++              volumeTimer.stop();
++
++              sldVol->setValue(desiredVolume);
++
++              player.setRestoring(false);
+       }
+       else
+-              volumeTimer.stop();
++              player.setVolume(vol);
+ }
+ void frmMain::makeUpPlaylist(int id)
+--- player.h   2008/09/16 19:41:09     274
++++ player.h   2009/04/21 20:44:39     275
+@@ -38,6 +38,7 @@
+               int getLength() const;
+               int getVolume() const;
+               int getPos() const;
++              bool getRestoring() const;
+               QString getTrack() const;
+               QStringList getAudioCDContents(const QString & device) const;
+               const xine_t * getXineHandle() const;
+@@ -49,18 +50,22 @@
+               void termThread();
+               void wakeThread();
++              void setRestoring(bool);
++
+       private:
+               QString xineVer;
+               QString track;
+               bool term;
++              bool restoring;
+               int volume;
+               int length;
+               int pos;
+-              xine_t            * xine;
+-              xine_stream_t     * stream;
+-              xine_audio_port_t * ao_port;
++              xine_t             * xine;
++              xine_stream_t      * stream;
++              xine_audio_port_t  * ao_port;
++              xine_event_queue_t * event_queue;
+ };
+ #endif
+--- frmmain.ui.h       2010/12/30 19:27:09     291
++++ frmmain.ui.h       2011/01/01 00:39:30     292
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2006-2010 by amdfanatyk <amdfanatyk@o2.pl>
++    Copyright (c) 2006-2011 by amdfanatyk <amdfanatyk@o2.pl>
+     *************************************************************************
+     *                                                                       *
+@@ -341,6 +341,9 @@
+       alreadyRunning = false;
++      if (!dir.exists())
++              QDir().mkdir(dir.path());
++
+       if (lockFile.exists())
+       {
+               if (files.isEmpty())
+@@ -378,9 +381,6 @@
+               lockFile.close();
+       }
+-      if (!dir.exists())
+-              QDir().mkdir(dir.path());
+-
+       http = 0;
+       lyricsErrStr = i18n("No lyrics found");
+       sldVol->setValue(50);
index 70b08a8971d56a7c6e875f3249f598b637669623..578a5f1ac09ae6cb1a231d85df261c49cd511e82 100644 (file)
--- a/falf.spec
+++ b/falf.spec
@@ -11,6 +11,7 @@ License:      GPL
 Group:         X11/Applications
 Source0:       http://dl.sourceforge.net/falf/%{name}-%{version}.tar.bz2
 # Source0-md5: d26042a930c6a166630591abbeffe6fb
+Patch0:                %{name}-volume.patch
 URL:           http://falf.sourceforge.net/
 BuildRequires: gettext-devel
 BuildRequires: kdelibs-devel >= 9:3.2.0
@@ -53,6 +54,7 @@ Atuty:
 
 %prep
 %setup -q
+%patch0 -p0
 
 %build
 export QTDIR=%{_prefix}
This page took 0.076818 seconds and 4 git commands to generate.