// constructor
-FGBeacon::FGBeacon() {
+FGBeacon::FGBeacon() :
+ inner(NULL),
+ middle(NULL),
+ outer(NULL)
+{
}
// destructor
FGBeacon::~FGBeacon() {
+ delete inner;
+ delete middle;
+ delete outer;
}
int len;
unsigned char *ptr;
+ unsigned char inner_buf[ INNER_SIZE ] ;
+ unsigned char middle_buf[ MIDDLE_SIZE ] ;
+ unsigned char outer_buf[ OUTER_SIZE ] ;
+
// Make inner marker beacon sound
len= (int)(INNER_DIT_LEN / 2.0 );
unsigned char inner_dit[INNER_DIT_LEN];
ptr += INNER_DIT_LEN;
}
- inner = new SimpleSound( inner_buf, INNER_SIZE );
+ inner = new SGSoundSample( inner_buf, INNER_SIZE, BYTES_PER_SECOND, false );
+ inner->set_reference_dist( 10.0 );
+ inner->set_max_dist( 20.0 );
// Make middle marker beacon sound
len= (int)(MIDDLE_DIT_LEN / 2.0 );
ptr += MIDDLE_DIT_LEN;
memcpy( ptr, middle_dah, MIDDLE_DAH_LEN );
- middle = new SimpleSound( middle_buf, MIDDLE_SIZE );
+ middle = new SGSoundSample( middle_buf, MIDDLE_SIZE, BYTES_PER_SECOND,
+ false );
+ middle->set_reference_dist( 10.0 );
+ middle->set_max_dist( 20.0 );
// Make outer marker beacon sound
len= (int)(OUTER_DAH_LEN * 3.0 / 4.0 );
ptr += OUTER_DAH_LEN;
memcpy( ptr, outer_dah, OUTER_DAH_LEN );
- outer = new SimpleSound( outer_buf, OUTER_SIZE );
+ outer = new SGSoundSample( outer_buf, OUTER_SIZE, BYTES_PER_SECOND, false );
+ outer->set_reference_dist( 10.0 );
+ outer->set_max_dist( 20.0 );
return true;
}