From e29961fdb2a48874c895829880eadbf13e094c0c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 10 Oct 2009 11:43:31 -0700 Subject: Add channel menu to ao-view. Sets radio channel when TD is connected, saves selected channel in gconf database. Signed-off-by: Keith Packard --- ao-tools/ao-view/aoview_monitor.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ao-tools/ao-view/aoview_monitor.c') diff --git a/ao-tools/ao-view/aoview_monitor.c b/ao-tools/ao-view/aoview_monitor.c index 8564014b..48e20320 100644 --- a/ao-tools/ao-view/aoview_monitor.c +++ b/ao-tools/ao-view/aoview_monitor.c @@ -82,6 +82,7 @@ aoview_monitor_parse(const char *input_line) char line_buf[8192], *line; struct aodata data; int tracking_pos; + int channel; /* avoid smashing our input parameter */ strncpy (line_buf, input_line, sizeof (line_buf)-1); @@ -214,15 +215,26 @@ aoview_monitor_callback(gpointer user_data, } } +void +aoview_monitor_set_channel(int channel) +{ + if (monitor_serial) + aoview_serial_printf(monitor_serial, "c r %d\n", channel); +} + gboolean aoview_monitor_connect(char *tty) { + int channel; aoview_monitor_disconnect(); monitor_serial = aoview_serial_open(tty); if (!monitor_serial) return FALSE; aoview_table_clear(); aoview_state_reset(); + channel = aoview_channel_current(); + if (channel >= 0) + aoview_monitor_set_channel(channel); aoview_serial_set_callback(monitor_serial, aoview_monitor_callback); return TRUE; -- cgit v1.2.3