Browse Source

Merge branch 'pugl-update' of github.com:DISTRHO/DPF into pugl-update

pull/83/head
falkTX 6 years ago
parent
commit
aedfb9c8ee
6 changed files with 38 additions and 10 deletions
  1. +4
    -2
      dgl/Window.hpp
  2. +22
    -0
      dgl/src/Window.cpp
  3. +2
    -1
      distrho/src/DistrhoPluginChecks.h
  4. +8
    -6
      distrho/src/DistrhoPluginLV2.cpp
  5. +1
    -1
      distrho/src/DistrhoUIDSSI.cpp
  6. +1
    -0
      examples/States/DistrhoPluginInfo.h

+ 4
- 2
dgl/Window.hpp View File

@@ -98,8 +98,6 @@ public:
bool isResizable() const noexcept; bool isResizable() const noexcept;
void setResizable(bool yesNo); void setResizable(bool yesNo);


void setGeometryConstraints(uint width, uint height, bool aspect);

uint getWidth() const noexcept; uint getWidth() const noexcept;
uint getHeight() const noexcept; uint getHeight() const noexcept;
Size<uint> getSize() const noexcept; Size<uint> getSize() const noexcept;
@@ -109,11 +107,15 @@ public:
const char* getTitle() const noexcept; const char* getTitle() const noexcept;
void setTitle(const char* title); void setTitle(const char* title);


void setGeometryConstraints(uint width, uint height, bool aspect);
void setTransientWinId(uintptr_t winId); void setTransientWinId(uintptr_t winId);


double getScaling() const noexcept; double getScaling() const noexcept;
void setScaling(double scaling) noexcept; void setScaling(double scaling) noexcept;


bool getIgnoringKeyRepeat() const noexcept;
void setIgnoringKeyRepeat(bool ignore) noexcept;

Application& getApp() const noexcept; Application& getApp() const noexcept;
intptr_t getWindowId() const noexcept; intptr_t getWindowId() const noexcept;




+ 22
- 0
dgl/src/Window.cpp View File

