aldo-0.7.6.orig/0000755000000000000000000000000011324372365010276 5ustar aldo-0.7.6.orig/include/0000755000000000000000000000000011324372365011721 5ustar aldo-0.7.6.orig/include/blocks.hh0000644000000000000000000000533011324367676013531 0ustar // -*- C++ -*- /*************************************************************************** libexercises part of Aldo --------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef BLOCKS_H #define BLOCKS_H #include "keyer.hh" #include "skill.hh" #include #include namespace libexercises { class Blocks { friend libkeyer::Keyer& operator<<(libkeyer::Keyer&, const Blocks&); private: std::string m_strings; unsigned int m_num_chars; unsigned int m_num_strings; unsigned int m_skill; void m_prepare_mixed(); void m_prepare_submixed(); void m_prepare_ordered(); unsigned int share(); std::string randstring(std::string, unsigned int); std::string gen(std::string, unsigned int); public: Blocks(unsigned int, unsigned int, unsigned int); Blocks(const Blocks&); ~Blocks(); std::list tokenize() const; /* inline unsigned int string_len() const { return m_num_chars; } inline unsigned int len() const { return m_num_strings; } */ }; libkeyer::Keyer& operator<<(libkeyer::Keyer&, const Blocks&); } #endif //BLOCKS_H aldo-0.7.6.orig/include/koch.hh0000644000000000000000000000604411324367676013203 0ustar // -*- C++ -*- /*************************************************************************** libexercises part of Aldo --------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef KOCH_H #define KOCH_H #include "keyer.hh" #include "skill.hh" #include #include namespace libexercises { const unsigned int addgroup = 0; const unsigned int addchar = 1; const unsigned int addsymbol = 2; class Koch { friend libkeyer::Keyer& operator<<(libkeyer::Keyer&, const Koch&); private: std::string m_strings; std::string m_chars; unsigned int m_num_chars; unsigned int m_num_strings; unsigned int m_skill; unsigned int m_next_difficulty; std::string randstring(std::string, unsigned int); public: // Koch(unsigned int, unsigned int, unsigned int, unsigned int); Koch(std::string, unsigned int, unsigned int, unsigned int, unsigned int); Koch(const Koch&); ~Koch(); void shuffle(); void next(); std::list tokenize() const; inline unsigned int skill() const { return m_skill; } inline std::string get_chars() const { return m_chars; } inline unsigned int strlen() const { return m_num_chars; } inline unsigned int strnum() const { return m_num_strings; } inline unsigned int difficulty() const { return m_next_difficulty; } }; libkeyer::Keyer& operator<<(libkeyer::Keyer&, const Koch&); } #endif //KOCH_H aldo-0.7.6.orig/include/astream.hh0000644000000000000000000000463411324367676013716 0ustar // -*- C++ -*- /*************************************************************************** libaudiostream -------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sat 9 Mar 2002 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef AUDIOSTREAM_H #define AUDIOSTREAM_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_AO_AO_H #include #endif #include "wave.hh" #include "audioworkspace.hh" #include "audioexcep.hh" namespace libaudiostream { class oastream { public: oastream(ao_sample_format, std::string device) throw(AudioException); oastream(const oastream&); ~oastream(); oastream& operator<<(const Wave&) throw(AudioException); oastream& operator=(const oastream&); private: ao_device* m_audio; ao_sample_format m_format; int m_default_driver; }; } #endif //AUDIOSTREAM_H aldo-0.7.6.orig/include/qrz.hh0000644000000000000000000000506211324367676013072 0ustar // -*- C++ -*- /*************************************************************************** libexercises part of Aldo --------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef QRZ_H #define QRZ_H #include "keyer.hh" #include namespace libexercises { class Qrz { friend libkeyer::Keyer& operator<<(libkeyer::Keyer&, const Qrz&); private: std::string m_strings; unsigned int m_num_chars; unsigned int m_num_strings; public: Qrz(): m_num_chars(0), m_num_strings(0) { m_strings.clear(); } Qrz(const std::string &, unsigned int); Qrz(const Qrz&); unsigned int verify(const std::string&) const; inline unsigned int string_len() const { return m_num_chars; } inline unsigned int len() const { return m_num_strings; } inline std::string get_string() const { return m_strings; } }; libkeyer::Keyer& operator<<(libkeyer::Keyer&, const Qrz&); } #endif //QRZ_H aldo-0.7.6.orig/include/audioexcep.hh0000644000000000000000000000441311324367676014403 0ustar // -*- C++ -*- /*************************************************************************** libaudiostream -------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sat 9 Mar 2002 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef AUDIOEXCEPTION_H #define AUDIOEXCEPTION_H #include #include namespace libaudiostream { class AudioException : public std::exception { private: std::string m_message; public: AudioException(const std::string &message) throw() : std::exception() { m_message = message; } virtual ~AudioException() throw() { } virtual const char* message() const throw() { return m_message.c_str(); } }; } #endif // AUDIOEXCEPTION_H aldo-0.7.6.orig/include/menu.hh0000644000000000000000000000717111324367676013225 0ustar // -*- C++ -*- /*************************************************************************** libmenu -------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef MENU_H #define MENU_H #include #include namespace libmenu { class Menu; enum item_type { none = 0, type1 = 1, type2 = 2}; typedef unsigned int id_type; typedef void (*Function1)(); typedef void (*Function2)(Menu&); class Item { private: unsigned int m_id; std::string m_caption; item_type m_type; Function1 m_cmd1; Function2 m_cmd2; public: Item() :m_id(0), m_type(none), m_cmd1(0), m_cmd2(0) {} Item(id_type id, std::string c, Function1 f1) : m_id(id), m_caption(c), m_type(type1), m_cmd1(f1), m_cmd2(0) {} Item(id_type id, std::string c, Function2 f2) : m_id(id), m_caption(c), m_type(type2), m_cmd1(0), m_cmd2(f2) {} Item(const Item& cpy); std::string caption() const; void exe(Menu&) const; item_type get_type() { return m_type; } Item& operator=(const Item&); inline id_type id() const { return m_id; } }; class Menu { private: std::string m_title; std::string m_prompt; std::vector m_its; bool m_running; unsigned int m_last; public: Menu(); Menu(const std::string&, const std::string&); Menu(const Menu& cpy); void show(); void add_item(id_type, std::string, Function1); void add_item(id_type, std::string, Function2); void operator--(); void add_item_at(unsigned int, id_type, std::string, Function1); void add_item_at(unsigned int, id_type, std::string, Function2); void delete_item_at(unsigned int); void delete_item(id_type); bool find(id_type); inline void set_title(std::string title) { m_title = title; } inline void set_prompt(std::string prompt) { m_prompt = prompt; } inline bool running() const { return m_running; } inline void close() { m_running = false; } inline unsigned last_selected() { return m_last; } }; } #endif // MENU_H aldo-0.7.6.orig/include/Makefile.am0000644000000000000000000000126711324352733013760 0ustar # Copyright (C) 2005 Giuseppe Martino # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. noinst_HEADERS = astream.hh datafile.hh exception.hh menu.hh qrz.hh section.hh\ textfile.hh blocks.hh dialog.hh keyer.hh option.hh random.hh skill.hh\ wave.hh audioexcep.hh audioworkspace.hh koch.hh resources.hh aldo-0.7.6.orig/include/exception.hh0000644000000000000000000000527611324367676014263 0ustar // -*- C++ -*- /*************************************************************************** libdatafile -------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef EXCEPTION_H #define EXCEPTION_H namespace libdatafile { struct Not_datafile_format { const char* m_file_name; public: Not_datafile_format(const char* f): m_file_name(f) {} }; struct Over_write_file { const char* m_file_name; public: Over_write_file(const char* f): m_file_name(f) {} }; struct Option_not_found { const char* m_option_name; public: Option_not_found(const char* o): m_option_name(o) {} }; struct Section_not_found { const char* m_section_name; public: Section_not_found(const char* s): m_section_name(s) {} }; struct File_not_opened { const char* m_file_name; public: File_not_opened(const char* f): m_file_name(f) {} }; struct File_not_exist { const char* m_file_name; public: File_not_exist(const char* f): m_file_name(f) {} }; } // Namespace Datafile_exception #endif // EXCEPTION_H aldo-0.7.6.orig/include/datafile.hh0000644000000000000000000000503711324367676014031 0ustar // -*- C++ -*- /*************************************************************************** libdatafile -------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef DATAFILE_H #define DATAFILE_H #include "section.hh" namespace libdatafile { typedef std::list
::iterator sec_it; enum access {Read = 2, Write = 4, Create = 8, Update = 16}; class Datafile { private: bool m_opened; std::list
m_sections; std::string m_filename; access m_access; std::string read_value_in(const std::string&); std::string read_option_name_in(const std::string&); sec_it begin(); sec_it end(); public: Datafile(const std::string&, const access&); Datafile(const Datafile&); ~Datafile(); void open(); void save(); sec_it section(const std::string&); void add_section(const std::string&); void remove_section(const std::string&); }; } #endif //Datafile_H aldo-0.7.6.orig/include/skill.hh0000644000000000000000000000526011324367676013374 0ustar // -*- C++ -*- /*************************************************************************** libexercises part of Aldo --------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef SKILL_H #define SKILL_H namespace libexercises { const unsigned int chars1 = 0x01; // e,i,s,h,t,m,o const unsigned int chars2 = 0x02; // a,w,j,v,u const unsigned int chars3 = 0x04; // n,d,b,g const unsigned int chars4 = 0x08; // r,p,l,f const unsigned int chars5 = 0x10; // k,c,y,q,z,x const unsigned int numbrs = 0x20; // 0,1,2,3,4,5,6,7,8,9 const unsigned int mixed = 0x40; // totaly mixed const unsigned int submixed = 0x80; // group mixed const unsigned int skill1 = chars1 | mixed; const unsigned int skill2 = skill1 | chars2; // chars1 + chars2 const unsigned int skill3 = skill2 | chars3; // skill2 + chars2 const unsigned int skill4 = skill3 | chars4; // skill3 + chars3 const unsigned int skill5 = skill4 | chars5; // skill4 + chars5 const unsigned int skill6 = skill5 | numbrs; // skill5 + numbers } #endif // SKILL_H aldo-0.7.6.orig/include/textfile.hh0000644000000000000000000000454611324367676014110 0ustar // -*- C++ -*- /*************************************************************************** libexercises part of Aldo --------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef TEXTFILE_H #define TEXTFILE_H #include "keyer.hh" #include namespace libexercises { class TextFile { friend libkeyer::Keyer& operator<<(libkeyer::Keyer&, const TextFile&); private: std::string m_strings; std::string m_filename; public: TextFile() { m_strings.clear(); m_filename.clear(); } TextFile(std::string); TextFile(const TextFile&); inline std::string get_string() const { return m_strings; } }; libkeyer::Keyer& operator<<(libkeyer::Keyer&, const TextFile&); } #endif //TEXTFILE_H aldo-0.7.6.orig/include/section.hh0000644000000000000000000000450211324367676013720 0ustar // -*- C++ -*- /*************************************************************************** libdatafile -------------------- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Giuseppe "denever" Martino begin : Sun May 6 2001 email : denever@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA * * * ***************************************************************************/ #ifndef SECTION_H #define SECTION_H #include "option.hh" #include namespace libdatafile { typedef std::list