diff options
| -rw-r--r-- | src/plugins/Visual/Visual.pro | 2 | ||||
| -rw-r--r-- | src/plugins/Visual/projectm/projectm.pro | 32 | ||||
| -rw-r--r-- | src/plugins/Visual/projectm/projectmplugin.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/Visual/projectm/projectmwidget.cpp | 35 | ||||
| -rw-r--r-- | src/plugins/Visual/projectm/projectmwidget.h | 5 | ||||
| -rw-r--r-- | src/plugins/Visual/projectm/visualprojectmfactory.h | 6 |
6 files changed, 56 insertions, 29 deletions
diff --git a/src/plugins/Visual/Visual.pro b/src/plugins/Visual/Visual.pro index 6bb50e6a4..e3f6d5ecb 100644 --- a/src/plugins/Visual/Visual.pro +++ b/src/plugins/Visual/Visual.pro @@ -2,8 +2,6 @@ include(../../../qmmp.pri) TEMPLATE = subdirs SUBDIRS += analyzer -unix{ contains(CONFIG, PROJECTM_PLUGIN){ SUBDIRS += projectm } -} diff --git a/src/plugins/Visual/projectm/projectm.pro b/src/plugins/Visual/projectm/projectm.pro index be61693f2..8cd6b7bd3 100644 --- a/src/plugins/Visual/projectm/projectm.pro +++ b/src/plugins/Visual/projectm/projectm.pro @@ -18,8 +18,6 @@ CONFIG += warn_on \ plugin \ link_pkgconfig -PKGCONFIG += libprojectM - TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib QT += opengl @@ -41,19 +39,23 @@ TRANSLATIONS = translations/projectm_plugin_cs.ts \ translations/projectm_plugin_sr_RS.ts RESOURCES = translations/translations.qrc -isEmpty(LIB_DIR){ - LIB_DIR = /lib +unix { + PKGCONFIG += libprojectM + isEmpty(LIB_DIR):LIB_DIR = /lib + target.path = $$LIB_DIR/qmmp/Visual + INSTALLS += target + #projectM config path + PROJECTM_CONFIG_FILES = /usr/share/projectM/config.inp \ + /usr/local/share/projectM/config.inp + for(path, PROJECTM_CONFIG_FILES) { + exists($$path) { + message ("found projectm configuration: "$$path) + DEFINES += PROJECTM_CONFIG=\\\"$$path\\\" + } + } } -target.path = $$LIB_DIR/qmmp/Visual -INSTALLS += target -#projectM config path -PROJECTM_CONFIG_FILES = /usr/share/projectM/config.inp \ - /usr/local/share/projectM/config.inp - -for(path, PROJECTM_CONFIG_FILES) { - exists($$path) { - message ("found projectm configuration: "$$path) - DEFINES += PROJECTM_CONFIG=\\\"$$path\\\" - } +win32 { + QMAKE_LIBDIR += ../../../../bin + LIBS += -lqmmp0 -lprojectM.dll } diff --git a/src/plugins/Visual/projectm/projectmplugin.cpp b/src/plugins/Visual/projectm/projectmplugin.cpp index e28eaa827..d730ec04d 100644 --- a/src/plugins/Visual/projectm/projectmplugin.cpp +++ b/src/plugins/Visual/projectm/projectmplugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2013 by Ilya Kotov * + * Copyright (C) 2009-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -33,10 +33,11 @@ #include "projectmplugin.h" ProjectMPlugin::ProjectMPlugin (QWidget *parent) - : Visual (parent) + : Visual (parent, Qt::Window | Qt::MSWindowsOwnDC) { setlocale(LC_NUMERIC, "C"); //fixes problem with none-english locales setWindowTitle(tr("ProjectM")); + m_projectMWidget = new ProjectMWidget(this); QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(m_projectMWidget); diff --git a/src/plugins/Visual/projectm/projectmwidget.cpp b/src/plugins/Visual/projectm/projectmwidget.cpp index 7de1ca867..6b9cbdb82 100644 --- a/src/plugins/Visual/projectm/projectmwidget.cpp +++ b/src/plugins/Visual/projectm/projectmwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2013 by Ilya Kotov * + * Copyright (C) 2009-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Copyright (C) 2007 by projectM team * @@ -40,11 +40,13 @@ ProjectMWidget::ProjectMWidget(QWidget *parent) { setMouseTracking(true); m_projectM = 0; - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()),SLOT(updateGL ())); - timer->start(0); + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()),SLOT(updateGL ())); m_menu = new QMenu(this); connect(SoundCore::instance(), SIGNAL(metaDataChanged()), SLOT(updateTitle())); + qDebug("ProjectMWidget: opengl version: %d.%d", + context()->format().majorVersion(), + context()->format().minorVersion()); } @@ -81,10 +83,32 @@ void ProjectMWidget::initializeGL() glEnable(GL_POINT_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glLineStipple(2, 0xAAAA); + if (!m_projectM) { +#ifdef Q_OS_WIN + projectM::Settings settings; + settings.meshX = 32; + settings.meshY = 24; + settings.fps = 35; + settings.textureSize = 1024; + settings.windowWidth = 512; + settings.windowHeight = 512; + settings.presetURL = "D:/devel/mingw32-libs/share/projectM/presets"; + settings.titleFontURL = "D:/devel/mingw32-libs/share/projectM/fonts"; + settings.menuFontURL = "D:/devel/mingw32-libs/share/projectM/fonts"; + settings.smoothPresetDuration = 5; + settings.presetDuration = 30; + settings.beatSensitivity = 1.0; + settings.aspectCorrection = true; + settings.easterEgg = 1.0; + settings.shuffleEnabled = false; + settings.softCutRatingsEnabled = false; + m_projectM = new projectM(settings, projectM::FLAG_DISABLE_PLAYLIST_LOAD); +#else m_projectM = new projectM(PROJECTM_CONFIG, projectM::FLAG_DISABLE_PLAYLIST_LOAD); - QString presetPath (m_projectM->settings().presetURL.c_str()); +#endif + QString presetPath = QString::fromLocal8Bit(m_projectM->settings().presetURL.c_str()); QDir presetDir(presetPath); presetDir.setFilter(QDir::Files); QStringList filters; @@ -105,6 +129,7 @@ void ProjectMWidget::initializeGL() } createActions(); updateTitle(); + m_timer->start(0); } } diff --git a/src/plugins/Visual/projectm/projectmwidget.h b/src/plugins/Visual/projectm/projectmwidget.h index 61d77df3c..0e9500e37 100644 --- a/src/plugins/Visual/projectm/projectmwidget.h +++ b/src/plugins/Visual/projectm/projectmwidget.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2013 by Ilya Kotov * + * Copyright (C) 2009-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -24,9 +24,11 @@ class QMenu; +class QTimer; class projectM; + /** @author Ilya Kotov <forkotov02@hotmail.ru> */ @@ -61,6 +63,7 @@ private: void createActions(); projectM *m_projectM; QMenu *m_menu; + QTimer *m_timer; }; #endif diff --git a/src/plugins/Visual/projectm/visualprojectmfactory.h b/src/plugins/Visual/projectm/visualprojectmfactory.h index 1ef370d10..a1aa1256f 100644 --- a/src/plugins/Visual/projectm/visualprojectmfactory.h +++ b/src/plugins/Visual/projectm/visualprojectmfactory.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -20,9 +20,7 @@ #ifndef VISUALPROJECTMFACTORY_H #define VISUALPROJECTMFACTORY_H - #include <QObject> - #include <qmmp/visualfactory.h> #include <qmmp/visual.h> @@ -32,7 +30,7 @@ class VisualProjectMFactory : public QObject, public VisualFactory { Q_OBJECT -Q_INTERFACES(VisualFactory); +Q_INTERFACES(VisualFactory) public: const VisualProperties properties() const; |
