Browse Source

Add dpl Makefile, update 3bandeq ui for it

tags/1.9.4
falkTX 12 years ago
parent
commit
a7b3adf269
11 changed files with 87 additions and 28 deletions
  1. +5
    -8
      source/backend/native/3bandeq/DistrhoUI3BandEQ.cpp
  2. +11
    -7
      source/backend/native/3bandeq/DistrhoUI3BandEQ.hpp
  3. +2
    -2
      source/backend/plugin/Makefile
  4. +6
    -1
      source/libs/Makefile
  5. +3
    -1
      source/libs/distrho/DistrhoUIOpenGL.hpp
  6. +1
    -0
      source/libs/distrho/dgl/Image.hpp
  7. +49
    -0
      source/libs/distrho/dgl/Makefile
  8. +8
    -0
      source/libs/distrho/dgl/src/Image.cpp
  9. +0
    -6
      source/libs/distrho/src/DistrhoUI.cpp
  10. +1
    -3
      source/libs/distrho/src/DistrhoUIInternal.hpp
  11. +1
    -0
      source/libs/distrho/src/DistrhoUIOpenGL.cpp

+ 5
- 8
source/backend/native/3bandeq/DistrhoUI3BandEQ.cpp View File

@@ -23,6 +23,8 @@ START_NAMESPACE_DISTRHO
DistrhoUI3BandEQ::DistrhoUI3BandEQ()
: OpenGLUI()
{
Window* win = getParent();

// background
fImgBackground = Image(DistrhoArtwork3BandEQ::backgroundData, DistrhoArtwork3BandEQ::backgroundWidth, DistrhoArtwork3BandEQ::backgroundHeight, GL_BGR);

@@ -32,7 +34,7 @@ DistrhoUI3BandEQ::DistrhoUI3BandEQ()
Point<int> sliderPosEnd(57, 43 + 160);

// slider Low
fSliderLow = new ImageSlider(sliderImage);
fSliderLow = new ImageSlider(win, sliderImage);
fSliderLow->setStartPos(sliderPosStart);
fSliderLow->setEndPos(sliderPosEnd);
fSliderLow->setRange(-24.0f, 24.0f);
@@ -45,7 +47,6 @@ DistrhoUI3BandEQ::DistrhoUI3BandEQ()
fSliderMid = new ImageSlider(*fSliderLow);
fSliderMid->setStartPos(sliderPosStart);
fSliderMid->setEndPos(sliderPosEnd);
fSliderMid->setCallback(this);

// slider High
sliderPosStart.setX(183);
@@ -53,7 +54,6 @@ DistrhoUI3BandEQ::DistrhoUI3BandEQ()
fSliderHigh = new ImageSlider(*fSliderLow);
fSliderHigh->setStartPos(sliderPosStart);
fSliderHigh->setEndPos(sliderPosEnd);
fSliderHigh->setCallback(this);

// slider Master
sliderPosStart.setX(287);
@@ -61,14 +61,12 @@ DistrhoUI3BandEQ::DistrhoUI3BandEQ()
fSliderMaster = new ImageSlider(*fSliderLow);
fSliderMaster->setStartPos(sliderPosStart);
fSliderMaster->setEndPos(sliderPosEnd);
fSliderMaster->setCallback(this);

// knobs
Image knobImage(DistrhoArtwork3BandEQ::knobData, DistrhoArtwork3BandEQ::knobWidth, DistrhoArtwork3BandEQ::knobHeight);
Point knobPos(66, 270);

// knob Low-Mid
fKnobLowMid = new ImageKnob(knobImage);
fKnobLowMid = new ImageKnob(win, knobImage);
fKnobLowMid->setPos(66, 270);
fKnobLowMid->setRange(0.0f, 1000.0f);
fKnobLowMid->setValue(220.0f);
@@ -77,12 +75,11 @@ DistrhoUI3BandEQ::DistrhoUI3BandEQ()
// knob Mid-High
fKnobMidHigh = new ImageKnob(*fKnobLowMid);
fKnobMidHigh->setPos(160, 270);
fKnobMidHigh->setCallback(this);

// about button
Image aboutImageNormal(DistrhoArtwork3BandEQ::aboutButtonNormalData, DistrhoArtwork3BandEQ::aboutButtonNormalWidth, DistrhoArtwork3BandEQ::aboutButtonNormalHeight);
Image aboutImageHover(DistrhoArtwork3BandEQ::aboutButtonHoverData, DistrhoArtwork3BandEQ::aboutButtonHoverWidth, DistrhoArtwork3BandEQ::aboutButtonHoverHeight);
fButtonAbout = new ImageButton(aboutImageNormal, aboutImageHover, aboutImageHover);
fButtonAbout = new ImageButton(win, aboutImageNormal, aboutImageHover, aboutImageHover);
fButtonAbout->setPos(264, 300);
fButtonAbout->setCallback(this);
}


+ 11
- 7
source/backend/native/3bandeq/DistrhoUI3BandEQ.hpp View File

@@ -39,25 +39,29 @@ public:
DistrhoUI3BandEQ();
~DistrhoUI3BandEQ();

// ---------------------------------------------
protected:
// ---------------------------------------------
// Information
int d_width()

unsigned int d_width() const
{
return (int)DistrhoArtwork3BandEQ::backgroundWidth;
return DistrhoArtwork3BandEQ::backgroundWidth;
}

