Browse Source

Update for new DPF; Allow to resize window using keys

master
falkTX 10 years ago
parent
commit
d97f9cd83b
6 changed files with 37 additions and 21 deletions
  1. +1
    -1
      dpf
  2. +1
    -1
      plugins/Makefile.mk
  3. +2
    -2
      plugins/ProM/DistrhoPluginProM.cpp
  4. +1
    -1
      plugins/ProM/DistrhoPluginProM.hpp
  5. +31
    -2
      plugins/ProM/DistrhoUIProM.cpp
  6. +1
    -14
      plugins/ProM/DistrhoUIProM.hpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit a8be0083a2b0c308a15f29d39929d5125ca623fc
Subproject commit 03ddba518eebedc08710123e3e3a83b18662da15

+ 1
- 1
plugins/Makefile.mk View File

@@ -62,7 +62,7 @@ all:
%.c.o: %.c %.c.o: %.c
$(CC) $< $(BUILD_C_FLAGS) -c -o $@ $(CC) $< $(BUILD_C_FLAGS) -c -o $@


%.cpp.o: %.cpp
%.cpp.o: %.cpp ../../dpf/distrho/*
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@


clean: clean:


+ 2
- 2
plugins/ProM/DistrhoPluginProM.cpp View File

@@ -60,7 +60,7 @@ void DistrhoPluginProM::d_run(const float** inputs, float** outputs, uint32_t fr
const float* in = inputs[0]; const float* in = inputs[0];
float* out = outputs[0]; float* out = outputs[0];
if (in != out)
if (out != in)
std::memcpy(out, in, sizeof(float)*frames); std::memcpy(out, in, sizeof(float)*frames);
const MutexLocker csm(fMutex); const MutexLocker csm(fMutex);
@@ -68,7 +68,7 @@ void DistrhoPluginProM::d_run(const float** inputs, float** outputs, uint32_t fr
if (fPM == nullptr) if (fPM == nullptr)
return; return;
if (PCM* const pcm = const_cast<PCM*>(fPM->pcm()))
if (PCM* const pcm = fPM->pcm())
pcm->addPCMfloat(in, frames); pcm->addPCMfloat(in, frames);
} }


+ 1
- 1
plugins/ProM/DistrhoPluginProM.hpp View File

@@ -58,7 +58,7 @@ protected:
return 0x1000; return 0x1000;
} }
long d_getUniqueId() const noexcept override
int64_t d_getUniqueId() const noexcept override
{ {
return d_cconst('D', 'P', 'r', 'M'); return d_cconst('D', 'P', 'r', 'M');
} }


+ 31
- 2
plugins/ProM/DistrhoUIProM.cpp View File

@@ -23,6 +23,7 @@ START_NAMESPACE_DISTRHO


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


#if 0
static const projectM::Settings kSettings = { static const projectM::Settings kSettings = {
/* meshX */ 32, /* meshX */ 32,
/* meshY */ 24, /* meshY */ 24,
@@ -41,12 +42,14 @@ static const projectM::Settings kSettings = {
/* shuffleEnabled */ true, /* shuffleEnabled */ true,
/* softCutRatingsEnabled */ false /* softCutRatingsEnabled */ false
}; };
#endif


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


DistrhoUIProM::DistrhoUIProM() DistrhoUIProM::DistrhoUIProM()
: UI() : UI()
{ {
setSize(512, 512);
} }


DistrhoUIProM::~DistrhoUIProM() DistrhoUIProM::~DistrhoUIProM()
@@ -85,7 +88,7 @@ void DistrhoUIProM::d_uiIdle()
} }
} }


void DistrhoUIProM::d_uiReshape(int width, int height)
void DistrhoUIProM::d_uiReshape(uint width, uint height)
{ {
glEnable(GL_BLEND); glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH); glEnable(GL_LINE_SMOOTH);
@@ -112,7 +115,8 @@ void DistrhoUIProM::d_uiReshape(int width, int height)
glLineStipple(2, 0xAAAA); glLineStipple(2, 0xAAAA);


if (fPM == nullptr) if (fPM == nullptr)
fPM = new projectM(kSettings); // std::string("/usr/share/projectM/config.inp"));
//fPM = new projectM(kSettings);
fPM = new projectM("/usr/share/projectM/config.inp");


fPM->projectM_resetGL(width, height); fPM->projectM_resetGL(width, height);
} }
@@ -133,6 +137,31 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev)
if (fPM == nullptr) if (fPM == nullptr)
return false; return false;


if (ev.press && (ev.key == '1' || ev.key == '+' || ev.key == '-'))
{
if (ev.key == '1')
{
if (getWidth() != 512 || getHeight() != 512)
setSize(512, 512);
}
else if (ev.key == '+')
{
/**/ if (getWidth() < 1100 && getHeight() < 1100)
setSize(getWidth()+100, getHeight()+100);
else if (getWidth() != 1100 || getHeight() != 1100)
setSize(1100, 1100);
}
else if (ev.key == '-')
{
/**/ if (getWidth() >= 200 && getHeight() >= 200)
setSize(getWidth()-100, getHeight()-100);
else if (getWidth() != 100 || getHeight() != 100)
setSize(100, 100);
}

return true;
}

projectMKeycode pmKey = PROJECTM_K_NONE; projectMKeycode pmKey = PROJECTM_K_NONE;
projectMModifier pmMod = PROJECTM_KMOD_LSHIFT; projectMModifier pmMod = PROJECTM_KMOD_LSHIFT;




+ 1
- 14
plugins/ProM/DistrhoUIProM.hpp View File

@@ -32,19 +32,6 @@ public:
~DistrhoUIProM() override; ~DistrhoUIProM() override;


protected: protected:
// -------------------------------------------------------------------
// Information

uint d_getWidth() const noexcept override
{
return 512;
}

uint d_getHeight() const noexcept override
{
return 512;
}

// ------------------------------------------------------------------- // -------------------------------------------------------------------
// DSP Callbacks // DSP Callbacks


@@ -54,7 +41,7 @@ protected:
// UI Callbacks // UI Callbacks


void d_uiIdle() override; void d_uiIdle() override;
void d_uiReshape(int width, int height) override;
void d_uiReshape(uint width, uint height) override;


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Widget Callbacks // Widget Callbacks


Loading…
Cancel
Save