* Added IsPaused() to wxSoundFileStream

* Play/Pause/Resume should work in wxMMBoard


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guilhem Lavaux
2000-02-15 18:49:25 +00:00
parent bce1406bff
commit 5bee458a0f
6 changed files with 19 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
all: all:
cd lib; make cd lib; make
cd sample; make cd sample; make
cd board; make

View File

@@ -76,6 +76,7 @@ public:
MMBoardTime GetLength(); MMBoardTime GetLength();
bool IsStopped(); bool IsStopped();
bool IsPaused();
wxString GetStringType(); wxString GetStringType();
wxString GetStringInformation(); wxString GetStringInformation();
@@ -157,6 +158,11 @@ bool MMBoardSoundFile::IsStopped()
return m_file_stream->IsStopped(); return m_file_stream->IsStopped();
} }
bool MMBoardSoundFile::IsPaused()
{
return m_file_stream->IsPaused();
}
MMBoardTime MMBoardSoundFile::GetPosition() MMBoardTime MMBoardSoundFile::GetPosition()
{ {
wxUint32 length, seconds; wxUint32 length, seconds;

View File

@@ -56,6 +56,7 @@ class MMBoardFile {
virtual MMBoardTime GetLength() = 0; virtual MMBoardTime GetLength() = 0;
virtual bool IsStopped() = 0; virtual bool IsStopped() = 0;
virtual bool IsPaused() = 0;
virtual wxString GetStringType() = 0; virtual wxString GetStringType() = 0;
virtual wxString GetStringInformation() = 0; virtual wxString GetStringInformation() = 0;

View File

@@ -439,6 +439,15 @@ void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event))
void MMBoardFrame::OnPlay(wxCommandEvent& 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_refreshTimer->Start(1000, FALSE);
m_opened_file->Play(); m_opened_file->Play();

View File

@@ -121,7 +121,7 @@ wxSoundStream& wxSoundStreamPcm::Write(const void *buffer, wxUint32 len)
len2 = (m_16_to_8) ? len / 2 : len; len2 = (m_16_to_8) ? len / 2 : len;
tmp_buf = new char[len2]; 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); m_sndio->Write(tmp_buf, len);
delete[] tmp_buf; delete[] tmp_buf;

View File

@@ -63,6 +63,7 @@ class wxSoundFileStream: public wxSoundStream {
bool Resume(); bool Resume();
bool IsStopped() const { return m_state == wxSOUND_FILE_STOPPED; } bool IsStopped() const { return m_state == wxSOUND_FILE_STOPPED; }
bool IsPaused() const { return m_state == wxSOUND_FILE_PAUSED; }
bool StartProduction(int evt); bool StartProduction(int evt);
bool StopProduction(); bool StopProduction();