Continued work on morse code generator.
This commit is contained in:
parent
3abe133162
commit
040185f0fd
4 changed files with 19 additions and 0 deletions
|
@ -111,3 +111,8 @@ bool FGMorse::init() {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// make a FGSimpleSound morse code transmission for the specified string
|
||||
FGSimpleSound FGMorse::make_ident( const string& id ) {
|
||||
}
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <plib/sl.h>
|
||||
#include <plib/sm.h>
|
||||
|
||||
#include "soundmgr.hxx"
|
||||
|
||||
|
||||
// Quoting from http://www.kluft.com/~ikluft/ham/morse-intro.html by
|
||||
// Ian Kluft KO6YQ <ikluft@kluft.com>
|
||||
|
@ -139,6 +141,9 @@ public:
|
|||
|
||||
// allocate and initialize sound samples
|
||||
bool init();
|
||||
|
||||
// make a FGSimpleSound morse code transmission for the specified string
|
||||
FGSimpleSound make_ident( const string& id );
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -41,6 +41,14 @@ FGSimpleSound::FGSimpleSound( string file ) {
|
|||
volume_envelope->setStep ( 0, 0.01, 1.0 );
|
||||
}
|
||||
|
||||
FGSimpleSound::FGSimpleSound( unsigned char *buffer, int len ) {
|
||||
sample = new slSample ( buffer, len );
|
||||
pitch_envelope = new slEnvelope( 1, SL_SAMPLE_ONE_SHOT );
|
||||
volume_envelope = new slEnvelope( 1, SL_SAMPLE_ONE_SHOT );
|
||||
pitch_envelope->setStep ( 0, 0.01, 1.0 );
|
||||
volume_envelope->setStep ( 0, 0.01, 1.0 );
|
||||
}
|
||||
|
||||
// destructor
|
||||
FGSimpleSound::~FGSimpleSound() {
|
||||
delete pitch_envelope;
|
||||
|
|
|
@ -55,6 +55,7 @@ class FGSimpleSound {
|
|||
public:
|
||||
|
||||
FGSimpleSound( string file );
|
||||
FGSimpleSound( unsigned char *buffer, int len );
|
||||
~FGSimpleSound();
|
||||
|
||||
inline double get_pitch() const { return pitch; }
|
||||
|
|
Loading…
Add table
Reference in a new issue