~blackskad/gnomeradio/dev-vol-button

« back to all changes in this revision

Viewing changes to src/gui.c

  • Committer: mfcn
  • Date: 2008-04-13 14:30:58 UTC
  • Revision ID: svn-v3-trunk0:ba97a3d1-ec25-0410-b1c6-e06ad936ea6c:trunk:194
        * data/gnomeradio.schemas.in:
        * src/Makefile.am:
        * src/gui.c (initial_frequency_scan_cb), (initial_frequency_scan),
        (start_radio), (redraw_status_window), (adj_value_changed_cb):
        * src/gui.h:
        * src/prefs.c (save_settings), (load_settings):
        * src/radio.c (radio_init), (radio_is_init), (radio_stop),
        (radio_set_freq), (radio_unmute), (radio_mute), (radio_get_stereo),
        (radio_get_signal), (radio_check_station):
        * src/radio.h:
        * src/tech.c (mixer_get_volume):
        * src/tech.h:
        * src/v4l1.c (v4l1_radio_init), (v4l1_radio_is_init),
        (v4l1_radio_set_freq), (v4l1_radio_mute), (v4l1_radio_get_stereo),
        (v4l1_radio_get_signal), (v4l1_radio_finalize),
        (v4l1_radio_dev_new):
        * src/v4l1.h:
        * src/v4l2.c (v4l2_radio_init), (v4l2_radio_is_init),
        (v4l2_radio_set_freq), (v4l2_radio_mute), (v4l2_radio_get_stereo),
        (v4l2_radio_get_signal), (v4l2_radio_finalize),
        (v4l2_radio_dev_new):
        * src/v4l2.h:
        Refactored backend so that it supports both v4l and v4l2 and selection can
        be made at runtime. The v4l2 code is based on the patch contributed by
        James Henstridge (bug #429005).

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "gui.h"
30
30
#include "trayicon.h"
31
31
#include "tech.h"
 
32
#include "radio.h"
32
33
#include "rec_tech.h"
33
34
#include "lirc.h"
34
35
#include "prefs.h"
114
115
        gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(fsd->progress), MAX(0, (freq - FREQ_MIN)/(FREQ_MAX - FREQ_MIN)));        
115
116
        
116
117
        freq += 1.0/STEPS;
117
 
        radio_setfreq(freq);
 
118
        radio_set_freq(freq);
118
119
        
119
120
        return TRUE;
120
121
}
161
162
                if (g_list_length(data.stations) > 0) {
162
163
                        gfloat f = *((gfloat*)data.stations->data);
163
164
                        adj->value = f*STEPS;
164
 
                        radio_setfreq(f);
 
165
                        radio_set_freq(f);
165
166
                        
166
167
                        GtkWidget *dialog;
167
168
                        GList *ptr;
223
224
 
224
225
void start_radio(gboolean restart, GtkWidget *app)
225
226
{
 
227
    DriverType driver = DRIVER_ANY;
226
228
        if (restart)
227
229
                radio_stop();
228
230
        
229
 
        if (!radio_init(settings.device)) 
 
231
    if (settings.driver) {
 
232
        if (0 == strcmp(settings.driver, "v4l1"))
 
233
            driver = DRIVER_V4L1;
 
234
        if (0 == strcmp(settings.driver, "v4l2"))
 
235
            driver = DRIVER_V4L2;
 
236
    }
 
237
 
 
238
        if (!radio_init(settings.device, driver))
230
239
        {
231
240
                char *caption = g_strdup_printf(_("Could not open device \"%s\"!"), settings.device);
232
241
                char *detail = g_strdup_printf(_("Check your settings and make sure that no other\n"
308
317
        freq[3] = (val % 100) / 10;
309
318
        freq[4] = val % 10;
310
319
 
311
 
        signal_strength = radio_getsignal();
312
 
        is_stereo = radio_getstereo();
 
320
        signal_strength = radio_get_signal();
 
321
        is_stereo = radio_get_stereo();
313
322
        
314
323
        if (signal_strength > 3) signal_strength = 3;
315
324
        if (signal_strength < 0) signal_strength = 0;
409
418
        gtk_tooltips_set_tip(tooltips, freq_scale, buffer, NULL);
410
419
        g_free(buffer);
411
420
 
412
 
        radio_setfreq(adj->value/STEPS);
 
421
        radio_set_freq(adj->value/STEPS);
413
422
}
414
423
 
415
424
static void volume_value_changed_cb(BaconVolumeButton *button, gpointer user_data)