//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- { DI, DAH, end, end }, /* A */
+ { DI, DAH, END, END }, /* A */
{ DA, DI, DI, DIT }, /* B */
{ DA, DI, DA, DIT }, /* C */
{ DA, DI, DI, DIT }, /* B */
{ DA, DI, DA, DIT }, /* C */
- { DA, DI, DIT, end }, /* D */
- { DIT, end, end, end }, /* E */
+ { DA, DI, DIT, END }, /* D */
+ { DIT, END, END, END }, /* E */
{ DI, DI, DA, DIT }, /* F */
{ DI, DI, DA, DIT }, /* F */
- { DA, DA, DIT, end }, /* G */
+ { DA, DA, DIT, END }, /* G */
{ DI, DI, DI, DIT }, /* H */
{ DI, DI, DI, DIT }, /* H */
- { DI, DIT, end, end }, /* I */
+ { DI, DIT, END, END }, /* I */
{ DI, DA, DA, DAH }, /* J */
{ DI, DA, DA, DAH }, /* J */
- { DA, DI, DAH, end }, /* K */
+ { DA, DI, DAH, END }, /* K */
{ DI, DA, DI, DIT }, /* L */
{ DI, DA, DI, DIT }, /* L */
- { DA, DAH, end, end }, /* M */
- { DA, DIT, end, end }, /* N */
- { DA, DA, DAH, end }, /* O */
+ { DA, DAH, END, END }, /* M */
+ { DA, DIT, END, END }, /* N */
+ { DA, DA, DAH, END }, /* O */
{ DI, DA, DA, DIT }, /* P */
{ DA, DA, DI, DAH }, /* Q */
{ DI, DA, DA, DIT }, /* P */
{ DA, DA, DI, DAH }, /* Q */
- { DI, DA, DIT, end }, /* R */
- { DI, DI, DIT, end }, /* S */
- { DAH, end, end, end }, /* T */
- { DI, DI, DAH, end }, /* U */
+ { DI, DA, DIT, END }, /* R */
+ { DI, DI, DIT, END }, /* S */
+ { DAH, END, END, END }, /* T */
+ { DI, DI, DAH, END }, /* U */
{ DI, DI, DI, DAH }, /* V */
{ DI, DI, DI, DAH }, /* V */
- { DI, DA, DAH, end }, /* W */
+ { DI, DA, DAH, END }, /* W */
{ DA, DI, DI, DAH }, /* X */
{ DA, DI, DA, DAH }, /* Y */
{ DA, DA, DI, DIT } /* Z */
{ DA, DI, DI, DAH }, /* X */
{ DA, DI, DA, DAH }, /* Y */
{ DA, DA, DI, DIT } /* Z */
-// make a SimpleSound morse code transmission for the specified string
-SimpleSound *FGMorse::make_ident( const string& id, const int freq ) {
+// make a SGSoundSample morse code transmission for the specified string
+SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
+
// 1. Determine byte length of message
for ( i = 0; i < (int)id.length(); ++i ) {
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
// 1. Determine byte length of message
for ( i = 0; i < (int)id.length(); ++i ) {
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
if ( alphabet[c][j] == DIT ) {
memcpy( buf_ptr, dit_ptr, DIT_SIZE );
buf_ptr += DIT_SIZE;
if ( alphabet[c][j] == DIT ) {
memcpy( buf_ptr, dit_ptr, DIT_SIZE );
buf_ptr += DIT_SIZE;
memcpy( buf_ptr, space, SPACE_SIZE );
buf_ptr += SPACE_SIZE;
} else if ( idptr[i] >= '0' && idptr[i] <= '9' ) {
memcpy( buf_ptr, space, SPACE_SIZE );
buf_ptr += SPACE_SIZE;
} else if ( idptr[i] >= '0' && idptr[i] <= '9' ) {
for ( j = 0; j < 5; ++j ) {
if ( numerals[c][j] == DIT ) {
memcpy( buf_ptr, dit_ptr, DIT_SIZE );
for ( j = 0; j < 5; ++j ) {
if ( numerals[c][j] == DIT ) {
memcpy( buf_ptr, dit_ptr, DIT_SIZE );
- SimpleSound *sample = new SimpleSound( buffer, length );
+ SGSoundSample *sample = new SGSoundSample( &buffer, length,
+ BYTES_PER_SECOND );
+
+ sample->set_reference_dist( 10.0 );
+ sample->set_max_dist( 20.0 );