Fix compilation problems when compiling without gstreamer

This commit is contained in:
David Sansome 2010-06-08 15:55:44 +00:00
parent ed49a0b422
commit f03449dd00
3 changed files with 19 additions and 11 deletions

View File

@ -355,17 +355,19 @@ void SettingsDialog::ShowTrayIconToggled(bool on) {
ui_.gst_group->setEnabled(true);
ui_.replaygain_group->setEnabled(true);
}
void SettingsDialog::GstPluginChanged(int index) {
QString name = ui_.gst_plugin->itemData(index).toString();
bool enabled = GstEngine::DoesThisSinkSupportChangingTheOutputDeviceToAUserEditableString(name);
ui_.gst_device->setEnabled(enabled);
ui_.gst_device_label->setEnabled(enabled);
}
#endif // HAVE_GSTREAMER
void SettingsDialog::GstPluginChanged(int index) {
#ifdef HAVE_GSTREAMER
QString name = ui_.gst_plugin->itemData(index).toString();
bool enabled = GstEngine::DoesThisSinkSupportChangingTheOutputDeviceToAUserEditableString(name);
ui_.gst_device->setEnabled(enabled);
ui_.gst_device_label->setEnabled(enabled);
#endif // HAVE_GSTREAMER
}
void SettingsDialog::RgPreampChanged(int value) {
float db = float(value) / 10 - 15;
QString db_str;

View File

@ -59,9 +59,7 @@ class SettingsDialog : public QDialog {
void UpdatePopupVisible();
void ShowTrayIconToggled(bool on);
#ifdef HAVE_GSTREAMER
void GstPluginChanged(int index);
#endif
void FadingOptionsChanged();
void RgPreampChanged(int value);

View File

@ -14,6 +14,7 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "projectmvisualisation.h"
#include "visualisationcontainer.h"
#include "visualisationoverlay.h"
@ -120,24 +121,31 @@ void VisualisationContainer::AddMenuItem(const QString &name, int value, int def
void VisualisationContainer::SetEngine(GstEngine* engine) {
engine_ = engine;
#ifdef HAVE_GSTREAMER
if (isVisible())
engine_->AddBufferConsumer(vis_);
#endif
}
void VisualisationContainer::showEvent(QShowEvent* e) {
QGraphicsView::showEvent(e);
update_timer_.start(1000 / fps_, this);
#ifdef HAVE_GSTREAMER
if (engine_)
engine_->AddBufferConsumer(vis_);
#endif
}
void VisualisationContainer::hideEvent(QHideEvent* e) {
QGraphicsView::hideEvent(e);
update_timer_.stop();
#ifdef HAVE_GSTREAMER
if (engine_)
engine_->RemoveBufferConsumer(vis_);
#endif
}
void VisualisationContainer::resizeEvent(QResizeEvent* e) {