From 040185f0fd79d09c010ec3c583a5b066d02fa728 Mon Sep 17 00:00:00 2001
From: curt <curt>
Date: Mon, 5 Mar 2001 12:09:36 +0000
Subject: [PATCH] Continued work on morse code generator.

---
 src/Main/morse.cxx    | 5 +++++
 src/Main/morse.hxx    | 5 +++++
 src/Main/soundmgr.cxx | 8 ++++++++
 src/Main/soundmgr.hxx | 1 +
 4 files changed, 19 insertions(+)

diff --git a/src/Main/morse.cxx b/src/Main/morse.cxx
index beff9dbee..f6d1267a8 100644
--- a/src/Main/morse.cxx
+++ b/src/Main/morse.cxx
@@ -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 ) {
+}
diff --git a/src/Main/morse.hxx b/src/Main/morse.hxx
index fe287ff3b..9315c8164 100644
--- a/src/Main/morse.hxx
+++ b/src/Main/morse.hxx
@@ -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 );
 };
 
 
diff --git a/src/Main/soundmgr.cxx b/src/Main/soundmgr.cxx
index c4302533d..653bdfb5a 100644
--- a/src/Main/soundmgr.cxx
+++ b/src/Main/soundmgr.cxx
@@ -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;
diff --git a/src/Main/soundmgr.hxx b/src/Main/soundmgr.hxx
index 3c3f8f326..6b404599e 100644
--- a/src/Main/soundmgr.hxx
+++ b/src/Main/soundmgr.hxx
@@ -55,6 +55,7 @@ class FGSimpleSound {
 public:
 
     FGSimpleSound( string file );
+    FGSimpleSound( unsigned char *buffer, int len );
     ~FGSimpleSound();
 
     inline double get_pitch() const { return pitch; }