From 9dd9574270473021cb92c285fe1d39354d31b106 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 15 May 2016 23:53:05 +0800 Subject: Initial stubs for the particle system. Use layouts in the effects window. --- ChangeLog | 4 + core/qmpmidimapperrtmidi.cpp | 2 +- core/qmpmidimappers.hpp | 2 +- qmidiplayer-desktop/qmpefxwindow.ui | 918 ++++++++++++++++++---------------- qmidiplayer-desktop/qmpmainwindow.cpp | 1 + qmidiplayer-desktop/qmpplugin.cpp | 2 +- visualization/extrasmeltutils.cpp | 33 ++ visualization/extrasmeltutils.hpp | 54 ++ 8 files changed, 576 insertions(+), 440 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b7bb3f..1ab5bec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-05-15 0.8.1 alpha +Initial stubs for the particle system. +Use layouts in the effects window. + 2016-05-14 0.8.1 alpha This _should_ fix building under arch linux. (Linking order problems and include problems). diff --git a/core/qmpmidimapperrtmidi.cpp b/core/qmpmidimapperrtmidi.cpp index 059ca77..9515a0b 100644 --- a/core/qmpmidimapperrtmidi.cpp +++ b/core/qmpmidimapperrtmidi.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "RtMidi.h" +#include RT_MIDI_H #include "qmpmidimappers.hpp" RtMidiOut* qmpMidiMapperRtMidi::dummy=NULL; qmpMidiMapperRtMidi::qmpMidiMapperRtMidi() diff --git a/core/qmpmidimappers.hpp b/core/qmpmidimappers.hpp index ae4fa3f..7b9ff0e 100644 --- a/core/qmpmidimappers.hpp +++ b/core/qmpmidimappers.hpp @@ -1,6 +1,6 @@ #ifndef QMPMIDIMAPPERS_H #define QMPMIDIMAPPERS_H -#include "RtMidi.h" +#include RT_MIDI_H class qmpMidiMapperRtMidi { private: diff --git a/qmidiplayer-desktop/qmpefxwindow.ui b/qmidiplayer-desktop/qmpefxwindow.ui index 4a1e0c6..d7e2245 100644 --- a/qmidiplayer-desktop/qmpefxwindow.ui +++ b/qmidiplayer-desktop/qmpefxwindow.ui @@ -6,20 +6,20 @@ 0 0 - 546 - 177 + 600 + 186 - 546 - 177 + 600 + 186 - 546 - 177 + 600 + 186 @@ -31,193 +31,225 @@ Reverb - - - - 80 - 4 - 21 - 24 - - - - - - - - - - 10 - 30 - 50 - 51 - - - - 120 - - - true - - - - - - 200 - 30 - 50 - 51 - - - - 100 - - - true - - - - - - 10 - 103 - 50 - 51 - - - - 100 - - - true - - - - - - 200 - 103 - 50 - 51 - - - - 100 - - - true - - - - - - 60 - 30 - 41 - 20 - - - - Room - - - - - - 60 - 50 - 51 - 21 - - - - 120 - - - - - - 140 - 30 - 51 - 20 - - - - Damp - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 140 - 50 - 56 - 21 - - - - 100 - - - - - - 60 - 100 - 51 - 20 - - - - Width - - - - - - 60 - 120 - 56 - 21 - - - - 100 - - - - - - 145 - 100 - 51 - 20 - - - - Level - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 140 - 120 - 56 - 21 - - - - 100 - - + + + 0 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 0 + 0 + + + + Enabled + + + + + + + 6 + + + + + + + + 0 + 0 + + + + 100 + + + true + + + + + + + + + Width + + + + + + + + 0 + 0 + + + + 100 + + + + + + + + + + + + + + 0 + 0 + + + + 120 + + + true + + + + + + + + + Room + + + + + + + + 0 + 0 + + + + 120 + + + + + + + + + + + + + + + Damp + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 100 + + + + + + + + + + 0 + 0 + + + + 100 + + + true + + + + + + + + + + + + + Level + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 100 + + + + + + + + + + 0 + 0 + + + + 100 + + + true + + + + + + + + @@ -225,250 +257,262 @@ Chorus - - - - 80 - 4 - 21 - 24 - - - - - - - - - - 10 - 30 - 50 - 51 - - - - 99 - - - true - - - - - - 200 - 30 - 50 - 51 - - - - 29 - - - 500 - - - 29 - - - true - - - - - - 10 - 103 - 50 - 51 - - - - 210 - - - true - - - - - - 200 - 103 - 50 - 51 - - - - 100 - - - true - - - - - - 60 - 30 - 71 - 20 - - - - Feedback - - - - - - 60 - 50 - 51 - 21 - - - - 99 - - - - - - 140 - 30 - 51 - 20 - - - - Rate - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 60 - 100 - 51 - 20 - - - - Depth - - - - - - 145 - 100 - 51 - 20 - - - - Level - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 140 - 120 - 56 - 21 - - - - 100 - - - - - - 137 - 50 - 61 - 21 - - - - 0.290000000000000 - - - 5.000000000000000 - - - 0.100000000000000 - - - - - - 35 - 77 - 41 - 20 - - - - LFO - - - - - - 70 - 77 - 61 - 20 - - - - Sine - - - - - - 145 - 77 - 91 - 20 - - - - Trian&gle - - - - - - 60 - 120 - 51 - 21 - - - - 1 - - - 21.000000000000000 - - - 0.100000000000000 - - + + + 0 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + + 0 + 0 + + + + Enabled + + + + + + + LFO + + + + + + + Si&ne + + + + + + + Trian&gle + + + + + + + + + 6 + + + + + + + + + Rate + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 0.290000000000000 + + + 5.000000000000000 + + + 0.100000000000000 + + + + + + + + + + 0 + 0 + + + + 29 + + + 500 + + + 29 + + + true + + + + + + + + + + + + 0 + 0 + + + + 99 + + + true + + + + + + + + + Feedback + + + + + + + + 0 + 0 + + + + 99 + + + + + + + + + + + + + 210 + + + true + + + + + + + + + Depth + + + + + + + + 0 + 0 + + + + 1 + + + 21.000000000000000 + + + 0.100000000000000 + + + + + + + + + + + + + + + Level + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 100 + + + + + + + + + + 0 + 0 + + + + 100 + + + true + + + + + + + + diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 762da0f..ed3c884 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -61,6 +61,7 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) : qmpMainWindow::~qmpMainWindow() { + pmgr->deinitPlugins(); delete pmgr;if(player)delete player; if(timer)delete timer; delete helpw;helpw=NULL; diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 79ea93c..ef31472 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -84,7 +84,7 @@ void qmpPluginManager::initPlugins() void qmpPluginManager::deinitPlugins() { for(unsigned i=0;ideinit(); + {plugins[i].interface->deinit();plugins[i].enabled=false;} } qmpPluginAPI::~qmpPluginAPI(){} diff --git a/visualization/extrasmeltutils.cpp b/visualization/extrasmeltutils.cpp index d77cc4b..160f7d6 100644 --- a/visualization/extrasmeltutils.cpp +++ b/visualization/extrasmeltutils.cpp @@ -1,6 +1,7 @@ #include #include "extrasmeltutils.hpp" SMELT* smEntity3DBuffer::sm=NULL; +SMELT* smParticle::sm=NULL; smVertex makeVertex(float x,float y,float z,DWORD color,float tx,float ty) {smVertex v;v.x=x;v.y=y;v.z=z;v.col=color;v.tx=tx;v.ty=ty;return v;} void smEntity3D::addVerices(int n,...) @@ -59,3 +60,35 @@ void smEntity3DBuffer::drawBatch() sm->smDrawCustomIndexedVertices(&vertices[0],&indices[0],vertices.size(),indices.size(),BLEND_ALPHABLEND,0); vertices.clear();indices.clear(); } +smParticle::smParticle(){sm=smGetInterface(SMELT_APILEVEL);} +smParticle::~smParticle(){sm->smRelease();} +void smParticle::render() +{sm->smRenderQuad(&q);} +void smParticle::update() +{ + clifespan+=sm->smGetDelta(); + vel=vel+accel;pos=pos+vel;rotv=rotv+rota;rot=rot+rotv; + size=clifespan/lifespan*(finalsize-initsize)+initsize; + color=ARGB( + (DWORD)(clifespan/lifespan*(GETA(finalcolor)-GETA(initcolor)+GETA(initcolor))), + (DWORD)(clifespan/lifespan*(GETR(finalcolor)-GETR(initcolor)+GETR(initcolor))), + (DWORD)(clifespan/lifespan*(GETG(finalcolor)-GETG(initcolor)+GETG(initcolor))), + (DWORD)(clifespan/lifespan*(GETB(finalcolor)-GETB(initcolor)+GETB(initcolor)))); + //set up the quad +} +smParticleSystem::smParticleSystem(){particles.clear();posGenerator=NULL;} +smParticleSystem::~smParticleSystem() +{for(int i=0;i particles; + smParticleSystemInfo psinfo; + smvec3d pos; + smPSEmissionPositionGenerator* posGenerator; + public: + smParticleSystem(); + ~smParticleSystem(); + void setParticleSystemInfo(smParticleSystemInfo _psinfo); + void setPos(smvec3d _pos); + void setPSEmissionPosGen(smPSEmissionPositionGenerator* _gen); + void startPS(); + void stopPS(); + void updatePS(); + void renderPS(); +}; extern smVertex makeVertex(float x,float y,float z,DWORD color,float tx,float ty); #endif // EXTRASMELTUTILS_H -- cgit v1.2.3