interface_il.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <gdk/gdkkeysyms.h>
#include <gnome.h>
#include <malloc.h>
#include <stdlib.h>
#include <gdk/gdk.h>
#include <glib.h>
#include "morse.h"
#include "audio.h"
#include "interface_il.h"
#include "support.h"

Include dependency graph for interface_il.c:

Go to the source code of this file.

Defines

#define STATUS_BAR_MESSAGE_LENGTH   25
#define NUMBER_OF_STATUS_BARS   03
#define MAX_SPACES_TO_APPEND   30
#define NUM_PLOTS   3
#define BW_WIDGET_NAME_PREFIX   "bw"
#define BW_WIDGET_NAME_SUFFIX   "_hz"
#define BW_WIDGET_NAME_LENGTH   16
#define open_plot_debug_pipe(void)

Functions

 G_LOCK_DEFINE (y)
 G_LOCK_DEFINE (buffer)
static void update_status_bar (uint32_t ffts, uint32_t samples, double wpm)
 Thread safe method that updates the status bar.
static void update_statistics_window (const morse_stats_ts *stats_t)
static void gui_append_character_2_morse_text (char *character)
 Thread safe method that appends text to the decoded text widget.
static void scope_fft_plot (double *vector, uint32_t num_points)
 Thread safe method that displays waveform on scope_v widget.
static void dialog_box (char *message)
 Wrapper function for whatever GUI message box is implemented.
int32_t plot_fft_data_array_create (uint32_t num_points)
 Method that allocates the waveform data to be displayed by the scope_v widget.
void plot_fft_data_array_destroy (void)
 De-allocates array created by plot_fft_data_array_create.
void statistics_window_deleted_handler (void)
void init_gui_interface_hooks (void)
 Registers GUI handlers into Morse GUI Handler Interface.
uint32_t get_fft_data_size (void)
int32_t get_fft_graph_top (void)
uint32_t get_tone_packet_size (void)
int32_t threads_stop (void)
 This function is put into the GUI main loop to cancel running threads.
void preferences_enabled (gboolean state)
 Used to enable/disable access to the preferences when the morse code threads are stopped/running.
void interface_activate_bw_chk_item (const int32_t bw)

Variables

static char name_buffer [BW_WIDGET_NAME_LENGTH]
GtkWidget * morse_stats = NULL
static gfloat * y = NULL
static char buffer [NUMBER_OF_STATUS_BARS][STATUS_BAR_MESSAGE_LENGTH]


Define Documentation

#define BW_WIDGET_NAME_LENGTH   16

Max size of temporay text buffer.

See also:
name_buffer

Definition at line 63 of file interface_il.c.

Referenced by interface_activate_bw_chk_item(), and update_statistics_window().

#define BW_WIDGET_NAME_PREFIX   "bw"

Prefix for bandwidth radio items in main GUI.

Definition at line 56 of file interface_il.c.

Referenced by interface_activate_bw_chk_item().

#define BW_WIDGET_NAME_SUFFIX   "_hz"

Suffix for bandwidth radio items in main GUI.

Definition at line 58 of file interface_il.c.

Referenced by interface_activate_bw_chk_item().

#define MAX_SPACES_TO_APPEND   30

Definition at line 50 of file interface_il.c.

#define NUM_PLOTS   3

Maximum number of plots for debug plotting.

Definition at line 53 of file interface_il.c.

#define NUMBER_OF_STATUS_BARS   03

Definition at line 49 of file interface_il.c.

#define open_plot_debug_pipe ( void   ) 

Definition at line 89 of file interface_il.c.

Referenced by init_gui_interface_hooks().

#define STATUS_BAR_MESSAGE_LENGTH   25

Definition at line 48 of file interface_il.c.


Function Documentation

static void dialog_box ( char *  message  )  [static]

Wrapper function for whatever GUI message box is implemented.

Definition at line 222 of file interface_il.c.

References main_gui, and main_widgets::main_window_v.

Referenced by init_gui_interface_hooks().

G_LOCK_DEFINE ( buffer   ) 

G_LOCK_DEFINE ( y   ) 

uint32_t get_fft_data_size ( void   ) 

Definition at line 242 of file interface_il.c.

References morse_get_fft_data_size().

Referenced by create_MainWindow().

Here is the call graph for this function:

int32_t get_fft_graph_top ( void   ) 

Definition at line 243 of file interface_il.c.

References morse_get_fft_graph_top().

Referenced by create_MainWindow().

Here is the call graph for this function:

uint32_t get_tone_packet_size ( void   ) 

Definition at line 244 of file interface_il.c.

References morse_get_tone_packet_size().

Referenced by on_startbutton_clicked().

Here is the call graph for this function:

static void gui_append_character_2_morse_text ( char *  character  )  [static]

Thread safe method that appends text to the decoded text widget.

See also:
decoded_text_v
Parameters:
character pointer to one or more ascii characters

