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

« back to all changes in this revision

Viewing changes to src/main.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:
18
18
 */
19
19
 
20
20
#ifdef HAVE_CONFIG_H
21
 
#include <config.h>
 
21
#include "config.h"
22
22
#endif
23
23
 
24
24
#include "xvd_keys.h"
80
80
        xvd_clean_track (Inst);
81
81
        xvd_keys_release (Inst);
82
82
        xvd_xfconf_shutdown (Inst);
 
83
        
 
84
        //TODO xvd_instance_free
83
85
}
84
86
 
85
87
static void 
88
90
        i->mixers = NULL;
89
91
        i->card = NULL;
90
92
        i->card_name = NULL;
 
93
        i->nameless_cards_count = 0;
91
94
        i->track = NULL;
92
95
        i->track_label = NULL;
93
96
        i->error = NULL;
94
97
        i->chan = NULL;
 
98
        i->xfconf_card_name = NULL;
 
99
        i->xfconf_track_label = NULL;
 
100
        i->previously_set_track_label = NULL;
95
101
        i->bus = NULL;
96
102
        i->bus_id = 0;
97
103
        i->loop = NULL;
125
131
        xvd_xfconf_init (Inst);
126
132
        
127
133
        /* Get card/track from xfconf */
128
 
        Inst->card_name = xvd_get_xfconf_card (Inst);
129
 
        
130
 
        if (NULL == Inst->card_name) {
131
 
                g_warning ("There seems to be no active card defined in the xfce mixer.\n");
 
134
        if (!xvd_xfconf_get_card (Inst)) {
 
135
                g_debug ("Main: There seems to be no active card defined in xfconf.\n");
132
136
        }
133
137
        
134
138
        /* Mixer init */
137
141
        xvd_mixer_init_bus (Inst);
138
142
        #endif
139
143
        
140
 
        // A mutex for the track might help in very unlikely cases.
141
 
        xvd_get_xfconf_card_from_mixer (Inst);
 
144
        // A mutex for the track might help in very unlikely cases. //TODO
 
145
        xvd_get_card_from_mixer (Inst, Inst->xfconf_card_name, NULL);
142
146
        
143
 
        gchar *tmp_track = xvd_get_xfconf_track (Inst);
144
 
        xvd_get_xfconf_track_from_mixer (Inst, tmp_track);
145
 
        g_free (tmp_track);
 
147
        xvd_xfconf_get_track (Inst);
 
148
        xvd_get_track_from_mixer (Inst, Inst->xfconf_track_label, NULL);
146
149
        
147
150
        xvd_mixer_init_volume (Inst);
148
 
        xvd_load_xfconf_vol_step (Inst);
 
151
        xvd_xfconf_get_vol_step (Inst);
149
152
        
150
153
        /* Libnotify init and idle till ready for the main loop */
151
154
        g_set_application_name (XVD_APPNAME);
153
156
        xvd_notify_init (Inst, XVD_APPNAME);
154
157
        #endif
155
158
        
156
 
        while (Inst->xvd_init_error) {
157
 
                sleep (1);
158
 
        }
159
 
        
160
 
        
161
159
        Inst->loop = g_main_loop_new (NULL, FALSE);
162
160
        g_main_loop_run (Inst->loop);
163
161