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
$(CC) $< $(BUILD_C_FLAGS) -c -o $@

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

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


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

@@ -58,7 +58,7 @@ protected:
return 0x1000;
}
long d_getUniqueId() const noexcept override
int64_t d_getUniqueId() const noexcept override
{
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 = {
/* meshX */ 32,
/* meshY */ 24,
@@ -41,12 +42,14 @@ static const projectM::Settings kSettings = {
/* shuffleEnabled */ true,
/* softCutRatingsEnabled */ false
};
#endif

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

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

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_LINE_SMOOTH);
@@ -112,7 +115,8 @@ void DistrhoUIProM::d_uiReshape(int width, int height)
glLineStipple(2, 0xAAAA);

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);
}
@@ -133,6 +137,31 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev)
if (fPM == nullptr)
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;
projectMModifier pmMod = PROJECTM_KMOD_LSHIFT;



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

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

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

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

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

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

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

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

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


Loading…
Cancel
Save