aboutsummaryrefslogtreecommitdiff
path: root/lib/output.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-10-13 15:52:40 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-10-13 15:52:40 +0000
commit342ada45af81cba245abd9a2fb4a19b4974e93e4 (patch)
tree62e4fba4b52c5eb18024c266311ed87604359d2f /lib/output.cpp
parentf904c00053fe42ef05952d4c1ffceb6af7b07b97 (diff)
downloadqmmp-342ada45af81cba245abd9a2fb4a19b4974e93e4.tar.gz
qmmp-342ada45af81cba245abd9a2fb4a19b4974e93e4.tar.bz2
qmmp-342ada45af81cba245abd9a2fb4a19b4974e93e4.zip
some visual api changes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@169 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'lib/output.cpp')
-rw-r--r--lib/output.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/output.cpp b/lib/output.cpp
index 285fa98c5..fbbe1c0e4 100644
--- a/lib/output.cpp
+++ b/lib/output.cpp
@@ -12,7 +12,6 @@
#include "constants.h"
#include "output.h"
-#include "visualization.h"
#include <stdio.h>
@@ -131,18 +130,18 @@ void Output::error ( const QString &e )
}
-void Output::addVisual ( Visualization *v )
+void Output::addVisual ( Visual *v )
{
- if ( visuals.indexOf ( v ) == -1 )
+ if (visuals.indexOf (v) == -1)
{
- visuals.append ( v );
+ visuals.append (v);
}
}
-void Output::removeVisual ( Visualization *v )
+void Output::removeVisual (Visual *v)
{
- visuals.removeAll ( v );
+ visuals.removeAll (v);
}
void Output::dispatchVisual ( Buffer *buffer, unsigned long written,
@@ -150,8 +149,8 @@ void Output::dispatchVisual ( Buffer *buffer, unsigned long written,
{
if ( ! buffer || !visuals.size())
return;
- Visualization *visual = 0;
- foreach (visual , visuals );
+ Visual* visual = 0;
+ foreach (visual , visuals);
{
visual->mutex()->lock ();
visual->add ( buffer, written, chan, prec );
@@ -160,20 +159,21 @@ void Output::dispatchVisual ( Buffer *buffer, unsigned long written,
}
-void Output::prepareVisuals()
+void Output::clearVisuals()
{
- //Visual *visual = visuals.first();
- /*while (visual) {
- visual->mutex()->lock();
- visual->prepare();
- visual->mutex()->unlock();
-
- visual = visuals.next();
- }*/
+ Visual *visual = 0;
+ foreach (visual, visuals );
+ {
+ visual->mutex()->lock ();
+ visual->clear();
+ visual->mutex()->unlock();
+ }
}
void Output::dispatch(OutputState::Type st)
{
+ if(st == OutputState::Stopped)
+ clearVisuals();
emit stateChanged ( OutputState(st) );
}
@@ -184,6 +184,8 @@ void Output::dispatch(long s, unsigned long w, int b, int f, int p, int c)
void Output::dispatch ( const OutputState &st )
{
+ if(st.type() == OutputState::Stopped)
+ clearVisuals();
emit stateChanged ( st );
}