diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-07-11 19:01:37 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-07-11 19:01:37 +0000 |
| commit | 81230638d22177215fd64062e5f28f017802fc75 (patch) | |
| tree | dbb605b04af26dfed8adc4cd5832f49a908d1fd6 /src | |
| parent | 598d8e8ce7ffd296a3095c2d45cd4ebf92af451b (diff) | |
| download | qmmp-81230638d22177215fd64062e5f28f017802fc75.tar.gz qmmp-81230638d22177215fd64062e5f28f017802fc75.tar.bz2 qmmp-81230638d22177215fd64062e5f28f017802fc75.zip | |
fixed visualization
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@455 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmp/output.cpp | 15 | ||||
| -rw-r--r-- | src/qmmp/visual.cpp | 4 | ||||
| -rw-r--r-- | src/ui/mainvisual.cpp | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/qmmp/output.cpp b/src/qmmp/output.cpp index bf08da376..ebfcb9c33 100644 --- a/src/qmmp/output.cpp +++ b/src/qmmp/output.cpp @@ -37,7 +37,7 @@ static void checkFactories() QObject *plugin = loader.instance(); if ( loader.isLoaded() ) qDebug ( "Output: plugin loaded - %s", qPrintable ( fileName ) ); - else + else qWarning("Output: %s", qPrintable(loader.errorString ())); OutputFactory *factory = 0; @@ -71,7 +71,7 @@ Output *Output::create (QObject *parent) OutputFactory *fact = 0; foreach(fact, *factories) { - if(isEnabled(fact)) + if (isEnabled(fact)) break; else fact = factories->at(0); @@ -121,7 +121,7 @@ void Output::setEnabled(OutputFactory* factory) bool Output::isEnabled(OutputFactory* factory) { checkFactories(); - if(!factories->contains(factory)) + if (!factories->contains(factory)) return FALSE; QString name = files.at(factories->indexOf(factory)).section('/',-1); QSettings settings (QDir::homePath() +"/.qmmp/qmmprc", QSettings::IniFormat); @@ -138,11 +138,11 @@ Output::Output (QObject* parent) : QThread (parent), r (stackSize()) Output::~Output() { - qDebug("Output::~Output()"); foreach(Visual *visual, m_vis_map.values ()) { visual->setOutput(0); - visual->close(); + visual->hide(); + visual->deleteLater(); } foreach (Visual *visual , visuals) //external { @@ -179,12 +179,13 @@ void Output::removeVisual (Visual *v) void Output::processCloseEvent(Visual *v, QCloseEvent *event) { - if(event->spontaneous () && m_vis_map.key(v)) + if (event->spontaneous () && m_vis_map.key(v)) { VisualFactory *factory = m_vis_map.key(v); m_vis_map.remove(factory); Visual::setEnabled(factory, FALSE); dispatch(OutputState::VisualRemoved); + return; } removeVisual (v); } @@ -219,7 +220,7 @@ void Output::removeVisual(VisualFactory *factory) void Output::dispatchVisual ( Buffer *buffer, unsigned long written, int chan, int prec ) { - if ( ! buffer || !visuals.size()) + if (!buffer) return; Visual* visual = 0; foreach (visual , visuals) //external diff --git a/src/qmmp/visual.cpp b/src/qmmp/visual.cpp index 0c234a5a8..c97154baf 100644 --- a/src/qmmp/visual.cpp +++ b/src/qmmp/visual.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007 by Ilya Kotov * + * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -71,6 +71,8 @@ Visual::Visual(QWidget *parent) : QWidget(parent) { setAttribute(Qt::WA_DeleteOnClose, TRUE); setAttribute(Qt::WA_QuitOnClose, FALSE); + m_decoder = 0; + m_output = 0; } Visual::~Visual() diff --git a/src/ui/mainvisual.cpp b/src/ui/mainvisual.cpp index 98b5bb4c0..056bf79fd 100644 --- a/src/ui/mainvisual.cpp +++ b/src/ui/mainvisual.cpp @@ -166,7 +166,7 @@ void MainVisual::timeout() update(); m_draw = TRUE; } - else if (m_draw && (!output() || !output()->isRunning())) + else if (m_draw && !(output() && output()->isRunning())) { m_draw = FALSE; m_pixmap = m_bg; |