Definition at line 99 of file interface_il.c.

References main_widgets::decoded_text_v, FALSE, and main_gui.

Referenced by init_gui_interface_hooks().

void init_gui_interface_hooks ( void   ) 

void interface_activate_bw_chk_item ( const int32_t  bw  ) 

Used to activate the appropriate bandwidth radio box when the application is started.

Parameters:
bw Bandwidth in Hertz.

Definition at line 261 of file interface_il.c.

References BW_WIDGET_NAME_LENGTH, BW_WIDGET_NAME_PREFIX, BW_WIDGET_NAME_SUFFIX, lookup_widget(), main_gui, main_widgets::main_window_v, name_buffer, and TRUE.

Referenced by main().

Here is the call graph for this function:

int32_t plot_fft_data_array_create ( uint32_t  num_points  ) 

Method that allocates the waveform data to be displayed by the scope_v widget.

See also:
scope_v plot_fft_data_array_destroy
Parameters:
num_points size of array to create

Definition at line 117 of file interface_il.c.

References main_gui, main_widgets::scope_v, and y.

Referenced by on_startbutton_clicked().

void plot_fft_data_array_destroy ( void   ) 

De-allocates array created by plot_fft_data_array_create.

See also:
plot_fft_data_array_create

Definition at line 128 of file interface_il.c.

References y.

Referenced by threads_stop().

void preferences_enabled ( gboolean  state  ) 

Used to enable/disable access to the preferences when the morse code threads are stopped/running.

Definition at line 254 of file interface_il.c.

References lookup_widget(), main_gui, and main_widgets::main_window_v.

Referenced by on_startbutton_clicked(), and threads_stop().

Here is the call graph for this function:

static void scope_fft_plot ( double *  vector,
uint32_t  num_points 
) [static]

Thread safe method that displays waveform on scope_v widget.

See also:
scope_v
Parameters:
vector pointer to array of waveform to be plotted
num_points size of array

Definition at line 150 of file interface_il.c.

References main_gui, main_widgets::scope_v, and y.

Referenced by init_gui_interface_hooks().

void statistics_window_deleted_handler ( void   ) 

This is called when the Statistics window is destroyed.

Definition at line 136 of file interface_il.c.

References FALSE, lookup_widget(), main_gui, main_widgets::main_window_v, and morse_stats.

Referenced by on_stats_window_delete_event().

Here is the call graph for this function:

int32_t threads_stop ( void   ) 

This function is put into the GUI main loop to cancel running threads.

Definition at line 246 of file interface_il.c.

References morse_stop_threads(), plot_fft_data_array_destroy(), preferences_enabled(), and TRUE.

Referenced by on_exit1_activate(), on_exit_button_clicked(), on_MainWindow_delete_event(), and on_stop_button_clicked().

Here is the call graph for this function:

static void update_statistics_window ( const morse_stats_ts stats_t  )  [static]

Thread safe method that updates the status bar.

Parameters:
stats_t Various Morse Statistics

Definition at line 192 of file interface_il.c.

References morse_stats_ts::avg_dah_dur, morse_stats_ts::avg_dit_dur, BW_WIDGET_NAME_LENGTH, morse_stats_ts::dah_dit_ratio, lookup_widget(), morse_stats, name_buffer, and morse_stats_ts::wpm.

Referenced by init_gui_interface_hooks().

Here is the call graph for this function:

static void update_status_bar ( uint32_t  ffts,
uint32_t  samples,
double  wpm 
) [static]

Thread safe method that updates the status bar.

Parameters:
ffts number of fft packets processed
samples number of audio samples processed
wpm code speed in Words per Minute

Definition at line 172 of file interface_il.c.

References buffer, main_widgets::ffts_statusbar_v, main_gui, main_widgets::samples_statusbar_v, STATUS_BAR_MESSAGE_LENGTH, and main_widgets::wpm_statusbar_v.

Referenced by init_gui_interface_hooks().


Variable Documentation

char buffer[NUMBER_OF_STATUS_BARS][STATUS_BAR_MESSAGE_LENGTH] [static]

Definition at line 73 of file interface_il.c.

Referenced by update_status_bar().

GtkWidget* morse_stats = NULL

Morse statistics display.

Definition at line 68 of file interface_il.c.

Referenced by on_statistics_activate(), statistics_window_deleted_handler(), and update_statistics_window().

char name_buffer[BW_WIDGET_NAME_LENGTH] [static]

Temporary buffer for text manipulations.

Definition at line 65 of file interface_il.c.

Referenced by interface_activate_bw_chk_item(), and update_statistics_window().

gfloat* y = NULL [static]

Temporary array for GtkCurve data.

Definition at line 71 of file interface_il.c.

Referenced by plot_fft_data_array_create(), plot_fft_data_array_destroy(), and scope_fft_plot().


Generated on Mon Jun 22 21:39:17 2009 for morse2txt by  doxygen 1.5.6