number of secords to record from radio hard coded for Win32 as I cant read number...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 26 Nov 2012 20:43:08 +0000 (20:43 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 26 Nov 2012 20:43:08 +0000 (20:43 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1077 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/Makefile.win32
fdmdv2/src/fdmdv2_main.cpp
fdmdv2/src/fdmdv2_main.h

index 7735a056b45fa59fea77c8a92a252b2e5440aedf..6896eb93ef7c82ec8dde4c9f499190e616670eb4 100644 (file)
@@ -41,6 +41,9 @@ freedv: $(OBJS)
 %.o: %.cpp $(HDRS) Makefile.win32
        g++ $(CPP_FLAGS) -c $< -o $@
 
+%.o: %.c $(HDRS) Makefile.win32
+       g++ $(CPP_FLAGS) -c $< -o $@
+
 clean:
        rm -f *.o fdmdv2
 
index e23410960fa84e49fe5f206be396e8cfbc12d2f8..824203971c0158c5f1135e6666b36b4f2245c132 100644 (file)
@@ -923,6 +923,7 @@ void MainFrame::OnPlayFileToMicIn(wxCommandEvent& event)
 }
 
 // extra panel added to file save dialog to set number of seconds to record for
+
 MyExtraRecFilePanel::MyExtraRecFilePanel(wxWindow *parent): wxPanel(parent)
 {
     wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
@@ -982,8 +983,8 @@ void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
         wxString fileName, extension;
         soundFile = openFileDialog.GetPath();
         wxFileName::SplitPath(soundFile, &wxGetApp().m_recFileFromRadioPath, &fileName, &extension);
-        //wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
-        //wxLogDebug("sounfFile: %s", soundFile);
+        wxLogDebug("m_recFileFromRadioPath: %s", wxGetApp().m_recFileFromRadioPath);
+        wxLogDebug("soundFile: %s", soundFile);
         sfInfo.format = 0;
 
         if(!extension.IsEmpty())
@@ -1010,22 +1011,29 @@ void MainFrame::OnRecFileFromRadio(wxCommandEvent& event)
             return;         
         }
 
-
+        // Bug: on Win32 I cant read m_recFileFromRadioSecs, so have hard coded it
+        #ifdef __WIN32__
+        long secs = wxGetApp().m_recFileFromRadioSecs;
+        g_recFromRadioSamples = FS*(unsigned int)secs;
+        #else
         // work out number of samples to record
 
         wxWindow * const ctrl = openFileDialog.GetExtraControl();
         wxString secsString = static_cast<MyExtraRecFilePanel*>(ctrl)->getSecondsToRecord();
+        wxLogDebug("test: %s secsString: %s\n", wxT("testing 123"), secsString);
+
         long secs;
         if (secsString.ToLong(&secs)) {
             wxGetApp().m_recFileFromRadioSecs = (unsigned int)secs;
-            //printf(" secondsToRecord: %d\n",  (unsigned int)secs);
+            printf(" secondsToRecord: %d\n",  (unsigned int)secs);
             g_recFromRadioSamples = FS*(unsigned int)secs;
-            //printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
+            printf("g_recFromRadioSamples: %d\n", g_recFromRadioSamples);
         }
         else {
             wxMessageBox(wxT("Invalid number of Seconds"), wxT("Record File From Radio"), wxOK);
             return;
         }
+        #endif
 
         g_sfRecFile = sf_open(soundFile, SFM_WRITE, &sfInfo);
         if(g_sfRecFile == NULL)
index 96c8e48f3ad95616903a44eeb351832b61b01a87..c9e4099d7e2193435d2600d688cca0abac9e21f4 100644 (file)
@@ -208,8 +208,14 @@ class MyExtraRecFilePanel : public wxPanel
 {
 public:
     MyExtraRecFilePanel(wxWindow *parent);
+    ~MyExtraRecFilePanel() {
+        wxLogDebug("Destructor\n");
+    }
     void setSecondsToRecord(wxString value) { m_secondsToRecord->SetValue(value); }
-    wxString getSecondsToRecord(void) { return m_secondsToRecord->GetValue(); }
+    wxString getSecondsToRecord(void) { 
+        wxLogDebug("getSecondsToRecord: %s\n",m_secondsToRecord->GetValue());
+        return m_secondsToRecord->GetValue(); 
+    }
 private:
     wxTextCtrl *m_secondsToRecord;
 };