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.

178 lines
5.1KB

  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2010 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 REV1 {
  25. XftColor *XftColors [NXFTCOLORS];
  26. XImage *revsect_img;
  27. XImage *eq1sect_img;
  28. XImage *eq2sect_img;
  29. XImage *mixsect_img;
  30. XImage *ambsect_img;
  31. RotaryImg r_delay_img;
  32. RotaryImg r_xover_img;
  33. RotaryImg r_rtlow_img;
  34. RotaryImg r_rtmid_img;
  35. RotaryImg r_fdamp_img;
  36. RotaryImg r_parfr_img;
  37. RotaryImg r_pargn_img;
  38. RotaryImg r_opmix_img;
  39. RotaryImg r_rgxyz_img;
  40. int styles_init (X_display *disp, X_resman *xrm, const char *resdir)
  41. {
  42. XftColors [C_MAIN_BG] = disp->alloc_xftcolor (0.25f, 0.25f, 0.25f, 1.0f);
  43. XftColors [C_MAIN_FG] = disp->alloc_xftcolor (1.0f, 1.0f, 1.0f, 1.0f);
  44. const CarlaString SHARED = CarlaString(resdir)+"/rev1";
  45. revsect_img = png2img (SHARED+"/revsect.png", disp, XftColors [C_MAIN_BG]);
  46. eq1sect_img = png2img (SHARED+"/eq1sect.png", disp, XftColors [C_MAIN_BG]);
  47. eq2sect_img = png2img (SHARED+"/eq2sect.png", disp, XftColors [C_MAIN_BG]);
  48. mixsect_img = png2img (SHARED+"/mixsect.png", disp, XftColors [C_MAIN_BG]);
  49. ambsect_img = png2img (SHARED+"/ambsect.png", disp, XftColors [C_MAIN_BG]);
  50. if (!revsect_img || !mixsect_img || !ambsect_img
  51. || !eq1sect_img || !eq2sect_img)
  52. {
  53. fprintf (stderr, "Can't load images from '%s'.\n", SHARED.buffer());
  54. return 1;
  55. }
  56. r_delay_img._backg = XftColors [C_MAIN_BG];
  57. r_delay_img._image [0] = revsect_img;
  58. r_delay_img._lncol [0] = 0;
  59. r_delay_img._x0 = 30;
  60. r_delay_img._y0 = 32;
  61. r_delay_img._dx = 23;
  62. r_delay_img._dy = 23;
  63. r_delay_img._xref = 11.5;
  64. r_delay_img._yref = 11.5;
  65. r_delay_img._rad = 11;
  66. r_xover_img._backg = XftColors [C_MAIN_BG];
  67. r_xover_img._image [0] = revsect_img;
  68. r_xover_img._lncol [0] = 0;
  69. r_xover_img._x0 = 92;
  70. r_xover_img._y0 = 17;
  71. r_xover_img._dx = 23;
  72. r_xover_img._dy = 23;
  73. r_xover_img._xref = 11.5;
  74. r_xover_img._yref = 11.5;
  75. r_xover_img._rad = 11;
  76. r_rtlow_img._backg = XftColors [C_MAIN_BG];
  77. r_rtlow_img._image [0] = revsect_img;
  78. r_rtlow_img._lncol [0] = 0;
  79. r_rtlow_img._x0 = 147;
  80. r_rtlow_img._y0 = 17;
  81. r_rtlow_img._dx = 23;
  82. r_rtlow_img._dy = 23;
  83. r_rtlow_img._xref = 11.5;
  84. r_rtlow_img._yref = 11.5;
  85. r_rtlow_img._rad = 11;
  86. r_rtmid_img._backg = XftColors [C_MAIN_BG];
  87. r_rtmid_img._image [0] = revsect_img;
  88. r_rtmid_img._lncol [0] = 0;
  89. r_rtmid_img._x0 = 207;
  90. r_rtmid_img._y0 = 17;
  91. r_rtmid_img._dx = 23;
  92. r_rtmid_img._dy = 23;
  93. r_rtmid_img._xref = 11.5;
  94. r_rtmid_img._yref = 11.5;
  95. r_rtmid_img._rad = 11;
  96. r_fdamp_img._backg = XftColors [C_MAIN_BG];
  97. r_fdamp_img._image [0] = revsect_img;
  98. r_fdamp_img._lncol [0] = 0;
  99. r_fdamp_img._x0 = 267;
  100. r_fdamp_img._y0 = 17;
  101. r_fdamp_img._dx = 23;
  102. r_fdamp_img._dy = 23;
  103. r_fdamp_img._xref = 11.5;
  104. r_fdamp_img._yref = 11.5;
  105. r_fdamp_img._rad = 11;
  106. r_parfr_img._backg = XftColors [C_MAIN_BG];
  107. r_parfr_img._image [0] = eq1sect_img;
  108. r_parfr_img._lncol [0] = 0;
  109. r_parfr_img._x0 = 19;
  110. r_parfr_img._y0 = 32;
  111. r_parfr_img._dx = 23;
  112. r_parfr_img._dy = 23;
  113. r_parfr_img._xref = 11.5;
  114. r_parfr_img._yref = 11.5;
  115. r_parfr_img._rad = 11;
  116. r_pargn_img._backg = XftColors [C_MAIN_BG];
  117. r_pargn_img._image [0] = eq1sect_img;
  118. r_pargn_img._lncol [0] = 1;
  119. r_pargn_img._x0 = 68;
  120. r_pargn_img._y0 = 17;
  121. r_pargn_img._dx = 23;
  122. r_pargn_img._dy = 23;
  123. r_pargn_img._xref = 11.5;
  124. r_pargn_img._yref = 11.5;
  125. r_pargn_img._rad = 11;
  126. r_opmix_img._backg = XftColors [C_MAIN_BG];
  127. r_opmix_img._image [0] = mixsect_img;
  128. r_opmix_img._lncol [0] = 0;
  129. r_opmix_img._x0 = 23;
  130. r_opmix_img._y0 = 32;
  131. r_opmix_img._dx = 23;
  132. r_opmix_img._dy = 23;
  133. r_opmix_img._xref = 11.5;
  134. r_opmix_img._yref = 11.5;
  135. r_opmix_img._rad = 11;
  136. r_rgxyz_img._backg = XftColors [C_MAIN_BG];
  137. r_rgxyz_img._image [0] = ambsect_img;
  138. r_rgxyz_img._lncol [0] = 0;
  139. r_rgxyz_img._x0 = 23;
  140. r_rgxyz_img._y0 = 32;
  141. r_rgxyz_img._dx = 23;
  142. r_rgxyz_img._dy = 23;
  143. r_rgxyz_img._xref = 11.5;
  144. r_rgxyz_img._yref = 11.5;
  145. r_rgxyz_img._rad = 11;
  146. return 0;
  147. }
  148. void styles_fini (X_display *disp)
  149. {
  150. }
  151. }