summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/Makefile.am6
-rw-r--r--plugin/Makefile.mingw32.in98
-rw-r--r--plugin/drumgizmo_plugin.cc22
-rw-r--r--plugin/drumgizmo_plugin.h22
4 files changed, 83 insertions, 65 deletions
diff --git a/plugin/Makefile.am b/plugin/Makefile.am
index f382acc..935b601 100644
--- a/plugin/Makefile.am
+++ b/plugin/Makefile.am
@@ -19,6 +19,7 @@ drumgizmo_la_CXXFLAGS = -DLV2 -DLV2_PLUGIN_URI=\"http://drumgizmo.org/lv2\" \
$(LV2_CFLAGS) \
$(SNDFILE_CFLAGS) \
-I$(top_srcdir)/plugin/plugingizmo \
+ -I$(top_srcdir)/ \
-I$(top_srcdir)/plugingui \
-I$(top_srcdir)/src \
-I$(top_srcdir)/hugin
@@ -35,7 +36,7 @@ drumgizmo_la_LDFLAGS = -shared -module -avoid-version \
-no-undefined -export-symbols $(top_srcdir)/plugin/drumgizmo_lv2.sym
drumgizmo_la_LIBADD = $(LV2_LIBS) \
- $(top_builddir)/plugingui/libdggui.la \
+ $(top_builddir)/plugingui/libplugingui.la \
$(top_builddir)/src/libdg.la \
$(top_builddir)/src/libnls.la
@@ -93,6 +94,7 @@ drumgizmo_vst_la_CXXFLAGS = -DVST \
-I$(top_srcdir)/zita-resampler/libs \
$(SNDFILE_CFLAGS) \
-I$(top_srcdir)/plugin/plugingizmo \
+ -I$(top_srcdir)/ \
-I$(top_srcdir)/plugingui \
-I$(top_srcdir)/src \
-I$(top_srcdir)/hugin \
@@ -111,7 +113,7 @@ drumgizmo_vst_la_LDFLAGS = -shared -module -avoid-version \
drumgizmo_vst_la_LIBADD = \
vst/libvstsdk.la \
- $(top_builddir)/plugingui/libdggui.la \
+ $(top_builddir)/plugingui/libplugingui.la \
$(top_builddir)/src/libdg.la \
$(top_builddir)/src/libnls.la
diff --git a/plugin/Makefile.mingw32.in b/plugin/Makefile.mingw32.in
index 2c2055c..ad47bcc 100644
--- a/plugin/Makefile.mingw32.in
+++ b/plugin/Makefile.mingw32.in
@@ -59,66 +59,70 @@ DG_CFLAGS = -I@top_srcdir@ -I@top_srcdir@/src \
GUI_SRC = \
@top_srcdir@/plugingui/abouttab.cc \
@top_srcdir@/plugingui/bleedcontrolframecontent.cc \
- @top_srcdir@/plugingui/button.cc \
- @top_srcdir@/plugingui/button_base.cc \
- @top_srcdir@/plugingui/checkbox.cc \
- @top_srcdir@/plugingui/colour.cc \
- @top_srcdir@/plugingui/combobox.cc \
- @top_srcdir@/plugingui/dialog.cc \
@top_srcdir@/plugingui/diskstreamingframecontent.cc \
@top_srcdir@/plugingui/drumkitframecontent.cc \
@top_srcdir@/plugingui/drumkittab.cc \
- @top_srcdir@/plugingui/eventhandler.cc \
@top_srcdir@/plugingui/filebrowser.cc \
- @top_srcdir@/plugingui/font.cc \
- @top_srcdir@/plugingui/frame.cc \
- @top_srcdir@/plugingui/helpbutton.cc \
- @top_srcdir@/plugingui/humanizerframecontent.cc \
@top_srcdir@/plugingui/humaniservisualiser.cc \
- @top_srcdir@/plugingui/image.cc \
- @top_srcdir@/plugingui/imagecache.cc \
- @top_srcdir@/plugingui/knob.cc \
- @top_srcdir@/plugingui/label.cc \
- @top_srcdir@/plugingui/layout.cc \
- @top_srcdir@/plugingui/led.cc \
- @top_srcdir@/plugingui/lineedit.cc \
- @top_srcdir@/plugingui/listbox.cc \
- @top_srcdir@/plugingui/listboxbasic.cc \
- @top_srcdir@/plugingui/listboxthin.cc \
+ @top_srcdir@/plugingui/humanizerframecontent.cc \
@top_srcdir@/plugingui/maintab.cc \
@top_srcdir@/plugingui/mainwindow.cc \
- @top_srcdir@/plugingui/nativewindow_win32.cc \
- @top_srcdir@/plugingui/painter.cc \
- @top_srcdir@/plugingui/pixelbuffer.cc \
@top_srcdir@/plugingui/pluginconfig.cc \
- @top_srcdir@/plugingui/powerbutton.cc \
@top_srcdir@/plugingui/powerwidget.cc \
- @top_srcdir@/plugingui/progressbar.cc \
@top_srcdir@/plugingui/resamplingframecontent.cc \
- @top_srcdir@/plugingui/resource.cc \
@top_srcdir@/plugingui/sampleselectionframecontent.cc \
- @top_srcdir@/plugingui/scrollbar.cc \
- @top_srcdir@/plugingui/slider.cc \
- @top_srcdir@/plugingui/stackedwidget.cc \
@top_srcdir@/plugingui/statusframecontent.cc \
- @top_srcdir@/plugingui/tabbutton.cc \
- @top_srcdir@/plugingui/tabwidget.cc \
- @top_srcdir@/plugingui/textedit.cc \
- @top_srcdir@/plugingui/texture.cc \
- @top_srcdir@/plugingui/texturedbox.cc \
@top_srcdir@/plugingui/timingframecontent.cc \
- @top_srcdir@/plugingui/toggle.cc \
- @top_srcdir@/plugingui/tooltip.cc \
- @top_srcdir@/plugingui/uitranslation.cc \
- @top_srcdir@/plugingui/utf8.cc \
- @top_srcdir@/plugingui/verticalline.cc \
@top_srcdir@/plugingui/visualizerframecontent.cc \
@top_srcdir@/plugingui/voicelimitframecontent.cc \
- @top_srcdir@/plugingui/widget.cc \
- @top_srcdir@/plugingui/window.cc \
- @top_srcdir@/plugingui/lodepng/lodepng.cpp
+\
+ @top_srcdir@/dggui/button.cc \
+ @top_srcdir@/dggui/button_base.cc \
+ @top_srcdir@/dggui/checkbox.cc \
+ @top_srcdir@/dggui/colour.cc \
+ @top_srcdir@/dggui/combobox.cc \
+ @top_srcdir@/dggui/dialog.cc \
+ @top_srcdir@/dggui/eventhandler.cc \
+ @top_srcdir@/dggui/font.cc \
+ @top_srcdir@/dggui/frame.cc \
+ @top_srcdir@/dggui/helpbutton.cc \
+ @top_srcdir@/dggui/image.cc \
+ @top_srcdir@/dggui/imagecache.cc \
+ @top_srcdir@/dggui/knob.cc \
+ @top_srcdir@/dggui/label.cc \
+ @top_srcdir@/dggui/layout.cc \
+ @top_srcdir@/dggui/led.cc \
+ @top_srcdir@/dggui/lineedit.cc \
+ @top_srcdir@/dggui/listbox.cc \
+ @top_srcdir@/dggui/listboxbasic.cc \
+ @top_srcdir@/dggui/listboxthin.cc \
+ @top_srcdir@/dggui/painter.cc \
+ @top_srcdir@/dggui/pixelbuffer.cc \
+ @top_srcdir@/dggui/powerbutton.cc \
+ @top_srcdir@/dggui/progressbar.cc \
+ @top_srcdir@/dggui/rc_data.cc \
+ @top_srcdir@/dggui/resource.cc \
+ @top_srcdir@/dggui/scrollbar.cc \
+ @top_srcdir@/dggui/slider.cc \
+ @top_srcdir@/dggui/stackedwidget.cc \
+ @top_srcdir@/dggui/tabbutton.cc \
+ @top_srcdir@/dggui/tabwidget.cc \
+ @top_srcdir@/dggui/textedit.cc \
+ @top_srcdir@/dggui/texture.cc \
+ @top_srcdir@/dggui/texturedbox.cc \
+ @top_srcdir@/dggui/toggle.cc \
+ @top_srcdir@/dggui/tooltip.cc \
+ @top_srcdir@/dggui/uitranslation.cc \
+ @top_srcdir@/dggui/utf8.cc \
+ @top_srcdir@/dggui/verticalline.cc \
+ @top_srcdir@/dggui/widget.cc \
+ @top_srcdir@/dggui/window.cc \
+\
+ @top_srcdir@/dggui/lodepng/lodepng.cpp \
+ @top_srcdir@/dggui/nativewindow_win32.cc
+
-GUI_CPPFLAGS=-I@top_srcdir@/plugingui/ -DUSE_THREAD @GUI_CPPFLAGS@
+GUI_CPPFLAGS=-I@top_srcdir@/plugingui/ -I@top_srcdir@/ -DUSE_THREAD @GUI_CPPFLAGS@
GUI_LIBS=@GUI_LIBS@
DBG_SRC = \
@@ -186,9 +190,9 @@ NLS_RES = \
all:
(cd @top_srcdir@/plugingui/locale; msgfmt -c -v -o da.mo da.po)
(cd @top_srcdir@/plugingui/locale; msgfmt -c -v -o fr.mo fr.po)
- g++ -I@top_srcdir@/getoptpp @top_srcdir@/plugingui/rcgen.cc -o @top_srcdir@/plugingui/rcgen
- @top_srcdir@/plugingui/rcgen -s @top_srcdir@/plugingui/ -s @top_builddir@/plugingui/ $(RES) $(NLS_RES) -o @top_srcdir@/plugingui/resource_data.cc
- g++ $(CXXFLAGS) @top_srcdir@/plugingui/resource_data.cc -c
+ g++ -I@top_srcdir@/getoptpp @top_srcdir@/dggui/rcgentool.cc -o @top_srcdir@/dggui/rcgen
+ @top_srcdir@/dggui/rcgen -s @top_srcdir@/dggui/ -s @top_builddir@/plugingui/ $(RES) $(NLS_RES) -o @top_srcdir@/plugingui/resource_data.cc
+ g++ $(CXXFLAGS) -I@top_srcdir@ @top_srcdir@/plugingui/resource_data.cc -c
gcc $(CFLAGS) $(DBG_CFLAGS) @top_srcdir@/hugin/hugin.c -c
gcc $(CFLAGS) $(DBG_CFLAGS) @top_srcdir@/hugin/hugin_syslog.c -c
g++ $(LDFLAGS) $(CXXFLAGS) -std=c++11 -static -static-libgcc -O2 -g -Wall $(DBG_CFLAGS) $(DG_CFLAGS) $(DG_LIBS) $(VST_CFLAGS) hugin.o hugin_syslog.o resource_data.o $(DG_SRC) $(VST_SRC) ${SRC} ${GUI_SRC} ${GUI_CPPFLAGS} $(GUI_LIBS) $(SNDFILE_CFLAGS) $(SNDFILE_LIBS) -latomic -shared -Wl,-retain-symbols-file -Wl,drumgizmo_vst.sym -o drumgizmo_vst.dll -Wl,--out-implib,libdrumgizmo_vst.a
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc
index b955eb3..7960763 100644
--- a/plugin/drumgizmo_plugin.cc
+++ b/plugin/drumgizmo_plugin.cc
@@ -176,7 +176,7 @@ bool DrumGizmoPlugin::hasInlineGUI()
}
class InlinePixelBufferAlpha
- : public GUI::PixelBufferAlpha
+ : public dggui::PixelBufferAlpha
{
public:
InlinePixelBufferAlpha(Plugin::InlineDrawContext& context)
@@ -190,7 +190,7 @@ public:
};
class InlineCanvas
- : public GUI::Canvas
+ : public dggui::Canvas
{
public:
InlineCanvas(Plugin::InlineDrawContext& context)
@@ -199,7 +199,7 @@ public:
}
// From Canvas:
- GUI::PixelBufferAlpha& getPixelBuffer() override
+ dggui::PixelBufferAlpha& getPixelBuffer() override
{
return pixbuf;
}
@@ -257,7 +257,7 @@ void DrumGizmoPlugin::onInlineRedraw(std::size_t width,
context.data = (unsigned char*)inlineDisplayBuffer;
InlineCanvas canvas(context);
- GUI::Painter painter(canvas);
+ dggui::Painter painter(canvas);
double progress =
(double)settingsGetter.number_of_files_loaded.getValue() /
@@ -281,6 +281,7 @@ void DrumGizmoPlugin::onInlineRedraw(std::size_t width,
bar_green.setSize(val, bar_height);
painter.drawImage(brd, height - bar_height, bar_green);
break;
+ case LoadStatus::Parsing:
case LoadStatus::Loading:
case LoadStatus::Idle:
bar_blue.setSize(val, bar_height);
@@ -409,7 +410,18 @@ bool DrumGizmoPlugin::Input::loadMidiMap(const std::string& file,
bool result = AudioInputEngineMidi::loadMidiMap(file, i);
std::vector<std::pair<int, std::string>> midnam;
- const auto& map = mmap.getMap();
+ const auto& midimap = mmap.getMap();
+ std::map<int, std::string> map;
+ for(const auto& entry : midimap)
+ {
+ // in case of multiple instruments mapped to one note, use '/' as separator
+ if(!map[entry.note_id].empty())
+ {
+ map[entry.note_id] += "/";
+ }
+ map[entry.note_id] += entry.instrument_name;
+ }
+
midnam.reserve(map.size());
for(const auto& m : map)
{
diff --git a/plugin/drumgizmo_plugin.h b/plugin/drumgizmo_plugin.h
index 78a74dc..09cdcba 100644
--- a/plugin/drumgizmo_plugin.h
+++ b/plugin/drumgizmo_plugin.h
@@ -39,14 +39,14 @@
#endif
#include <drumgizmo.h>
-#include <uitranslation.h>
#include <audioinputenginemidi.h>
#include <audiooutputengine.h>
#include <mainwindow.h>
-#include <texturedbox.h>
-#include <imagecache.h>
-#include <image.h>
+#include <dggui/uitranslation.h>
+#include <dggui/texturedbox.h>
+#include <dggui/imagecache.h>
+#include <dggui/image.h>
class DrumGizmoPlugin
#ifdef LV2
@@ -188,23 +188,23 @@ private:
ConfigStringIO config_string_io;
SettingsGetter settingsGetter{settings};
- GUI::ImageCache imageCache;
- GUI::TexturedBox box{imageCache, ":resources/progress.png",
+ dggui::ImageCache imageCache;
+ dggui::TexturedBox box{imageCache, ":resources/progress.png",
0, 0, // atlas offset (x, y)
6, 1, 6, // dx1, dx2, dx3
11, 0, 0}; // dy1, dy2, dy3
- GUI::TexturedBox bar_red{imageCache, ":resources/progress.png",
+ dggui::TexturedBox bar_red{imageCache, ":resources/progress.png",
13, 0, // atlas offset (x, y)
2, 1, 2, // dx1, dx2, dx3
11, 0, 0}; // dy1, dy2, dy3
- GUI::TexturedBox bar_green{imageCache, ":resources/progress.png",
+ dggui::TexturedBox bar_green{imageCache, ":resources/progress.png",
18, 0, // atlas offset (x, y)
2, 1, 2, // dx1, dx2, dx3
11, 0, 0}; // dy1, dy2, dy3
- GUI::TexturedBox bar_blue{imageCache, ":resources/progress.png",
+ dggui::TexturedBox bar_blue{imageCache, ":resources/progress.png",
23, 0, // atlas offset (x, y)
2, 1, 2, // dx1, dx2, dx3
11, 0, 0}; // dy1, dy2, dy3
@@ -213,10 +213,10 @@ private:
std::shared_ptr<DrumGizmo> drumgizmo;
std::uint32_t inlineDisplayBuffer[1024*1024];
- GUI::Image inline_display_image{":resources/logo.png"};
+ dggui::Image inline_display_image{":resources/logo.png"};
bool inline_image_first_draw{true};
#ifdef WITH_NLS
- UITranslation translation;
+ dggui::UITranslation translation;
#endif // WITH_NLS
};