@@ -710,6 +710,18 @@ struct Window::PrivateData {


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


bool getIgnoringKeyRepeat() const noexcept
{
return fView->ignoreKeyRepeat;
}

void setIgnoringKeyRepeat(bool ignore) noexcept
{
puglIgnoreKeyRepeat(fView, ignore);
}

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

void addWidget(Widget* const widget) void addWidget(Widget* const widget)
{ {
fWidgets.push_back(widget); fWidgets.push_back(widget);
@@ -1333,6 +1345,16 @@ void Window::setScaling(double scaling) noexcept
pData->setScaling(scaling); pData->setScaling(scaling);
} }


bool Window::getIgnoringKeyRepeat() const noexcept
{
return pData->getIgnoringKeyRepeat();
}

void Window::setIgnoringKeyRepeat(bool ignore) noexcept
{
pData->setIgnoringKeyRepeat(ignore);
}

Application& Window::getApp() const noexcept Application& Window::getApp() const noexcept
{ {
return pData->fApp; return pData->fApp;


+ 2
- 1
distrho/src/DistrhoPluginChecks.h View File

@@ -126,7 +126,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Enable full state if plugin exports presets // Enable full state if plugin exports presets


#if DISTRHO_PLUGIN_WANT_PROGRAMS && DISTRHO_PLUGIN_WANT_STATE
#if DISTRHO_PLUGIN_WANT_PROGRAMS && DISTRHO_PLUGIN_WANT_STATE && ! DISTRHO_PLUGIN_WANT_FULL_STATE
# warning Plugins with programs and state need to implement full state API
# undef DISTRHO_PLUGIN_WANT_FULL_STATE # undef DISTRHO_PLUGIN_WANT_FULL_STATE
# define DISTRHO_PLUGIN_WANT_FULL_STATE 1 # define DISTRHO_PLUGIN_WANT_FULL_STATE 1
#endif #endif


+ 8
- 6
distrho/src/DistrhoPluginLV2.cpp View File

@@ -613,7 +613,6 @@ public:
fEventsOutData.initIfNeeded(fURIDs.atomSequence); fEventsOutData.initIfNeeded(fURIDs.atomSequence);


LV2_Atom_Event* aev; LV2_Atom_Event* aev;
uint32_t offset = fEventsOutData.offset;
const uint32_t capacity = fEventsOutData.capacity; const uint32_t capacity = fEventsOutData.capacity;


for (uint32_t i=0, count=fPlugin.getStateCount(); i < count; ++i) for (uint32_t i=0, count=fPlugin.getStateCount(); i < count; ++i)
@@ -635,8 +634,11 @@ public:
// set msg size (key + value + separator + 2x null terminator) // set msg size (key + value + separator + 2x null terminator)
const size_t msgSize(key.length()+value.length()+3); const size_t msgSize(key.length()+value.length()+3);


if (sizeof(LV2_Atom_Event) + msgSize > capacity - offset)
if (sizeof(LV2_Atom_Event) + msgSize > capacity - fEventsOutData.offset)
{
d_stdout("Sending key '%s' to UI failed, out of space", key.buffer());
break; break;
}


// reserve msg space // reserve msg space
// FIXME create a large enough buffer beforehand // FIXME create a large enough buffer beforehand
@@ -644,15 +646,15 @@ public:
std::memset(msgBuf, 0, msgSize); std::memset(msgBuf, 0, msgSize);


// write key and value in atom bufer // write key and value in atom bufer
std::memcpy(msgBuf, key.buffer(), key.length());
std::memcpy(msgBuf+(key.length()+1), value.buffer(), value.length());
std::memcpy(msgBuf, key.buffer(), key.length()+1);
std::memcpy(msgBuf+(key.length()+1), value.buffer(), value.length()+1);


// put data // put data
aev = (LV2_Atom_Event*)(LV2_ATOM_CONTENTS(LV2_Atom_Sequence, fEventsOutData.port) + offset);
aev = (LV2_Atom_Event*)(LV2_ATOM_CONTENTS(LV2_Atom_Sequence, fEventsOutData.port) + fEventsOutData.offset);
aev->time.frames = 0; aev->time.frames = 0;
aev->body.type = fURIDs.distrhoState; aev->body.type = fURIDs.distrhoState;
aev->body.size = msgSize; aev->body.size = msgSize;
std::memcpy(LV2_ATOM_BODY(&aev->body), msgBuf, msgSize-1);
std::memcpy(LV2_ATOM_BODY(&aev->body), msgBuf, msgSize);


fEventsOutData.growBy(lv2_atom_pad_size(sizeof(LV2_Atom_Event) + msgSize)); fEventsOutData.growBy(lv2_atom_pad_size(sizeof(LV2_Atom_Event) + msgSize));




+ 1
- 1
distrho/src/DistrhoUIDSSI.cpp View File

@@ -194,7 +194,7 @@ protected:


uint8_t mdata[4] = { uint8_t mdata[4] = {
0, 0,
channel + (velocity != 0 ? 0x90 : 0x80),
static_cast<uint8_t>(channel + (velocity != 0 ? 0x90 : 0x80)),
note, note,
velocity velocity
}; };


+ 1
- 0
examples/States/DistrhoPluginInfo.h View File

@@ -27,5 +27,6 @@
#define DISTRHO_PLUGIN_NUM_OUTPUTS 2 #define DISTRHO_PLUGIN_NUM_OUTPUTS 2
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1 #define DISTRHO_PLUGIN_WANT_PROGRAMS 1
#define DISTRHO_PLUGIN_WANT_STATE 1 #define DISTRHO_PLUGIN_WANT_STATE 1
#define DISTRHO_PLUGIN_WANT_FULL_STATE 1


#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

Loading…
Cancel
Save