2 terminatorX - realtime audio scratching software
3 Copyright (C) 1999-2016 Alexander König
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Description: This code loads the knob-images required for tX_dial widget.
24 #include "tX_knobloader.h"
25 #include "tX_global.h"
26 #include <gdk-pixbuf/gdk-pixbuf.h>
27 #include "icons/tX_knob_resources.c"
31 GdkPixbuf *knob_pixmaps[MAX_KNOB_PIX];
33 void load_knob_pixs(int fontHeight, int scaleFactor)
38 g_resource_new_from_data(g_bytes_new_static(tX_knob_resource_data.data, sizeof(tX_knob_resource_data.data)), &error);
40 tX_error("failed accessing tX_dial resources: %s\n", error->message);
43 if (globals.knob_size_override > 0) {
44 tX_knob_size = globals.knob_size_override;
46 tX_knob_size = fontHeight * 3 * scaleFactor;
48 tX_debug("load_knob_pix(): knob size is %i", tX_knob_size);
50 for (i=0; i<MAX_KNOB_PIX; i++) {
51 char resource_path[256];
52 snprintf(resource_path, 256, "/org/terminatorX/tX_dial/knob%i.png", i);
53 knob_pixmaps[i] = gdk_pixbuf_new_from_resource_at_scale(resource_path, tX_knob_size, tX_knob_size, TRUE, &error);
56 tX_error("failed rendering knob image: %s\n", error->message);