summaryrefslogtreecommitdiff
path: root/ao-tools/ao-view/aoview_monitor.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-10-10 11:43:31 -0700
committerKeith Packard <keithp@keithp.com>2009-10-10 11:43:31 -0700
commite29961fdb2a48874c895829880eadbf13e094c0c (patch)
tree9ed95ef96a1f03e0c0b8341254b1e1fbd7627a7c /ao-tools/ao-view/aoview_monitor.c
parenta3771bfc5ce740f9d89193e9f8b1d7987aa57264 (diff)
Add channel menu to ao-view.
Sets radio channel when TD is connected, saves selected channel in gconf database. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/ao-view/aoview_monitor.c')
-rw-r--r--ao-tools/ao-view/aoview_monitor.c12
1 files changed, 12 insertions, 0 deletions
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;