Browse Source

Cleanup to widgets code

tags/1.9.4
falkTX 11 years ago
parent
commit
5cabebe0a8
8 changed files with 63 additions and 10 deletions
  1. +1
    -1
      source/modules/widgets/Makefile
  2. +0
    -1
      source/modules/widgets/digitalpeakmeter.hpp
  3. +0
    -3
      source/modules/widgets/ledbutton.hpp
  4. +0
    -1
      source/modules/widgets/paramspinbox.hpp
  5. +0
    -1
      source/modules/widgets/pixmapdial.hpp
  6. +0
    -1
      source/modules/widgets/pixmapkeyboard.hpp
  7. +15
    -2
      source/tests/Makefile
  8. +47
    -0
      source/tests/Widgets.cpp

+ 1
- 1
source/modules/widgets/Makefile View File

@@ -50,7 +50,7 @@ all: ../widgets.a
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

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

moc_%.cpp: %.hpp
$(MOC) $< -o $@


+ 0
- 1
source/modules/widgets/digitalpeakmeter.hpp View File

@@ -74,7 +74,6 @@ private:
float* fChannelsData;
float* fLastValueData;

CARLA_PREVENT_HEAP_ALLOCATION
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DigitalPeakMeter)
};



+ 0
- 3
source/modules/widgets/ledbutton.hpp View File

@@ -30,8 +30,6 @@

class LEDButton : public QPushButton
{
Q_OBJECT

public:
enum Color {
OFF = 0,
@@ -54,7 +52,6 @@ private:
QPixmap fPixmap;
QRectF fPixmapRect;

CARLA_PREVENT_HEAP_ALLOCATION
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(LEDButton)
};



+ 0
- 1
source/modules/widgets/paramspinbox.hpp View File

@@ -68,7 +68,6 @@ private:

TextCallback* m_textCall;

CARLA_PREVENT_HEAP_ALLOCATION
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ParamProgressBar)
};



+ 0
- 1
source/modules/widgets/pixmapdial.hpp View File

@@ -93,7 +93,6 @@ private:

int fWidth, fHeight, fSize, fCount;

CARLA_PREVENT_HEAP_ALLOCATION
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PixmapDial)
};



+ 0
- 1
source/modules/widgets/pixmapkeyboard.hpp View File

@@ -87,7 +87,6 @@ private:
bool _isNoteBlack(int note) const;
const QRectF& _getRectFromMidiNote(int note) const;

CARLA_PREVENT_HEAP_ALLOCATION
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PixmapKeyboard)
};



+ 15
- 2
source/tests/Makefile View File

@@ -8,7 +8,7 @@ include ../Makefile.mk

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

BUILD_CXX_FLAGS += -I../backend -I../includes -I../modules -I../modules/distrho -I../modules/theme -I../modules/utils
BUILD_CXX_FLAGS += -I../backend -I../includes -I../modules -I../modules/distrho -I../modules/theme -I../modules/utils -I../modules/widgets
BUILD_CXX_FLAGS += -DWANT_NATIVE -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_FLUIDSYNTH -DWANT_LINUXSAMPLER
BUILD_CXX_FLAGS += -DWANT_RTAUDIO -DWANT_OPENGL -DWANT_AUDIOFILE -DWANT_MIDIFILE -DWANT_ZYNADDSUBFX -DWANT_ZYNADDSUBFX_UI
BUILD_CXX_FLAGS += -isystem /usr/include/qt4
@@ -62,14 +62,27 @@ Print: Print.cpp
Utils: Utils.cpp
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -pthread -lpthread -o $@

Widgets: Widgets.cpp resources.cpp.o ../modules/theme.a ../modules/widgets.a
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lQtCore -lQtGui -o $@

RUN: $(TARGETS)
./ANSI && ./CarlaString && ./RtList && ./Print && ./Utils
./DGL1 && ./DGL2

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

resources.cpp.o: ../../resources/resources.qrc
$(RCC) $< -o resources.cpp
$(CXX) resources.cpp $(BUILD_CXX_FLAGS) -c -o $@
rm resources.cpp

../modules/%.a:
$(MAKE) -C ../modules $*

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

clean:
rm -f $(TARGETS)
rm -f *.o $(TARGETS)

debug:
$(MAKE) DEBUG=true

+ 47
- 0
source/tests/Widgets.cpp View File

@@ -0,0 +1,47 @@
/*
* Carla Tests
* Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the GPL.txt file
*/

#include "CarlaStyle.hpp"
#include "digitalpeakmeter.hpp"
#include "ledbutton.hpp"
#include "paramspinbox.hpp"
#include "pixmapdial.hpp"
#include "pixmapkeyboard.hpp"

#include <QtGui/QApplication>

int main(int argc, char* argv[])
{
QApplication app(argc, argv);
app.setStyle(new CarlaStyle());

DigitalPeakMeter w1(nullptr);
LEDButton w2(nullptr);
ParamProgressBar w3(nullptr);
PixmapDial w4(nullptr);
PixmapKeyboard w5(nullptr);

w4.setPixmap(2);

w1.show();
w2.show();
w3.show();
w4.show();
w5.show();

return app.exec();
}

Loading…
Cancel
Save