Author: cactus                       Date: Wed Apr 13 21:31:41 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add voume patch

---- Files affected:
packages/falf:
   falf.spec (1.6 -> 1.7) , falf-volume.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/falf/falf.spec
diff -u packages/falf/falf.spec:1.6 packages/falf/falf.spec:1.7
--- packages/falf/falf.spec:1.6 Thu Aug 14 16:52:27 2008
+++ packages/falf/falf.spec     Wed Apr 13 23:31:36 2011
@@ -12,6 +12,7 @@
 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
@@ -54,6 +55,7 @@
 
 %prep
 %setup -q
+%patch0 -p0
 
 %build
 export QTDIR=%{_prefix}
@@ -94,6 +96,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.7  2011/04/13 21:31:36  cactus
+- add voume patch
+
 Revision 1.6  2008/08/14 14:52:27  cactus
 - up to 1.3
 

================================================================
Index: packages/falf/falf-volume.patch
diff -u /dev/null packages/falf/falf-volume.patch:1.1
--- /dev/null   Wed Apr 13 23:31:41 2011
+++ packages/falf/falf-volume.patch     Wed Apr 13 23:31:36 2011
@@ -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 <[email protected]>
++    Copyright (c) 2006-2009 by amdfanatyk <[email protected]>
+ 
+     *************************************************************************
+     *                                                                       *
+@@ -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 <[email protected]>
++    Copyright (c) 2006-2009 by amdfanatyk <[email protected]>
+ 
+     *************************************************************************
+     *                                                                       *
+@@ -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 <[email protected]>
++    Copyright (c) 2006-2011 by amdfanatyk <[email protected]>
+ 
+     *************************************************************************
+     *                                                                       *
+@@ -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);
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/falf/falf.spec?r1=1.6&r2=1.7&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to