int d_height()
unsigned int d_height() const
{
return (int)DistrhoArtwork3BandEQ::backgroundHeight;
return DistrhoArtwork3BandEQ::backgroundHeight;
}

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

void d_parameterChanged(uint32_t index, float value);
void d_programChanged(uint32_t index);

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

void imageButtonClicked(ImageButton* button, int);
void imageKnobDragStarted(ImageKnob* knob);
void imageKnobDragFinished(ImageKnob* knob);


+ 2
- 2
source/backend/plugin/Makefile View File

@@ -58,8 +58,8 @@ debug:
%.cpp.o: %.cpp ../CarlaEngine.hpp ../CarlaPlugin.hpp CarlaPluginInternal.hpp CarlaPluginThread.hpp
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

$(SHARED): $(OBJS) $(LIBS)
$(SHARED): $(OBJS)
$(CXX) $^ -shared $(LINK_FLAGS) -o $@

$(STATIC): $(OBJS) $(LIBS)
$(STATIC): $(OBJS)
$(AR) rs $@ $^

+ 6
- 1
source/libs/Makefile View File

@@ -1,6 +1,6 @@
#!/usr/bin/make -f
# Makefile for carla libs #
# ----------------------------------------- #
# ----------------------- #
# Created by falkTX
#

@@ -8,6 +8,11 @@ all:

# --------------------------------------------------------------

dgl.a:
$(MAKE) -C distrho/dgl

# --------------------------------------------------------------

jackbridge-win32.dll:
$(MAKE) -C jackbridge win32



+ 3
- 1
source/libs/distrho/DistrhoUIOpenGL.hpp View File

@@ -21,6 +21,8 @@

#include "dgl/Widget.hpp"

USE_NAMESPACE_DGL

START_NAMESPACE_DISTRHO

// -------------------------------------------------
@@ -57,7 +59,7 @@ protected:
// ---------------------------------------------
// UI Callbacks

virtual void d_uiIdle() = 0;
virtual void d_uiIdle() {}

private:
friend class UIInternal;


+ 1
- 0
source/libs/distrho/dgl/Image.hpp View File

@@ -27,6 +27,7 @@ class Image
{
public:
Image();
Image(const char* rawData, int width, int height, GLenum format = GL_BGRA, GLenum type = GL_UNSIGNED_BYTE);
Image(const char* rawData, const Size<int>& size, GLenum format = GL_BGRA, GLenum type = GL_UNSIGNED_BYTE);
Image(const Image& image);



+ 49
- 0
source/libs/distrho/dgl/Makefile View File

@@ -0,0 +1,49 @@
#!/usr/bin/make -f
# Makefile for dgl #
# ---------------- #
# Created by falkTX
#

include ../../../Makefile.mk

# --------------------------------------------------------------

BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC
BUILD_CXX_FLAGS += -I.

OBJS = \
src/App.cpp.o \
src/Image.cpp.o \
src/ImageAboutWindow.cpp.o \
src/ImageButton.cpp.o \
src/ImageKnob.cpp.o \
src/ImageSlider.cpp.o \
src/Geometry.cpp.o \
src/Widget.cpp.o \
src/Window.cpp.o

STATIC = ../../dgl.a

# --------------------------------------------------------------

all: $(STATIC)

clean:
rm -f $(OBJS) $(SHARED) $(STATIC)

debug:
$(MAKE) DEBUG=true

# --------------------------------------------------------------

%.cpp.o: %.cpp
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

$(STATIC): $(OBJS)
$(AR) rs $@ $^

../../dgl.dll: $(OBJS)
$(CXX) $^ -shared $(LINK_FLAGS) -lopengl32 -lgdi32 -o $@

../../dgl.so: $(OBJS)
$(CXX) $^ -shared $(LINK_FLAGS) -lX11 -lGL -lGLU -o $@

+ 8
- 0
source/libs/distrho/dgl/src/Image.cpp View File

@@ -28,6 +28,14 @@ Image::Image()
{
}

Image::Image(const char* rawData, int width, int height, GLenum format, GLenum type)
: fRawData(rawData),
fSize(width, height),
fFormat(format),
fType(type)
{
}

Image::Image(const char* rawData, const Size<int>& size, GLenum format, GLenum type)
: fRawData(rawData),
fSize(size),


+ 0
- 6
source/libs/distrho/src/DistrhoUI.cpp View File

@@ -36,12 +36,6 @@ UI::UI()
# endif
pData->parameterOffset += 1; // sample-rate
#endif

#ifdef DISTRHO_UI_QT4
pData->ui = (Qt4UI*)this;
#else
pData->ui = (OpenGLUI*)this;
#endif
}

UI::~UI()


+ 1
- 3
source/libs/distrho/src/DistrhoUIInternal.hpp View File

@@ -164,8 +164,6 @@ public:

#ifdef DISTRHO_UI_QT4
createWindow(winId);
#else
d_lastUiParent = nullptr;
#endif
}

@@ -316,7 +314,7 @@ public:
Window* createWindow(intptr_t parent)
{
Window* window = new Window(&glApp, parent);
d_lastParent = window;
d_lastUiParent = window;
return window;
}
#endif


+ 1
- 0
source/libs/distrho/src/DistrhoUIOpenGL.cpp View File

@@ -30,6 +30,7 @@ OpenGLUI::OpenGLUI()
: UI(),
Widget(d_lastParent)
{
d_lastParent = nullptr;
}

OpenGLUI::~OpenGLUI()


Loading…
Cancel
Save