~blackskad/gnomeradio/dev-vol-button

« back to all changes in this revision

Viewing changes to src/lirc.c

  • Committer: Thomas Meire
  • Date: 2008-12-20 19:34:59 UTC
  • Revision ID: blackskad@awesomeness-20081220193459-x0n1bieryqc6vps4
Replaced bacon-volume-button with GtkVolumeButton

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#endif
30
30
 
31
 
#include "bacon-volume.h"
32
31
#include "lirc.h"
33
32
#include "gui.h"
34
33
 
45
44
static void execute_lirc_command (char *cmd)
46
45
{
47
46
        printf("lirc command: %s\n", cmd);
48
 
        int vol = (int)(bacon_volume_button_get_value(BACON_VOLUME_BUTTON(mute_button)) + 0.5f);
 
47
        int vol = (int)(gtk_volume_button_get_value(mute_button) + 0.5f);
49
48
 
50
49
        if (strcasecmp (cmd, "tune up") == 0) 
51
50
        {
57
56
        }
58
57
        else if (strcasecmp (cmd, "volume up") == 0) 
59
58
        {
60
 
                bacon_volume_button_set_value(BACON_VOLUME_BUTTON(mute_button), vol > 95 ? 100 : vol + 5);
 
59
                gtk_volume_button_set_value(mute_button, vol > 95 ? 100 : vol + 5);
61
60
                /*gtk_adjustment_set_value(volume, (volume->value > 95) ? 100 : volume->value+5);*/
62
61
        }
63
62
        else if (strcasecmp (cmd, "volume down") == 0) 
64
63
        {
65
 
                bacon_volume_button_set_value(BACON_VOLUME_BUTTON(mute_button), vol < 5 ? 0 : vol - 5);
 
64
                gtk_volume_button_set_value(mute_button, vol < 5 ? 0 : vol - 5);
66
65
                /*gtk_adjustment_set_value(volume,(volume->value < 5) ? 0 : volume->value-5);*/
67
66
        }
68
67
        else if (strcasecmp (cmd, "mute") == 0)