]> git.saurik.com Git - wxWidgets.git/commitdiff
* Added IsPaused() to wxSoundFileStream
authorGuilhem Lavaux <lavaux@easynet.fr>
Tue, 15 Feb 2000 18:49:25 +0000 (18:49 +0000)
committerGuilhem Lavaux <lavaux@easynet.fr>
Tue, 15 Feb 2000 18:49:25 +0000 (18:49 +0000)
* Play/Pause/Resume should work in wxMMBoard

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/wxMMedia2/Makefile.in
utils/wxMMedia2/board/mmbman.cpp
utils/wxMMedia2/board/mmbman.h
utils/wxMMedia2/board/mmboard.cpp
utils/wxMMedia2/lib/sndcpcm.cpp
utils/wxMMedia2/lib/sndfile.h

index e9c58e47e9ce65f285ea089052eee70d34c62667..5bbe72e9395fa7720414888b7f8629b789bb3ed5 100644 (file)
@@ -1,3 +1,4 @@
 all:
        cd lib; make
        cd sample; make
+       cd board; make
index 95d8d67686d0b92aacf2536ca651d44e8649f109..4197de80a515a605acc42e26bb5c4b41096c6f1c 100644 (file)
@@ -76,6 +76,7 @@ public:
   MMBoardTime GetLength();
 
   bool IsStopped();
+  bool IsPaused();
 
   wxString GetStringType();
   wxString GetStringInformation();
@@ -157,6 +158,11 @@ bool MMBoardSoundFile::IsStopped()
   return m_file_stream->IsStopped();
 }
 
+bool MMBoardSoundFile::IsPaused()
+{
+  return m_file_stream->IsPaused();
+}
+
 MMBoardTime MMBoardSoundFile::GetPosition()
 {
   wxUint32 length, seconds;
index 7a31081f72379cca8de94f31eb1b2ab82d6a75da..c8446fab8bd7a2a72752ecb0ed73c363551eefde 100644 (file)
@@ -56,6 +56,7 @@ class MMBoardFile {
   virtual MMBoardTime GetLength() = 0;
 
   virtual bool IsStopped() = 0;
+  virtual bool IsPaused() = 0;
 
   virtual wxString GetStringType() = 0;
   virtual wxString GetStringInformation() = 0;
index c0144f26aa1d35767090183e6f8e553b51da0815..0c55510f1dffae025b9802dbbf02ba011d0a1a3c 100644 (file)
@@ -439,6 +439,15 @@ void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event))
 
 void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
 {
+  m_stopButton->Enable(TRUE);
+  m_pauseButton->Enable(TRUE);
+  m_playButton->Enable(FALSE);
+
+  if (m_opened_file->IsPaused()) {
+    m_opened_file->Resume();
+    return;
+  }
+
   m_refreshTimer->Start(1000, FALSE);
 
   m_opened_file->Play();
index add5ba1772d42fff9b2b29f2b380f88856766540..c81fc890db2e485f6640d373736ddea374492599 100644 (file)
@@ -121,7 +121,7 @@ wxSoundStream& wxSoundStreamPcm::Write(const void *buffer, wxUint32 len)
   len2 = (m_16_to_8) ? len / 2 : len;
 
   tmp_buf = new char[len2];
-  m_function_out((const char *)buffer, tmp_buf, len);
+  m_function_out((const char *)buffer, tmp_buf, len2);
   m_sndio->Write(tmp_buf, len);
   delete[] tmp_buf;
 
index 5499c4106feaf990fabb240e7342e9e6b153cf76..7804f122caf26b2a3cd15806fe4c227bd92b886d 100644 (file)
@@ -63,6 +63,7 @@ class wxSoundFileStream: public wxSoundStream {
   bool Resume();
 
   bool IsStopped() const { return m_state == wxSOUND_FILE_STOPPED; }
+  bool IsPaused() const { return m_state == wxSOUND_FILE_PAUSED; }
 
   bool StartProduction(int evt);
   bool StopProduction();