1 // VoicePager.h - description. -*- C++ -*-
3 // Copyright (C) 1999, 2000 Red Hat.
4 // This file is part of SID and is licensed under the GPL.
5 // See the file COPYING.SID for conditions for redistribution.
16 #include "rtc-driver.h"
17 #include "parport-driver.h"
18 #include "adac-driver.h"
23 parport_driver pport_drobj; // Object of type parallel port driver
24 rtc_driver rtc_drobj; // object of type rtc driver.
26 vector<unsigned char> id_arr; // vector of unique identity numbers
27 vector<string> rnd_telnum; // telephone Numbers
29 int record_process; // bool variable whether recording in process?
30 int play_process; // any message is currently being played?
31 unsigned char last_cmd; // Stores last command.
32 unsigned char inuse_idnum; // Current id which is being played /record
34 unsigned char rec_seccounter; // sec at which recording will be disconnected.
35 unsigned char rec_curtime; // stores last second value read from RTC
39 PagerUI *lcdpager_ptr; // Pointer to lcd pager object
40 lcd_driver lcd_drobj; // object of type lcd driver
44 virtual ~VoicePager();
46 void initialize_components(); // Initializes RTC, LCD, Parallel port
47 void poll_input(); // Polls parallel port for input data
50 void show_lcdmsg (string lcd_msg, unsigned lcd_rownum);
51 void clear_lcddisplay ();
55 CMD_UP = 1, // UP key code
56 CMD_DN = 2, // DOWN key code
57 CMD_REC = 4, // REC key code
58 CMD_PLAY = 8, // PLAY key code
59 CMD_DEL = 16, // DEL key code
60 CMD_DONE = 32, // DONE key code
61 CMD_STOP = 64, // STOP key code
62 CMD_CLR = 0 // No key is depressed
66 TIME_LIMIT = 8, // Our hard limit on max record time
67 MAX_SEC = 59 // Max seconds value from RTC
71 void init_idvector(); // Initializes the unique id vector
72 void init_rndtelnum(); // Initializes vector of random tel nums
73 void initialize_rtc(time_t init_time); // Initializes RTc component
74 void initialize_lcd(); // Initializes LCD component
76 void scroll_up(); // Up key is pressed
77 void scroll_down(); // Down key is pressed
78 void record_newmsg(); // Record new message
79 void play_storedmsg(); // Sends data to sound object for play
80 bool play_done(); // Checking to see if non blocking play is done
81 void delete_storedmsg(); // To delet stored message
82 void delete_msg(unsigned char del_msgid); // Helper function to delete msg
83 void stop_recmsg(); // Stop play/record sound
85 void set_hardrectime(); // Sets hard time limit for current recording
86 void clear_hardrectime();// Clears hard time as recording is over.
87 bool increase_reccounter(unsigned char incr_secs);// increases record time limit counter
88 bool crossed_reclimit(); // Did we cross the record limit ?
90 string get_rndtelnum(); // Returns Random Telephone number
91 string get_rtctime(); // Returns Current RTC value
93 void read_rtcseconds(unsigned char& sec_val); // Helper function
94 void display_msg (string temp_msg); // Helper function to display msgs.
97 map<unsigned char, string> rec_msgs; // Recorded messages
98 adac_driver adac_drobj; // Object of type adac driver.
101 void send_dacdata (unsigned char play_id);
102 void remove_storedmsg (unsigned char del_id);
103 void get_adcdata (unsigned char rec_id);
104 void stop_playmsg (unsigned char play_id);
107 #endif // VOICE_PAGER_H