~ubuntu-branches/ubuntu/raring/xfce4-volumed/raring

« back to all changes in this revision

Viewing changes to src/xvd_keys.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2009-09-05 22:17:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090905221715-rj1pmaf4ms4r9jvl
Tags: 0.1.4-0ubuntu1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        gint i = 0;
35
35
        gboolean belongs = FALSE;
36
36
        
 
37
        if (list == NULL)
 
38
                return FALSE;
 
39
        
37
40
        while (list[i] != XCB_NO_SYMBOL) {
38
41
                belongs |= (elem == list[i]);
39
42
                i++;
59
62
                                        kpe = (xcb_key_press_event_t *)ev;
60
63
                                        
61
64
                                        if (_xvd_keys_is_symbol(kpe->detail, Inst->keyRaise)) {
62
 
                                                xvd_mixer_change_volume (Inst, Inst->vol_step);
63
 
                                                #ifdef HAVE_LIBNOTIFY
64
 
                                                if (!Inst->muted) {
 
65
                                                if (xvd_mixer_change_volume (Inst, Inst->vol_step)) {
 
66
                                                        #ifdef HAVE_LIBNOTIFY
 
67
/*                                                      if (!Inst->muted) {*/
65
68
                                                        if (Inst->current_vol == 100)
66
69
                                                                xvd_notify_overshoot_notification (Inst);
67
70
                                                        else
68
71
                                                                xvd_notify_volume_notification (Inst);
 
72
/*                                                      }*/
 
73
                                                        #endif
69
74
                                                }
70
 
                                                #endif
71
75
                                        }
72
76
 
73
77
                                        else if (_xvd_keys_is_symbol(kpe->detail, Inst->keyLower)) {
74
 
                                                xvd_mixer_change_volume (Inst, (Inst->vol_step * -1));
75
 
                                                #ifdef HAVE_LIBNOTIFY
76
 
                                                if (!Inst->muted) {
 
78
                                                if (xvd_mixer_change_volume (Inst, (Inst->vol_step * -1))) {
 
79
                                                        #ifdef HAVE_LIBNOTIFY
 
80
/*                                                      if (!Inst->muted) {*/
77
81
                                                        if (Inst->current_vol == 0)
78
82
                                                                xvd_notify_undershoot_notification (Inst);
79
83
                                                        else
80
84
                                                                xvd_notify_volume_notification (Inst);
 
85
/*                                                      }*/
 
86
                                                        #endif
81
87
                                                }
82
 
                                                #endif
83
88
                                        }
84
89
 
85
90
                                        else if (_xvd_keys_is_symbol(kpe->detail, Inst->keyMute)) {
86
 
                                                xvd_mixer_toggle_mute (Inst);
87
 
                                                #ifdef HAVE_LIBNOTIFY
88
 
                                                if (Inst->muted)
89
 
                                                        xvd_notify_notification (Inst, "notification-audio-volume-muted", 0);
90
 
                                                else {
91
 
                                                        xvd_mixer_init_volume (Inst);
92
 
                                                        xvd_notify_volume_notification (Inst);
 
91
                                                if (xvd_mixer_toggle_mute (Inst)) {
 
92
                                                        #ifdef HAVE_LIBNOTIFY
 
93
                                                        if (Inst->muted)
 
94
                                                                xvd_notify_notification (Inst, "notification-audio-volume-muted", 0);
 
95
                                                        else {
 
96
                                                                xvd_mixer_init_volume (Inst);
 
97
                                                                xvd_notify_volume_notification (Inst);
 
98
                                                        }
 
99
                                                        #endif
93
100
                                                }
94
 
                                                #endif
95
101
                                        }
96
102
                                        break;
97
103
                                
216
222
void 
217
223
xvd_keys_release (XvdInstance *Inst)
218
224
{
219
 
        xcb_key_symbols_free (Inst->kss);
220
225
        g_free (Inst->keyRaise);
221
226
        g_free (Inst->keyLower);
222
227
        g_free (Inst->keyMute);
223
 
        xcb_disconnect (Inst->conn);
 
228
        if (Inst->kss)
 
229
                xcb_key_symbols_free (Inst->kss);
 
230
        if (Inst->conn)
 
231
                xcb_disconnect (Inst->conn);
224
232
}