Browse Source

Fix path to zyn resources, closes #252

tags/1.9.7
falkTX 9 years ago
parent
commit
1a0bae0b9f
4 changed files with 23 additions and 10 deletions
  1. +14
    -1
      source/native-plugins/zynaddsubfx-ui.cpp
  2. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Connection.cpp
  3. +4
    -4
      source/native-plugins/zynaddsubfx/UI/VirKeyboard.fl
  4. +3
    -3
      source/native-plugins/zynaddsubfx/UI/guimain.cpp

+ 14
- 1
source/native-plugins/zynaddsubfx-ui.cpp View File

@@ -26,7 +26,20 @@
#define SOURCE_DIR "/usr/share/zynaddsubfx"
#undef override

CarlaString gUiPixmapPath("/usr/share/carla/resources/zynaddsubfx/");
#ifdef NTK_GUI
# include <dlfcn.h>

static CarlaString getResourceDir()
{
Dl_info exeInfo;
dladdr((void*)getResourceDir, &exeInfo);

CarlaString filename(exeInfo.dli_fname);
return filename.truncate(filename.rfind("-ui"));
}

CarlaString gUiPixmapPath(getResourceDir());
#endif

// base c-style headers
#include "zynaddsubfx/rtosc/rtosc.h"


+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Connection.cpp View File

@@ -83,7 +83,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit)


#ifdef CARLA_VERSION_STRING
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "window_backdrop.png"))
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "/window_backdrop.png"))
Fl::scheme_bg(new Fl_Tiled_Image(img));
#else
if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/window_backdrop.png"))
@@ -95,7 +95,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit)
errx(1, "ERROR: Cannot find pixmaps/window_backdrop.png");

#ifdef CARLA_VERSION_STRING
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "module_backdrop.png"))
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "/module_backdrop.png"))
module_backdrop = new Fl_Tiled_Image(img);
#else
if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/module_backdrop.png"))


+ 4
- 4
source/native-plugins/zynaddsubfx/UI/VirKeyboard.fl View File

@@ -102,10 +102,10 @@ rndvelocity=0;} {selected

\#ifdef NTK_GUI
\#ifdef CARLA_VERSION_STRING
Fl_Image *white_up = Fl_Shared_Image::get( gUiPixmapPath + "white_key.png" );
Fl_Image *white_down = Fl_Shared_Image::get( gUiPixmapPath + "white_key_pressed.png" );
Fl_Image *black_up = Fl_Shared_Image::get( gUiPixmapPath + "black_key.png" );
Fl_Image *black_down = Fl_Shared_Image::get( gUiPixmapPath + "black_key_pressed.png" );
Fl_Image *white_up = Fl_Shared_Image::get( gUiPixmapPath + "/white_key.png" );
Fl_Image *white_down = Fl_Shared_Image::get( gUiPixmapPath + "/white_key_pressed.png" );
Fl_Image *black_up = Fl_Shared_Image::get( gUiPixmapPath + "/black_key.png" );
Fl_Image *black_down = Fl_Shared_Image::get( gUiPixmapPath + "/black_key_pressed.png" );
\#else
Fl_Image *white_up = Fl_Shared_Image::get( PIXMAP_PATH "white_key.png" );
Fl_Image *white_down = Fl_Shared_Image::get( PIXMAP_PATH "white_key_pressed.png" );


+ 3
- 3
source/native-plugins/zynaddsubfx/UI/guimain.cpp View File

@@ -126,7 +126,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit)
Fl_Dial::default_style(Fl_Dial::PIXMAP_DIAL);

#ifdef CARLA_VERSION_STRING
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "knob.png"))
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "/knob.png"))
Fl_Dial::default_image(img);
#else
if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/knob.png"))
@@ -139,7 +139,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit)


#ifdef CARLA_VERSION_STRING
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "window_backdrop.png"))
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "/window_backdrop.png"))
Fl::scheme_bg(new Fl_Tiled_Image(img));
#else
if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/window_backdrop.png"))
@@ -151,7 +151,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit)
errx(1, "ERROR: Cannot find pixmaps/window_backdrop.png");

#ifdef CARLA_VERSION_STRING
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "module_backdrop.png"))
if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "/module_backdrop.png"))
module_backdrop = new Fl_Tiled_Image(img);
#else
if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/module_backdrop.png"))


Loading…
Cancel
Save