Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
4.1KB

  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2011 Fons Adriaensen <fons@linuxaudio.org>
  4. // Modified by falkTX on Jan 2015 for inclusion in Carla
  5. //
  6. // This program is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation; either version 2 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software
  18. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. //
  20. // ----------------------------------------------------------------------
  21. #include "styles.h"
  22. #include "png2img.h"
  23. #include "CarlaString.hpp"
  24. namespace BLS1 {
  25. XftColor *XftColors [NXFTCOLORS];
  26. XftFont *XftFonts [NXFTFONTS];
  27. X_textln_style tstyle1;
  28. XImage *inputsect;
  29. XImage *shuffsect;
  30. XImage *lfshfsect;
  31. RotaryImg inpbal_img;
  32. RotaryImg hpfilt_img;
  33. RotaryImg shfreq_img;
  34. RotaryImg shgain_img;
  35. RotaryImg lffreq_img;
  36. RotaryImg lfgain_img;
  37. int styles_init (X_display *disp, X_resman *xrm, const char *resdir)
  38. {
  39. XftColors [C_MAIN_BG] = disp->alloc_xftcolor (0.25f, 0.25f, 0.25f, 1.0f);
  40. XftColors [C_MAIN_FG] = disp->alloc_xftcolor (1.0f, 1.0f, 1.0f, 1.0f);
  41. XftColors [C_TEXT_BG] = disp->alloc_xftcolor (1.0f, 1.0f, 0.0f, 1.0f);
  42. XftColors [C_TEXT_FG] = disp->alloc_xftcolor (0.0f, 0.0f, 0.0f, 1.0f);
  43. XftFonts [F_TEXT] = disp->alloc_xftfont (xrm->get (".font.text", "luxi:bold::pixelsize=11"));
  44. tstyle1.font = XftFonts [F_TEXT];
  45. tstyle1.color.normal.bgnd = XftColors [C_TEXT_BG]->pixel;
  46. tstyle1.color.normal.text = XftColors [C_TEXT_FG];
  47. const CarlaString SHARED = CarlaString(resdir)+"/bls1";
  48. inputsect = png2img (SHARED+"/inputsect.png", disp, XftColors [C_MAIN_BG]);
  49. shuffsect = png2img (SHARED+"/shuffsect.png", disp, XftColors [C_MAIN_BG]);
  50. lfshfsect = png2img (SHARED+"/lfshfsect.png", disp, XftColors [C_MAIN_BG]);
  51. if (!inputsect || !shuffsect || !lfshfsect) return 1;
  52. inpbal_img._backg = XftColors [C_MAIN_BG];
  53. inpbal_img._image [0] = inputsect;
  54. inpbal_img._lncol [0] = 1;
  55. inpbal_img._x0 = 28;
  56. inpbal_img._y0 = 17;
  57. inpbal_img._dx = 25;
  58. inpbal_img._dy = 25;
  59. inpbal_img._xref = 12.5;
  60. inpbal_img._yref = 12.5;
  61. inpbal_img._rad = 12;
  62. hpfilt_img._backg = XftColors [C_MAIN_BG];
  63. hpfilt_img._image [0] = inputsect;
  64. hpfilt_img._lncol [0] = 0;
  65. hpfilt_img._x0 = 87;
  66. hpfilt_img._y0 = 17;
  67. hpfilt_img._dx = 25;
  68. hpfilt_img._dy = 25;
  69. hpfilt_img._xref = 12.5;
  70. hpfilt_img._yref = 12.5;
  71. hpfilt_img._rad = 12;
  72. shgain_img._backg = XftColors [C_MAIN_BG];
  73. shgain_img._image [0] = shuffsect;
  74. shgain_img._lncol [0] = 0;
  75. shgain_img._x0 = 68;
  76. shgain_img._y0 = 17;
  77. shgain_img._dx = 25;
  78. shgain_img._dy = 25;
  79. shgain_img._xref = 12.5;
  80. shgain_img._yref = 12.5;
  81. shgain_img._rad = 12;
  82. shfreq_img._backg = XftColors [C_MAIN_BG];
  83. shfreq_img._image [0] = shuffsect;
  84. shfreq_img._lncol [0] = 0;
  85. shfreq_img._x0 = 127;
  86. shfreq_img._y0 = 17;
  87. shfreq_img._dx = 25;
  88. shfreq_img._dy = 25;
  89. shfreq_img._xref = 12.5;
  90. shfreq_img._yref = 12.5;
  91. shfreq_img._rad = 12;
  92. lffreq_img._backg = XftColors [C_MAIN_BG];
  93. lffreq_img._image [0] = lfshfsect;
  94. lffreq_img._lncol [0] = 0;
  95. lffreq_img._x0 = 14;
  96. lffreq_img._y0 = 31;
  97. lffreq_img._dx = 25;
  98. lffreq_img._dy = 25;
  99. lffreq_img._xref = 12.5;
  100. lffreq_img._yref = 12.5;
  101. lffreq_img._rad = 12;
  102. lfgain_img._backg = XftColors [C_MAIN_BG];
  103. lfgain_img._image [0] = lfshfsect;
  104. lfgain_img._lncol [0] = 1;
  105. lfgain_img._x0 = 63;
  106. lfgain_img._y0 = 17;
  107. lfgain_img._dx = 25;
  108. lfgain_img._dy = 25;
  109. lfgain_img._xref = 12.5;
  110. lfgain_img._yref = 12.5;
  111. lfgain_img._rad = 12;
  112. return 0;
  113. }
  114. void styles_fini (X_display *disp)
  115. {
  116. }
  117. }