Advertisement
Guest User

audio-recorder: GTK 3.16 build fix

a guest
May 11th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 35.46 KB | None | 0 0
  1. diff -rupN audio-recorder/po/POTFILES.in audio-recorder_fix-build/po/POTFILES.in
  2. --- audio-recorder/po/POTFILES.in   2014-09-28 12:15:05.000000000 -0500
  3. +++ audio-recorder_fix-build/po/POTFILES.in 2015-05-11 12:52:41.033394276 -0500
  4. @@ -24,8 +24,8 @@ src/gst-pipeline.c
  5.  src/gst-pipeline.h
  6.  src/gst-recorder.c
  7.  src/gst-recorder.h
  8. -src/gtklevelbar.c
  9. -src/gtklevelbar.h
  10. +src/levelbar.c
  11. +src/levelbar.h
  12.  src/help.c
  13.  src/help.h
  14.  src/log.c
  15. diff -rupN audio-recorder/src/gtklevelbar.c audio-recorder_fix-build/src/gtklevelbar.c
  16. --- audio-recorder/src/gtklevelbar.c    2015-02-06 09:04:35.000000000 -0500
  17. +++ audio-recorder_fix-build/src/gtklevelbar.c  1969-12-31 19:00:00.000000000 -0500
  18. @@ -1,357 +0,0 @@
  19. -/*
  20. - * Copyright (c) Linux community.
  21. - *
  22. - * This library is free software; you can redistribute it and/or
  23. - * modify it under the terms of the GNU Library General Public
  24. - * License as published by the Free Software Foundation; either
  25. - * version 3 of the License (GPL3), or any later version.
  26. - *
  27. - * This library is distributed in the hope that it will be useful,
  28. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  30. - * See the GNU Library General Public License 3 for more details.
  31. - *
  32. - * You should have received a copy of the GNU Library General Public
  33. - * License 3 along with this program; if not, see /usr/share/common-licenses/GPL file
  34. - * or write to Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  35. - * Boston, MA 02111-1307, USA.
  36. -*/
  37. -#include "gtklevelbar.h"
  38. -#include <math.h> // round()
  39. -
  40. -// A simple level bar widget.
  41. -// By Osmo Antero.
  42. -//
  43. -// Sample call:
  44. -// GtkWidget *lb = gtk_level_bar_new();
  45. -// gtk_widget_show(lb);
  46. -//
  47. -// Set value [0.0, 1.0].
  48. -// gtk_level_bar_set_fraction(GTK_LEVEL_BAR(lb), 0.8);
  49. -//
  50. -// Show %-value [0 - 100%] or plain value [0 - 1.0] on the level bar. See BAR_VALUE enum.
  51. -// gtk_level_bar_set_value_type(GTK_LEVEL_BAR(lb), VALUE_PRECENT);
  52. -//
  53. -
  54. -struct _GtkLevelBarPrivate {
  55. -    gdouble fraction;
  56. -    guint bar_height;
  57. -    enum BAR_VALUE bar_value;
  58. -    enum BAR_SHAPE bar_shape;
  59. -};
  60. -
  61. -static void gtk_level_bar_get_preferred_width(GtkWidget *widget, gint *minimum, gint *natural);
  62. -static void gtk_level_bar_get_preferred_height (GtkWidget *widget,gint *minimum, gint *natural);
  63. -
  64. -static void gtk_level_bar_real_update(GtkLevelBar *progress);
  65. -static gboolean gtk_level_bar_draw(GtkWidget *widget, cairo_t *cr);
  66. -
  67. -static void gtk_level_bar_finalize(GObject *object);
  68. -
  69. -G_DEFINE_TYPE(GtkLevelBar, gtk_level_bar, GTK_TYPE_WIDGET);
  70. -
  71. -static void gtk_level_bar_class_init (GtkLevelBarClass *class) {
  72. -    GObjectClass *gobject_class;
  73. -    GtkWidgetClass *widget_class;
  74. -
  75. -    gobject_class = G_OBJECT_CLASS (class);
  76. -    widget_class = (GtkWidgetClass *)class;
  77. -
  78. -    gobject_class->set_property = NULL;
  79. -    gobject_class->get_property = NULL;
  80. -    gobject_class->finalize = gtk_level_bar_finalize;
  81. -
  82. -    widget_class->draw = gtk_level_bar_draw;
  83. -    widget_class->get_preferred_width = gtk_level_bar_get_preferred_width;
  84. -    widget_class->get_preferred_height = gtk_level_bar_get_preferred_height;
  85. -
  86. -    g_type_class_add_private (class, sizeof (GtkLevelBarPrivate));
  87. -}
  88. -
  89. -static void gtk_level_bar_init(GtkLevelBar *pbar) {
  90. -    GtkLevelBarPrivate *priv;
  91. -
  92. -    pbar->priv = G_TYPE_INSTANCE_GET_PRIVATE(pbar, GTK_TYPE_LEVEL_BAR, GtkLevelBarPrivate);
  93. -    priv = pbar->priv;
  94. -
  95. -    priv->fraction = 0.0;
  96. -    priv->bar_height = 8;
  97. -    priv->bar_value = VALUE_NONE;
  98. -    priv->bar_shape = SHAPE_CIRCLE; // pulsing line with circle at end.
  99. -
  100. -    gtk_widget_set_has_window(GTK_WIDGET (pbar), FALSE);
  101. -}
  102. -
  103. -GtkWidget *gtk_level_bar_new(void) {
  104. -    GtkWidget *pbar;
  105. -    pbar = g_object_new(GTK_TYPE_LEVEL_BAR, NULL);
  106. -    return pbar;
  107. -}
  108. -
  109. -static void gtk_level_bar_real_update (GtkLevelBar *pbar) {
  110. -    GtkWidget *widget;
  111. -
  112. -    g_return_if_fail (GTK_IS_LEVEL_BAR (pbar));
  113. -
  114. -    GtkLevelBarPrivate __attribute__ ((unused)) *priv = pbar->priv;
  115. -
  116. -    widget = GTK_WIDGET(pbar);
  117. -
  118. -    gtk_widget_queue_draw(widget);
  119. -}
  120. -
  121. -static void gtk_level_bar_finalize (GObject *object) {
  122. -    G_OBJECT_CLASS(gtk_level_bar_parent_class)->finalize (object);
  123. -}
  124. -
  125. -static void gtk_level_bar_get_preferred_width (GtkWidget *widget,gint *minimum, gint *natural) {
  126. -    *minimum = 50;
  127. -    *natural = 160;
  128. -}
  129. -
  130. -static void gtk_level_bar_get_preferred_height (GtkWidget *widget, gint      *minimum, gint      *natural) {
  131. -    *minimum = 6;
  132. -    *natural = 8;
  133. -}
  134. -
  135. -static gboolean gtk_level_bar_draw(GtkWidget *widget, cairo_t *cr) {
  136. -    // Draw level bar and optional text
  137. -    GtkLevelBar *pbar = GTK_LEVEL_BAR (widget);
  138. -    GtkLevelBarPrivate *priv = pbar->priv;
  139. -    GtkStyleContext *context;
  140. -    int width, height;
  141. -
  142. -    context = gtk_widget_get_style_context(widget);
  143. -
  144. -    width = gtk_widget_get_allocated_width(widget);
  145. -    height = gtk_widget_get_allocated_height(widget);
  146. -
  147. -    // Bar thickness
  148. -    gdouble bar_height = MIN(height , priv->bar_height);
  149. -
  150. -    // Vertical pos
  151. -    gdouble y = (height - bar_height)/2;
  152. -
  153. -    // Pulse width
  154. -    gdouble w = priv->fraction/(1.00/width);
  155. -
  156. -    // Debug:
  157. -    // LOG_DEBUG("width=%d height=%d bar_height=%2.1f y=%2.1f w=%2.1f  fraction=%2.1f\n", width, height, bar_height, y, w, priv->fraction);
  158. -
  159. -    gtk_style_context_save(context);
  160. -    gtk_render_background(context, cr, 0, 0, width, height);
  161. -    gtk_render_frame(context, cr, 0, 0, width, height);
  162. -
  163. -    // Render level bar with current theme and color.
  164. -
  165. -    // Progressbar style
  166. -    gtk_style_context_add_class(context, GTK_STYLE_CLASS_PROGRESSBAR);
  167. -
  168. -    if (priv->fraction > 0.001) {
  169. -
  170. -        switch (priv->bar_shape) {
  171. -
  172. -        case SHAPE_LINE:
  173. -            // Render a single line
  174. -            if (priv->bar_value == VALUE_NONE) {
  175. -                // No value (text) shown. Draw a line on the middle.
  176. -                gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
  177. -
  178. -            } else {
  179. -                // Draw a line under text.
  180. -                gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
  181. -            }
  182. -
  183. -            break;
  184. -
  185. -        case SHAPE_LINE2:
  186. -            // Render two horizontal lines + close the end.
  187. -            gtk_render_line(context, cr, 0, y-1 , w, y-1);
  188. -            gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
  189. -            gtk_render_line(context, cr, w, y - 1, w, y + (bar_height ));
  190. -            break;
  191. -
  192. -        case SHAPE_CIRCLE:
  193. -            // Draw a line on the middle + circle at the end.
  194. -            gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
  195. -            gtk_render_option(context, cr, w, y, bar_height+1, bar_height+1);
  196. -            break;
  197. -
  198. -        default:
  199. -            // case SHAPE_LEVELBAR:
  200. -
  201. -            // EDIT: gtk_render_activity() does not work in GTK 3.14+
  202. -            // gtk_style_context_set_state(context, GTK_STATE_FLAG_ACTIVE);
  203. -            // gtk_render_activity(context, cr, 0, y, w, bar_height);
  204. -
  205. -            // Render a filled frame (this is a typical levelbar).
  206. -            gtk_render_frame(context, cr, 0, y, w, bar_height);
  207. -            break;
  208. -
  209. -        }
  210. -    }
  211. -
  212. -    gtk_style_context_restore(context);
  213. -
  214. -    cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  215. -    cairo_set_font_size(cr, priv->bar_height);
  216. -
  217. -    GdkRGBA color;
  218. -    gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
  219. -    gdk_cairo_set_source_rgba(cr, &color);
  220. -    color.alpha = 0.9;
  221. -
  222. -    // Calculate total width of scale
  223. -    cairo_text_extents_t extents;
  224. -    cairo_text_extents(cr, "0.0", &extents);
  225. -    gint total_w = 9 * (extents.x_advance + extents.width);
  226. -
  227. -    // Debug:
  228. -    // g_print("Bar width=%d  total_w=%d  bearing=%3.1f advance=%3.1f char.width=%3.1f\n", width, total_w,
  229. -    //          extents.x_bearing, extents.x_advance, extents.width);
  230. -
  231. -    // Draw values
  232. -    gboolean draw_all = (total_w - extents.width) < width;
  233. -
  234. -    // Show normalized value [0 - 1.0]?
  235. -    if (priv->bar_value == VALUE_0_1) {
  236. -        // Value: 0.1  0.2  0.3  0.4...0.9
  237. -
  238. -        gint i = 0;
  239. -        for (i=0; i < 10; i++) {
  240. -            gchar *s = NULL;
  241. -
  242. -            // Draw all or draw only each second value?
  243. -            if (draw_all || (i % 2 == 0))
  244. -                s = g_strdup_printf("%2.1f", (gdouble)i/10.0);
  245. -
  246. -            if (!s) continue;
  247. -
  248. -            cairo_text_extents_t extents;
  249. -            cairo_text_extents(cr, s, &extents);
  250. -
  251. -            gdouble xx = (width/10) * i;
  252. -            gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing) + 0.2;
  253. -
  254. -            cairo_move_to(cr, xx, yy);
  255. -            cairo_show_text(cr, s);
  256. -
  257. -            g_free(s);
  258. -        }
  259. -
  260. -        // Show percentage value?
  261. -    } else if (priv->bar_value == VALUE_PERCENT) {
  262. -        // Value: 10% . 20% . 30% . 40% . 50% ... 90%
  263. -        gint i = 0;
  264. -        for (i=0; i < 10; i++) {
  265. -            gchar *s = NULL;
  266. -            if (i % 2 == 0)
  267. -                s = g_strdup_printf("%2.0f%%", (gdouble)i*10.0);
  268. -            else
  269. -                s = g_strdup_printf("%3s", ".");
  270. -
  271. -            cairo_text_extents_t extents;
  272. -            cairo_text_extents(cr, s, &extents);
  273. -
  274. -            gdouble xx = (width/10) * i;
  275. -            gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing);
  276. -
  277. -            cairo_move_to(cr, xx, yy);
  278. -            cairo_show_text(cr, s);
  279. -
  280. -            g_free(s);
  281. -        }
  282. -    }
  283. -
  284. -#if 0
  285. -    // Commented out by moma 30.sep.2012.
  286. -
  287. -    // Set text
  288. -    if (priv->text) {
  289. -        cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  290. -
  291. -        cairo_set_font_size(cr, 0.5*height);
  292. -        cairo_text_extents_t extents;
  293. -        cairo_text_extents(cr, priv->text, &extents);
  294. -
  295. -        // Ref: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-text-extents-t
  296. -        gdouble xx = width-(extents.width + extents.x_bearing)-2;
  297. -        gdouble yy = height/2-(extents.height/2 + extents.y_bearing);
  298. -
  299. -        GdkRGBA color;
  300. -        gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
  301. -        gdk_cairo_set_source_rgba(cr, &color);
  302. -        color.alpha = 0.9;
  303. -
  304. -        cairo_move_to(cr, xx, yy);
  305. -        cairo_show_text(cr, priv->text);
  306. -    }
  307. -#endif
  308. -
  309. -    return FALSE;
  310. -}
  311. -
  312. -void gtk_level_bar_set_fraction(GtkLevelBar *pbar, gdouble fraction) {
  313. -    // Set fraction [0.0, 1.0]
  314. -    GtkLevelBarPrivate* priv;
  315. -    g_return_if_fail (GTK_IS_LEVEL_BAR (pbar));
  316. -    priv = pbar->priv;
  317. -
  318. -    priv->fraction = CLAMP(fraction, 0.0, 1.0);
  319. -    gtk_level_bar_real_update (pbar);
  320. -}
  321. -
  322. -gdouble gtk_level_bar_get_fraction(GtkLevelBar *pbar) {
  323. -    // Get fraction
  324. -    g_return_val_if_fail(GTK_IS_LEVEL_BAR (pbar), 0);
  325. -    return pbar->priv->fraction;
  326. -}
  327. -
  328. -void gtk_level_bar_set_bar_height(GtkLevelBar *pbar, guint height) {
  329. -    // Set bar height (thickness). Normally 8 pixels.
  330. -    g_return_if_fail(GTK_IS_LEVEL_BAR (pbar));
  331. -    GtkLevelBarPrivate* priv = pbar->priv;
  332. -    priv->bar_height = height;
  333. -    // Redraw
  334. -    gtk_level_bar_real_update(pbar);
  335. -}
  336. -
  337. -guint gtk_level_bar_get_bar_height(GtkLevelBar *pbar) {
  338. -    // Get bar thickness
  339. -    g_return_val_if_fail(GTK_IS_LEVEL_BAR(pbar), 0);
  340. -    return pbar->priv->bar_height;
  341. -}
  342. -
  343. -void gtk_level_bar_set_value_type(GtkLevelBar *pbar, enum BAR_VALUE bar_value) {
  344. -    // Set BAR_VALUE
  345. -    g_return_if_fail(GTK_IS_LEVEL_BAR(pbar));
  346. -    GtkLevelBarPrivate* priv = pbar->priv;
  347. -    priv->bar_value = bar_value;
  348. -    // Redraw
  349. -    gtk_level_bar_real_update(pbar);
  350. -}
  351. -
  352. -enum BAR_VALUE gtk_level_bar_get_scale(GtkLevelBar *pbar) {
  353. -    // Get BAR_VALUE
  354. -    g_return_val_if_fail(GTK_IS_LEVEL_BAR(pbar), VALUE_NONE);
  355. -    GtkLevelBarPrivate* priv = pbar->priv;
  356. -    return priv->bar_value;
  357. -}
  358. -
  359. -void gtk_level_bar_set_shape(GtkLevelBar *pbar, enum BAR_SHAPE bar_shape) {
  360. -    // Set BAR_SHAPE
  361. -    g_return_if_fail(GTK_IS_LEVEL_BAR(pbar));
  362. -    GtkLevelBarPrivate* priv = pbar->priv;
  363. -    priv->bar_shape = bar_shape;
  364. -    // Redraw
  365. -    gtk_level_bar_real_update(pbar);
  366. -}
  367. -
  368. -enum BAR_SHAPE gtk_level_bar_get_shape(GtkLevelBar *pbar) {
  369. -    // Get BAR_SHAPE
  370. -    g_return_val_if_fail(GTK_IS_LEVEL_BAR(pbar), SHAPE_LEVELBAR);
  371. -    GtkLevelBarPrivate* priv = pbar->priv;
  372. -    return priv->bar_shape;
  373. -}
  374. -
  375. -
  376. diff -rupN audio-recorder/src/gtklevelbar.h audio-recorder_fix-build/src/gtklevelbar.h
  377. --- audio-recorder/src/gtklevelbar.h    2015-02-06 09:04:35.000000000 -0500
  378. +++ audio-recorder_fix-build/src/gtklevelbar.h  1969-12-31 19:00:00.000000000 -0500
  379. @@ -1,60 +0,0 @@
  380. -#ifndef __GTK_LEVEL_BAR_H__
  381. -#define __GTK_LEVEL_BAR_H__
  382. -
  383. -// A simple level bar widget.
  384. -
  385. -#include <gtk/gtk.h>
  386. -
  387. -typedef enum BAR_VALUE {VALUE_NONE, VALUE_0_1/*0 - 1.0*/, VALUE_PERCENT/*0 - 100%*/} BAR_VALUE;
  388. -typedef enum BAR_SHAPE {SHAPE_LEVELBAR, SHAPE_LINE, SHAPE_LINE2, SHAPE_CIRCLE} BAR_SHAPE;
  389. -
  390. -G_BEGIN_DECLS
  391. -
  392. -#define GTK_TYPE_LEVEL_BAR            (gtk_level_bar_get_type ())
  393. -#define GTK_LEVEL_BAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LEVEL_BAR, GtkLevelBar))
  394. -#define GTK_LEVEL_BAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LEVEL_BAR, GtkLevelBarClass))
  395. -#define GTK_IS_LEVEL_BAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LEVEL_BAR))
  396. -#define GTK_IS_LEVEL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LEVEL_BAR))
  397. -#define GTK_LEVEL_BAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LEVEL_BAR, GtkLevelBarClass))
  398. -
  399. -typedef struct _GtkLevelBar              GtkLevelBar;
  400. -typedef struct _GtkLevelBarPrivate       GtkLevelBarPrivate;
  401. -typedef struct _GtkLevelBarClass         GtkLevelBarClass;
  402. -
  403. -struct _GtkLevelBar {
  404. -    GtkWidget parent;
  405. -
  406. -    /*< private >*/
  407. -    GtkLevelBarPrivate *priv;
  408. -};
  409. -
  410. -struct _GtkLevelBarClass {
  411. -    GtkWidgetClass parent_class;
  412. -
  413. -    /* Padding for future expansion */
  414. -    void (*_gtk_reserved1) (void);
  415. -    void (*_gtk_reserved2) (void);
  416. -    void (*_gtk_reserved3) (void);
  417. -    void (*_gtk_reserved4) (void);
  418. -};
  419. -
  420. -GType gtk_level_bar_get_type(void) G_GNUC_CONST;
  421. -GtkWidget* gtk_level_bar_new(void);
  422. -
  423. -void gtk_level_bar_set_bar_height(GtkLevelBar *pbar, guint height);
  424. -void gtk_level_bar_set_fraction(GtkLevelBar *pbar, gdouble fraction);
  425. -
  426. -guint gtk_level_bar_get_bar_height(GtkLevelBar *pbar);
  427. -gdouble gtk_level_bar_get_fraction(GtkLevelBar *pbar);
  428. -
  429. -void gtk_level_bar_set_value_type(GtkLevelBar *pbar, enum BAR_VALUE bar_value);
  430. -enum BAR_VALUE gtk_level_bar_get_value_type(GtkLevelBar *pbar);
  431. -
  432. -void gtk_level_bar_set_shape(GtkLevelBar *pbar, enum BAR_SHAPE bar_shape);
  433. -enum BAR_SHAPE gtk_level_bar_get_shape(GtkLevelBar *pbar);
  434. -
  435. -G_END_DECLS
  436. -
  437. -#endif
  438. -
  439. -
  440. diff -rupN audio-recorder/src/levelbar.c audio-recorder_fix-build/src/levelbar.c
  441. --- audio-recorder/src/levelbar.c   1969-12-31 19:00:00.000000000 -0500
  442. +++ audio-recorder_fix-build/src/levelbar.c 2015-02-06 09:04:35.000000000 -0500
  443. @@ -0,0 +1,357 @@
  444. +/*
  445. + * Copyright (c) Linux community.
  446. + *
  447. + * This library is free software; you can redistribute it and/or
  448. + * modify it under the terms of the GNU Library General Public
  449. + * License as published by the Free Software Foundation; either
  450. + * version 3 of the License (GPL3), or any later version.
  451. + *
  452. + * This library is distributed in the hope that it will be useful,
  453. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  454. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  455. + * See the GNU Library General Public License 3 for more details.
  456. + *
  457. + * You should have received a copy of the GNU Library General Public
  458. + * License 3 along with this program; if not, see /usr/share/common-licenses/GPL file
  459. + * or write to Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  460. + * Boston, MA 02111-1307, USA.
  461. +*/
  462. +#include "levelbar.h"
  463. +#include <math.h> // round()
  464. +
  465. +// A simple level bar widget.
  466. +// By Osmo Antero.
  467. +//
  468. +// Sample call:
  469. +// GtkWidget *lb = level_bar_new();
  470. +// gtk_widget_show(lb);
  471. +//
  472. +// Set value [0.0, 1.0].
  473. +// level_bar_set_fraction(LEVEL_BAR(lb), 0.8);
  474. +//
  475. +// Show %-value [0 - 100%] or plain value [0 - 1.0] on the level bar. See BAR_VALUE enum.
  476. +// level_bar_set_value_type(LEVEL_BAR(lb), VALUE_PRECENT);
  477. +//
  478. +
  479. +struct _LevelBarPrivate {
  480. +    gdouble fraction;
  481. +    guint bar_height;
  482. +    enum BAR_VALUE bar_value;
  483. +    enum BAR_SHAPE bar_shape;
  484. +};
  485. +
  486. +static void level_bar_get_preferred_width(GtkWidget *widget, gint *minimum, gint *natural);
  487. +static void level_bar_get_preferred_height (GtkWidget *widget,gint *minimum, gint *natural);
  488. +
  489. +static void level_bar_real_update(LevelBar *progress);
  490. +static gboolean level_bar_draw(GtkWidget *widget, cairo_t *cr);
  491. +
  492. +static void level_bar_finalize(GObject *object);
  493. +
  494. +G_DEFINE_TYPE(LevelBar, level_bar, GTK_TYPE_WIDGET);
  495. +
  496. +static void level_bar_class_init(LevelBarClass *class) {
  497. +    GObjectClass *gobject_class;
  498. +    GtkWidgetClass *widget_class;
  499. +
  500. +    gobject_class = G_OBJECT_CLASS (class);
  501. +    widget_class = (GtkWidgetClass *)class;
  502. +
  503. +    gobject_class->set_property = NULL;
  504. +    gobject_class->get_property = NULL;
  505. +    gobject_class->finalize = level_bar_finalize;
  506. +
  507. +    widget_class->draw = level_bar_draw;
  508. +    widget_class->get_preferred_width = level_bar_get_preferred_width;
  509. +    widget_class->get_preferred_height = level_bar_get_preferred_height;
  510. +
  511. +    g_type_class_add_private(class, sizeof (LevelBarPrivate));
  512. +}
  513. +
  514. +static void level_bar_init(LevelBar *pbar) {
  515. +    LevelBarPrivate *priv;
  516. +
  517. +    pbar->priv = G_TYPE_INSTANCE_GET_PRIVATE(pbar, TYPE_LEVEL_BAR, LevelBarPrivate);
  518. +    priv = pbar->priv;
  519. +
  520. +    priv->fraction = 0.0;
  521. +    priv->bar_height = 8;
  522. +    priv->bar_value = VALUE_NONE;
  523. +    priv->bar_shape = SHAPE_CIRCLE; // pulsing line with circle at end.
  524. +
  525. +    gtk_widget_set_has_window(GTK_WIDGET (pbar), FALSE);
  526. +}
  527. +
  528. +GtkWidget *level_bar_new(void) {
  529. +    GtkWidget *pbar;
  530. +    pbar = g_object_new(TYPE_LEVEL_BAR, NULL);
  531. +    return pbar;
  532. +}
  533. +
  534. +static void level_bar_real_update (LevelBar *pbar) {
  535. +    GtkWidget *widget;
  536. +
  537. +    g_return_if_fail (IS_LEVEL_BAR (pbar));
  538. +
  539. +    LevelBarPrivate __attribute__ ((unused)) *priv = pbar->priv;
  540. +
  541. +    widget = GTK_WIDGET(pbar);
  542. +
  543. +    gtk_widget_queue_draw(widget);
  544. +}
  545. +
  546. +static void level_bar_finalize (GObject *object) {
  547. +    G_OBJECT_CLASS(level_bar_parent_class)->finalize (object);
  548. +}
  549. +
  550. +static void level_bar_get_preferred_width (GtkWidget *widget,gint *minimum, gint *natural) {
  551. +    *minimum = 50;
  552. +    *natural = 160;
  553. +}
  554. +
  555. +static void level_bar_get_preferred_height (GtkWidget *widget, gint      *minimum, gint      *natural) {
  556. +    *minimum = 6;
  557. +    *natural = 8;
  558. +}
  559. +
  560. +static gboolean level_bar_draw(GtkWidget *widget, cairo_t *cr) {
  561. +    // Draw level bar and optional text
  562. +    LevelBar *pbar = LEVEL_BAR (widget);
  563. +    LevelBarPrivate *priv = pbar->priv;
  564. +    GtkStyleContext *context;
  565. +    int width, height;
  566. +
  567. +    context = gtk_widget_get_style_context(widget);
  568. +
  569. +    width = gtk_widget_get_allocated_width(widget);
  570. +    height = gtk_widget_get_allocated_height(widget);
  571. +
  572. +    // Bar thickness
  573. +    gdouble bar_height = MIN(height , priv->bar_height);
  574. +
  575. +    // Vertical pos
  576. +    gdouble y = (height - bar_height)/2;
  577. +
  578. +    // Pulse width
  579. +    gdouble w = priv->fraction/(1.00/width);
  580. +
  581. +    // Debug:
  582. +    // LOG_DEBUG("width=%d height=%d bar_height=%2.1f y=%2.1f w=%2.1f  fraction=%2.1f\n", width, height, bar_height, y, w, priv->fraction);
  583. +
  584. +    gtk_style_context_save(context);
  585. +    gtk_render_background(context, cr, 0, 0, width, height);
  586. +    gtk_render_frame(context, cr, 0, 0, width, height);
  587. +
  588. +    // Render level bar with current theme and color.
  589. +
  590. +    // Progressbar style
  591. +    gtk_style_context_add_class(context, GTK_STYLE_CLASS_PROGRESSBAR);
  592. +
  593. +    if (priv->fraction > 0.001) {
  594. +
  595. +        switch (priv->bar_shape) {
  596. +
  597. +        case SHAPE_LINE:
  598. +            // Render a single line
  599. +            if (priv->bar_value == VALUE_NONE) {
  600. +                // No value (text) shown. Draw a line on the middle.
  601. +                gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
  602. +
  603. +            } else {
  604. +                // Draw a line under text.
  605. +                gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
  606. +            }
  607. +
  608. +            break;
  609. +
  610. +        case SHAPE_LINE2:
  611. +            // Render two horizontal lines + close the end.
  612. +            gtk_render_line(context, cr, 0, y-1 , w, y-1);
  613. +            gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
  614. +            gtk_render_line(context, cr, w, y - 1, w, y + (bar_height ));
  615. +            break;
  616. +
  617. +        case SHAPE_CIRCLE:
  618. +            // Draw a line on the middle + circle at the end.
  619. +            gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
  620. +            gtk_render_option(context, cr, w, y, bar_height+1, bar_height+1);
  621. +            break;
  622. +
  623. +        default:
  624. +            // case SHAPE_LEVELBAR:
  625. +
  626. +            // EDIT: gtk_render_activity() does not work in GTK 3.14+
  627. +            // gtk_style_context_set_state(context, GTK_STATE_FLAG_ACTIVE);
  628. +            // gtk_render_activity(context, cr, 0, y, w, bar_height);
  629. +
  630. +            // Render a filled frame (this is a typical levelbar).
  631. +            gtk_render_frame(context, cr, 0, y, w, bar_height);
  632. +            break;
  633. +
  634. +        }
  635. +    }
  636. +
  637. +    gtk_style_context_restore(context);
  638. +
  639. +    cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  640. +    cairo_set_font_size(cr, priv->bar_height);
  641. +
  642. +    GdkRGBA color;
  643. +    gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
  644. +    gdk_cairo_set_source_rgba(cr, &color);
  645. +    color.alpha = 0.9;
  646. +
  647. +    // Calculate total width of scale
  648. +    cairo_text_extents_t extents;
  649. +    cairo_text_extents(cr, "0.0", &extents);
  650. +    gint total_w = 9 * (extents.x_advance + extents.width);
  651. +
  652. +    // Debug:
  653. +    // g_print("Bar width=%d  total_w=%d  bearing=%3.1f advance=%3.1f char.width=%3.1f\n", width, total_w,
  654. +    //          extents.x_bearing, extents.x_advance, extents.width);
  655. +
  656. +    // Draw values
  657. +    gboolean draw_all = (total_w - extents.width) < width;
  658. +
  659. +    // Show normalized value [0 - 1.0]?
  660. +    if (priv->bar_value == VALUE_0_1) {
  661. +        // Value: 0.1  0.2  0.3  0.4...0.9
  662. +
  663. +        gint i = 0;
  664. +        for (i=0; i < 10; i++) {
  665. +            gchar *s = NULL;
  666. +
  667. +            // Draw all or draw only each second value?
  668. +            if (draw_all || (i % 2 == 0))
  669. +                s = g_strdup_printf("%2.1f", (gdouble)i/10.0);
  670. +
  671. +            if (!s) continue;
  672. +
  673. +            cairo_text_extents_t extents;
  674. +            cairo_text_extents(cr, s, &extents);
  675. +
  676. +            gdouble xx = (width/10) * i;
  677. +            gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing) + 0.2;
  678. +
  679. +            cairo_move_to(cr, xx, yy);
  680. +            cairo_show_text(cr, s);
  681. +
  682. +            g_free(s);
  683. +        }
  684. +
  685. +        // Show percentage value?
  686. +    } else if (priv->bar_value == VALUE_PERCENT) {
  687. +        // Value: 10% . 20% . 30% . 40% . 50% ... 90%
  688. +        gint i = 0;
  689. +        for (i=0; i < 10; i++) {
  690. +            gchar *s = NULL;
  691. +            if (i % 2 == 0)
  692. +                s = g_strdup_printf("%2.0f%%", (gdouble)i*10.0);
  693. +            else
  694. +                s = g_strdup_printf("%3s", ".");
  695. +
  696. +            cairo_text_extents_t extents;
  697. +            cairo_text_extents(cr, s, &extents);
  698. +
  699. +            gdouble xx = (width/10) * i;
  700. +            gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing);
  701. +
  702. +            cairo_move_to(cr, xx, yy);
  703. +            cairo_show_text(cr, s);
  704. +
  705. +            g_free(s);
  706. +        }
  707. +    }
  708. +
  709. +#if 0
  710. +    // Commented out by moma 30.sep.2012.
  711. +
  712. +    // Set text
  713. +    if (priv->text) {
  714. +        cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  715. +
  716. +        cairo_set_font_size(cr, 0.5*height);
  717. +        cairo_text_extents_t extents;
  718. +        cairo_text_extents(cr, priv->text, &extents);
  719. +
  720. +        // Ref: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-text-extents-t
  721. +        gdouble xx = width-(extents.width + extents.x_bearing)-2;
  722. +        gdouble yy = height/2-(extents.height/2 + extents.y_bearing);
  723. +
  724. +        GdkRGBA color;
  725. +        gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
  726. +        gdk_cairo_set_source_rgba(cr, &color);
  727. +        color.alpha = 0.9;
  728. +
  729. +        cairo_move_to(cr, xx, yy);
  730. +        cairo_show_text(cr, priv->text);
  731. +    }
  732. +#endif
  733. +
  734. +    return FALSE;
  735. +}
  736. +
  737. +void level_bar_set_fraction(LevelBar *pbar, gdouble fraction) {
  738. +    // Set fraction [0.0, 1.0]
  739. +    LevelBarPrivate* priv;
  740. +    g_return_if_fail (IS_LEVEL_BAR (pbar));
  741. +    priv = pbar->priv;
  742. +
  743. +    priv->fraction = CLAMP(fraction, 0.0, 1.0);
  744. +    level_bar_real_update (pbar);
  745. +}
  746. +
  747. +gdouble level_bar_get_fraction(LevelBar *pbar) {
  748. +    // Get fraction
  749. +    g_return_val_if_fail(IS_LEVEL_BAR (pbar), 0);
  750. +    return pbar->priv->fraction;
  751. +}
  752. +
  753. +void level_bar_set_bar_height(LevelBar *pbar, guint height) {
  754. +    // Set bar height (thickness). Normally 8 pixels.
  755. +    g_return_if_fail(IS_LEVEL_BAR (pbar));
  756. +    LevelBarPrivate* priv = pbar->priv;
  757. +    priv->bar_height = height;
  758. +    // Redraw
  759. +    level_bar_real_update(pbar);
  760. +}
  761. +
  762. +guint level_bar_get_bar_height(LevelBar *pbar) {
  763. +    // Get bar thickness
  764. +    g_return_val_if_fail(IS_LEVEL_BAR(pbar), 0);
  765. +    return pbar->priv->bar_height;
  766. +}
  767. +
  768. +void level_bar_set_value_type(LevelBar *pbar, enum BAR_VALUE bar_value) {
  769. +    // Set BAR_VALUE
  770. +    g_return_if_fail(IS_LEVEL_BAR(pbar));
  771. +    LevelBarPrivate* priv = pbar->priv;
  772. +    priv->bar_value = bar_value;
  773. +    // Redraw
  774. +    level_bar_real_update(pbar);
  775. +}
  776. +
  777. +enum BAR_VALUE level_bar_get_scale(LevelBar *pbar) {
  778. +    // Get BAR_VALUE
  779. +    g_return_val_if_fail(IS_LEVEL_BAR(pbar), VALUE_NONE);
  780. +    LevelBarPrivate* priv = pbar->priv;
  781. +    return priv->bar_value;
  782. +}
  783. +
  784. +void level_bar_set_shape(LevelBar *pbar, enum BAR_SHAPE bar_shape) {
  785. +    // Set BAR_SHAPE
  786. +    g_return_if_fail(IS_LEVEL_BAR(pbar));
  787. +    LevelBarPrivate* priv = pbar->priv;
  788. +    priv->bar_shape = bar_shape;
  789. +    // Redraw
  790. +    level_bar_real_update(pbar);
  791. +}
  792. +
  793. +enum BAR_SHAPE level_bar_get_shape(LevelBar *pbar) {
  794. +    // Get BAR_SHAPE
  795. +    g_return_val_if_fail(IS_LEVEL_BAR(pbar), SHAPE_LEVELBAR);
  796. +    LevelBarPrivate* priv = pbar->priv;
  797. +    return priv->bar_shape;
  798. +}
  799. +
  800. +
  801.  
  802. diff -rupN audio-recorder/src/levelbar.h audio-recorder_fix-build/src/levelbar.h
  803. --- audio-recorder/src/levelbar.h   1969-12-31 19:00:00.000000000 -0500
  804. +++ audio-recorder_fix-build/src/levelbar.h 2015-02-06 09:04:35.000000000 -0500
  805. @@ -0,0 +1,60 @@
  806. +#ifndef __LEVEL_BAR_H__
  807. +#define __LEVEL_BAR_H__
  808. +
  809. +// A simple level bar widget.
  810. +
  811. +#include <gtk/gtk.h>
  812. +
  813. +typedef enum BAR_VALUE {VALUE_NONE, VALUE_0_1/*0 - 1.0*/, VALUE_PERCENT/*0 - 100%*/} BAR_VALUE;
  814. +typedef enum BAR_SHAPE {SHAPE_LEVELBAR, SHAPE_LINE, SHAPE_LINE2, SHAPE_CIRCLE} BAR_SHAPE;
  815. +
  816. +G_BEGIN_DECLS
  817. +
  818. +#define TYPE_LEVEL_BAR            (level_bar_get_type ())
  819. +#define LEVEL_BAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LEVEL_BAR, LevelBar))
  820. +#define LEVEL_BAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LEVEL_BAR, LevelBarClass))
  821. +#define IS_LEVEL_BAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LEVEL_BAR))
  822. +#define IS_LEVEL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LEVEL_BAR))
  823. +#define LEVEL_BAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LEVEL_BAR, LevelBarClass))
  824. +
  825. +typedef struct _LevelBar              LevelBar;
  826. +typedef struct _LevelBarPrivate       LevelBarPrivate;
  827. +typedef struct _LevelBarClass         LevelBarClass;
  828. +
  829. +struct _LevelBar {
  830. +    GtkWidget parent;
  831. +
  832. +    /*< private >*/
  833. +    LevelBarPrivate *priv;
  834. +};
  835. +
  836. +struct _LevelBarClass {
  837. +    GtkWidgetClass parent_class;
  838. +
  839. +    /* Padding for future expansion */
  840. +    void (*_gtk_reserved1) (void);
  841. +    void (*_gtk_reserved2) (void);
  842. +    void (*_gtk_reserved3) (void);
  843. +    void (*_gtk_reserved4) (void);
  844. +};
  845. +
  846. +GType level_bar_get_type(void) G_GNUC_CONST;
  847. +GtkWidget* level_bar_new(void);
  848. +
  849. +void level_bar_set_bar_height(LevelBar *pbar, guint height);
  850. +void level_bar_set_fraction(LevelBar *pbar, gdouble fraction);
  851. +
  852. +guint level_bar_get_bar_height(LevelBar *pbar);
  853. +gdouble level_bar_get_fraction(LevelBar *pbar);
  854. +
  855. +void level_bar_set_value_type(LevelBar *pbar, enum BAR_VALUE bar_value);
  856. +enum BAR_VALUE level_bar_get_value_type(LevelBar *pbar);
  857. +
  858. +void level_bar_set_shape(LevelBar *pbar, enum BAR_SHAPE bar_shape);
  859. +enum BAR_SHAPE level_bar_get_shape(LevelBar *pbar);
  860. +
  861. +G_END_DECLS
  862. +
  863. +#endif
  864. +
  865. +
  866. diff -rupN audio-recorder/src/main.c audio-recorder_fix-build/src/main.c
  867. --- audio-recorder/src/main.c   2015-02-11 08:44:06.000000000 -0500
  868. +++ audio-recorder_fix-build/src/main.c 2015-05-11 12:59:26.655639149 -0500
  869. @@ -25,7 +25,7 @@
  870.  
  871.  #include <gst/pbutils/pbutils.h>
  872.  
  873. -#include "gtklevelbar.h" // Level bar widget
  874. +#include "levelbar.h" // Level bar widget
  875.  #include "support.h"
  876.  #include "audio-sources.h"
  877.  #include "rec-window.h"
  878. @@ -274,13 +274,13 @@ void win_set_filename(gchar *filename) {
  879.  }
  880.  
  881.  void win_update_level_bar(gdouble norm_rms, gdouble norm_peak) {
  882. -    // Set pulse on gtklevelbar
  883. +    // Set pulse on levelbar
  884.  
  885. -    if (!GTK_IS_LEVEL_BAR(g_win.level_bar)) return;
  886. +    if (!IS_LEVEL_BAR(g_win.level_bar)) return;
  887.  
  888.      // Show either RMS or peak-value on the levelbar.
  889.      // Notice: This value has no GUI-setting. User must change it in the dconf-editor.
  890. -    gtk_level_bar_set_fraction(GTK_LEVEL_BAR(g_win.level_bar),
  891. +    level_bar_set_fraction(LEVEL_BAR(g_win.level_bar),
  892.                                 (g_win.pulse_type == PULSE_RMS ? norm_rms : norm_peak));
  893.  }
  894.  
  895. @@ -810,7 +810,7 @@ void win_show_settings_dialog() {
  896.  
  897.  void win_level_bar_clicked(GtkWidget *widget, GdkEvent *event, gpointer data) {
  898.      // User clicked on the level bar.
  899. -    // Set BAR_VALUE or BAR_SHAPE. See gtklevelbar.h.value
  900. +    // Set BAR_VALUE or BAR_SHAPE. See levelbar.h.value
  901.      GdkEventButton *ev = (GdkEventButton*)event;
  902.  
  903.      if (ev->button == 1) {
  904. @@ -827,7 +827,7 @@ void win_level_bar_clicked(GtkWidget *wi
  905.          }
  906.  
  907.          // Update GUI
  908. -        gtk_level_bar_set_value_type(GTK_LEVEL_BAR(g_win.level_bar), bar_value);
  909. +        level_bar_set_value_type(LEVEL_BAR(g_win.level_bar), bar_value);
  910.  
  911.          // Save in DConf
  912.          conf_save_int_value("level-bar-value", bar_value);
  913. @@ -846,7 +846,7 @@ void win_level_bar_clicked(GtkWidget *wi
  914.          }
  915.  
  916.          // Update GUI
  917. -        gtk_level_bar_set_shape(GTK_LEVEL_BAR(g_win.level_bar), bar_shape);
  918. +        level_bar_set_shape(LEVEL_BAR(g_win.level_bar), bar_shape);
  919.  
  920.          // Save in DConf
  921.          conf_save_int_value("level-bar-shape", bar_shape);
  922. @@ -992,24 +992,24 @@ void win_create_window() {
  923.      gtk_widget_set_events(event_box, GDK_BUTTON_PRESS_MASK);
  924.      g_signal_connect(event_box, "button_press_event", G_CALLBACK(win_level_bar_clicked), NULL);
  925.  
  926. -    // Create GtkLevelBar widget and put it in the GtkEventBox
  927. -    g_win.level_bar = gtk_level_bar_new();
  928. +    // Create LevelBar widget and put it in the GtkEventBox
  929. +    g_win.level_bar = level_bar_new();
  930.      gtk_widget_show(g_win.level_bar);
  931.      gtk_container_add(GTK_CONTAINER(event_box), g_win.level_bar);
  932. -    gtk_level_bar_set_fraction(GTK_LEVEL_BAR(g_win.level_bar), 0.0);
  933. +    level_bar_set_fraction(GTK_LEVEL_BAR(g_win.level_bar), 0.0);
  934.  
  935.      // How to draw the level bar?
  936.      // Get from DConf
  937.      gint bar_shape = SHAPE_CIRCLE;
  938.      conf_get_int_value("level-bar-shape", &bar_shape);
  939. -    gtk_level_bar_set_shape(GTK_LEVEL_BAR(g_win.level_bar), bar_shape);
  940. +    level_bar_set_shape(LEVEL_BAR(g_win.level_bar), bar_shape);
  941.      // Notice: User can change this by RIGHT-clicking on the level-bar
  942.  
  943.      // Type of value on the level bar?
  944.      // Get from DConf
  945.      gint bar_value = VALUE_NONE;
  946.      conf_get_int_value("level-bar-value", &bar_value);
  947. -    gtk_level_bar_set_value_type(GTK_LEVEL_BAR(g_win.level_bar), bar_value);
  948. +    level_bar_set_value_type(LEVEL_BAR(g_win.level_bar), bar_value);
  949.      // Notice: User can change this by LEFT-clicking on the level-bar
  950.  
  951.      // Should we show RMS or peak-value on the levelbar?
  952. diff -rupN audio-recorder/src/Makefile.am audio-recorder_fix-build/src/Makefile.am
  953. --- audio-recorder/src/Makefile.am  2014-10-03 12:53:54.000000000 -0500
  954. +++ audio-recorder_fix-build/src/Makefile.am    2015-05-11 12:53:12.494347412 -0500
  955. @@ -43,7 +43,7 @@ audio_recorder_SOURCES = rec-window.h co
  956.      utility.c utility.h \
  957.      settings.c settings-pipe.c settings.h \
  958.      about.c about.h \
  959. -    gtklevelbar.c gtklevelbar.h \
  960. +    levelbar.c levelbar.h \
  961.      main.c
  962.  
  963.  
  964. diff -rupN audio-recorder/src/Makefile.in audio-recorder_fix-build/src/Makefile.in
  965. --- audio-recorder/src/Makefile.in  2015-02-11 11:55:09.000000000 -0500
  966. +++ audio-recorder_fix-build/src/Makefile.in    2015-05-11 12:54:09.029392887 -0500
  967. @@ -98,7 +98,7 @@ am_audio_recorder_OBJECTS = systray-icon
  968.     gst-devices.$(OBJEXT) rec-manager.$(OBJEXT) support.$(OBJEXT) \
  969.     timer.$(OBJEXT) timer-parser.$(OBJEXT) utility.$(OBJEXT) \
  970.     settings.$(OBJEXT) settings-pipe.$(OBJEXT) about.$(OBJEXT) \
  971. -   gtklevelbar.$(OBJEXT) main.$(OBJEXT)
  972. +   levelbar.$(OBJEXT) main.$(OBJEXT)
  973.  audio_recorder_OBJECTS = $(am_audio_recorder_OBJECTS)
  974.  audio_recorder_LDADD = $(LDADD)
  975.  AM_V_P = $(am__v_P_@AM_V@)
  976. @@ -329,7 +329,7 @@ audio_recorder_SOURCES = rec-window.h co
  977.      utility.c utility.h \
  978.      settings.c settings-pipe.c settings.h \
  979.      about.c about.h \
  980. -    gtklevelbar.c gtklevelbar.h \
  981. +    levelbar.c levelbar.h \
  982.      main.c
  983.  
  984.  all: all-am
  985. @@ -431,7 +431,7 @@ distclean-compile:
  986.  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-pipeline.Po@am__quote@
  987.  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-recorder.Po@am__quote@
  988.  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-vad.Po@am__quote@
  989. -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtklevelbar.Po@am__quote@
  990. +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/levelbar.Po@am__quote@
  991.  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@
  992.  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
  993.  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
  994. diff -rupN audio-recorder/src/rec-window.h audio-recorder_fix-build/src/rec-window.h
  995. --- audio-recorder/src/rec-window.h 2015-02-06 09:04:35.000000000 -0500
  996. +++ audio-recorder_fix-build/src/rec-window.h   2015-05-11 13:00:50.431465183 -0500
  997. @@ -5,12 +5,12 @@
  998.  #include <gtk/gtk.h>
  999.  #include <gdk/gdk.h>
  1000.  
  1001. -#include "gtklevelbar.h"
  1002. +#include "levelbar.h"
  1003.  
  1004.  // Width of the settings window
  1005.  #define PREF_WINDOW_WIDTH 300
  1006.  
  1007. -// PULSE_TYPE: Type of pulse on the gtklevelbar.
  1008. +// PULSE_TYPE: Type of pulse on the levelbar.
  1009.  // Notice: This cannot be changed from the GUI.
  1010.  // Use Gsettings/dconf-editor and find "level-bar-pulse-type" in apps -> audio-recorder.
  1011.  typedef enum PULSE_TYPE {PULSE_PEAK, PULSE_RMS} PULSE_TYPE;
  1012. @@ -27,7 +27,7 @@ typedef struct {
  1013.  
  1014.      GtkWidget *time_label;  // Labels to show recording time and filesize
  1015.      GtkWidget *size_label;
  1016. -    GtkWidget *level_bar; // Gtklevelbar widget
  1017. +    GtkWidget *level_bar; // levelbar widget
  1018.  
  1019.      GtkWidget *filename; // Current filename
  1020.      GtkWidget *add_to_file; // Add to current file?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement