]> git.mxchange.org Git - flightgear.git/commitdiff
Continued work on morse code generator.
authorcurt <curt>
Mon, 5 Mar 2001 12:09:36 +0000 (12:09 +0000)
committercurt <curt>
Mon, 5 Mar 2001 12:09:36 +0000 (12:09 +0000)
src/Main/morse.cxx
src/Main/morse.hxx
src/Main/soundmgr.cxx
src/Main/soundmgr.hxx

index beff9dbee5bcb610c21b7ae0350a4134b648c4db..f6d1267a827374f752ab280a1bf2597022a0b651 100644 (file)
@@ -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 ) {
+}
index fe287ff3b8b3fe41b96b2209eabc75d49aa6bdb7..9315c8164d6f5c7923c8ed742408f6ee2957122b 100644 (file)
@@ -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 );
 };
 
 
index c4302533d8ccf518bcc8b93751daeca04523e78a..653bdfb5a12075987387409fd89b546a0f94c4b0 100644 (file)
@@ -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;
index 3c3f8f3268f6bf1f1bd475e5bf6022eda68c6138..6b404599e0842fad2600ef67ac27d7e7470b5dae 100644 (file)
@@ -55,6 +55,7 @@ class FGSimpleSound {
 public:
 
     FGSimpleSound( string file );
+    FGSimpleSound( unsigned char *buffer, int len );
     ~FGSimpleSound();
 
     inline double get_pitch() const { return pitch; }