-1, TRUE/true, FALSE/false and tabs replacements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -125,7 +125,7 @@ class WXDLLIMPEXP_MMEDIA wxSoundStream {
|
||||
// Returns the best size for IO calls
|
||||
virtual wxUint32 GetBestSize() const { return 1024; }
|
||||
|
||||
// SetSoundFormat returns TRUE when the format can be handled.
|
||||
// SetSoundFormat returns true when the format can be handled.
|
||||
virtual bool SetSoundFormat(const wxSoundFormatBase& format);
|
||||
|
||||
// GetSoundFormat returns the current sound format.
|
||||
@@ -146,7 +146,7 @@ class WXDLLIMPEXP_MMEDIA wxSoundStream {
|
||||
wxUint32 GetLastAccess() const { return m_lastcount; }
|
||||
|
||||
// This is only useful for device (I think).
|
||||
virtual bool QueueFilled() const { return TRUE; }
|
||||
virtual bool QueueFilled() const { return true; }
|
||||
|
||||
protected:
|
||||
// Current sound format
|
||||
|
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
// You should use this function to test whether this file codec can read
|
||||
// the stream you passed to it.
|
||||
virtual bool CanRead() { return FALSE; }
|
||||
virtual bool CanRead() { return false; }
|
||||
|
||||
protected:
|
||||
wxSoundRouterStream m_codec;
|
||||
|
@@ -23,7 +23,7 @@
|
||||
class wxSoundFormatPcm : public wxSoundFormatBase {
|
||||
public:
|
||||
wxSoundFormatPcm(wxUint32 srate = 22500, wxUint8 bps = 8,
|
||||
wxUint16 channels = 2, bool sign = TRUE,
|
||||
wxUint16 channels = 2, bool sign = true,
|
||||
int order = wxLITTLE_ENDIAN);
|
||||
~wxSoundFormatPcm();
|
||||
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
// Dtor
|
||||
virtual ~wxVideoBaseDriver();
|
||||
|
||||
// Usual functions ... They all return FALSE in case of errors.
|
||||
// Usual functions ... They all return false in case of errors.
|
||||
virtual bool Play() = 0;
|
||||
virtual bool Stop() = 0;
|
||||
virtual bool Pause() = 0;
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
virtual bool GetSize(wxSize& size) const = 0;
|
||||
|
||||
// Test the capability of the driver to handle the specified type
|
||||
virtual bool IsCapable(wxVideoType WXUNUSED(v_type)) const { return FALSE; }
|
||||
virtual bool IsCapable(wxVideoType WXUNUSED(v_type)) const { return false; }
|
||||
|
||||
// Return the video codec name
|
||||
virtual wxString GetMovieCodec() const = 0;
|
||||
|
@@ -245,7 +245,7 @@ void MMBoardSoundFile::SetPosition(MMBoardTime btime)
|
||||
|
||||
bool MMBoardSoundFile::NeedWindow()
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void MMBoardSoundFile::SetWindow(wxWindow *WXUNUSED(window))
|
||||
@@ -375,7 +375,7 @@ MMBoardVideoFile::~MMBoardVideoFile()
|
||||
|
||||
bool MMBoardVideoFile::NeedWindow()
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void MMBoardVideoFile::SetWindow(wxWindow *window)
|
||||
|
@@ -284,7 +284,7 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
|
||||
|
||||
// Initialize main slider
|
||||
m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60,
|
||||
wxDefaultPosition, wxSize(300, -1),
|
||||
wxDefaultPosition, wxSize(300, wxDefaultSize.y),
|
||||
wxSL_HORIZONTAL | wxSL_AUTOTICKS);
|
||||
m_positionSlider->SetPageSize(60); // 60 secs
|
||||
m_positionSlider->Disable();
|
||||
|
@@ -46,7 +46,7 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCDAudioWin, wxCDAudio)
|
||||
|
||||
wxCDAudioWin::wxCDAudioWin(void)
|
||||
: wxCDAudio(), m_trksize(NULL), m_trkpos(NULL), m_toc(NULL), m_ok(TRUE)
|
||||
: wxCDAudio(), m_trksize(NULL), m_trkpos(NULL), m_toc(NULL), m_ok(true)
|
||||
{
|
||||
MCI_OPEN_PARMS open_struct;
|
||||
MCI_SET_PARMS set_struct;
|
||||
@@ -56,7 +56,7 @@ wxCDAudioWin::wxCDAudioWin(void)
|
||||
DWORD ret = mciSendCommand((MCIDEVICEID)NULL, MCI_OPEN, MCI_OPEN_TYPE,
|
||||
(DWORD)&open_struct);
|
||||
if (ret) {
|
||||
m_ok = FALSE;
|
||||
m_ok = false;
|
||||
return;
|
||||
}
|
||||
m_internal->dev_id = open_struct.wDeviceID;
|
||||
@@ -150,7 +150,7 @@ bool wxCDAudioWin::Play(const wxCDtime& beg_time, const wxCDtime& end_time)
|
||||
MCI_PLAY_PARMS play_struct;
|
||||
|
||||
if (!m_ok)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
tmsf = MCI_MAKE_TMSF(beg_time.track, beg_time.min,
|
||||
beg_time.sec, 0);
|
||||
@@ -160,13 +160,13 @@ bool wxCDAudioWin::Play(const wxCDtime& beg_time, const wxCDtime& end_time)
|
||||
play_struct.dwTo = tmsf;
|
||||
|
||||
mciSendCommand(m_internal->dev_id, MCI_PLAY, 0, (DWORD)&play_struct);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxCDAudioWin::Pause(void)
|
||||
{
|
||||
if (!m_ok)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return (mciSendCommand(m_internal->dev_id, MCI_PAUSE, 0, 0) == 0);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ bool wxCDAudioWin::Pause(void)
|
||||
bool wxCDAudioWin::Resume(void)
|
||||
{
|
||||
if (!m_ok)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return (mciSendCommand(m_internal->dev_id, MCI_RESUME, 0, 0) == 0);
|
||||
}
|
||||
|
@@ -63,25 +63,25 @@ bool wxSoundAiff::CanRead()
|
||||
wxUint32 signature1, signature2, len;
|
||||
|
||||
if (m_input->Read(&signature1, 4).LastRead() != 4)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (wxUINT32_SWAP_ON_BE(signature1) != FORM_SIGNATURE) {
|
||||
m_input->Ungetch(&signature1, 4);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_input->Read(&len, 4);
|
||||
if (m_input->LastRead() != 4) {
|
||||
m_input->Ungetch(&len, m_input->LastRead());
|
||||
m_input->Ungetch(&signature1, 4);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_input->Read(&signature2, 4).LastRead() != 4) {
|
||||
m_input->Ungetch(&signature2, m_input->LastRead());
|
||||
m_input->Ungetch(&len, 4);
|
||||
m_input->Ungetch(&signature1, 4);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_input->Ungetch(&signature2, 4);
|
||||
@@ -91,12 +91,12 @@ bool wxSoundAiff::CanRead()
|
||||
if (
|
||||
wxUINT32_SWAP_ON_BE(signature2) != AIFF_SIGNATURE &&
|
||||
wxUINT32_SWAP_ON_BE(signature2) != AIFC_SIGNATURE)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return FALSE; }
|
||||
#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return false; }
|
||||
|
||||
bool wxSoundAiff::PrepareToPlay()
|
||||
{
|
||||
@@ -106,11 +106,11 @@ bool wxSoundAiff::PrepareToPlay()
|
||||
|
||||
if (!m_input) {
|
||||
m_snderror = wxSOUND_INVSTRM;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
|
||||
data.BigEndianOrdered(TRUE);
|
||||
data.BigEndianOrdered(true);
|
||||
|
||||
FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM);
|
||||
FAIL_WITH(wxUINT32_SWAP_ON_BE(signature) != FORM_SIGNATURE, wxSOUND_INVSTRM);
|
||||
@@ -127,7 +127,7 @@ bool wxSoundAiff::PrepareToPlay()
|
||||
wxUINT32_SWAP_ON_BE(signature) != AIFC_SIGNATURE, wxSOUND_INVSTRM);
|
||||
// "AIFF" / "AIFC"
|
||||
|
||||
end_headers = FALSE;
|
||||
end_headers = false;
|
||||
while (!end_headers) {
|
||||
FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM);
|
||||
|
||||
@@ -148,11 +148,11 @@ bool wxSoundAiff::PrepareToPlay()
|
||||
sndformat.SetSampleRate((wxUint32) srate);
|
||||
sndformat.SetBPS(bps);
|
||||
sndformat.SetChannels(channels);
|
||||
sndformat.Signed(FALSE);
|
||||
sndformat.Signed(false);
|
||||
sndformat.SetOrder(wxBIG_ENDIAN);
|
||||
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
return false;
|
||||
// We pass all data left
|
||||
m_input->SeekI(len-18, wxFromCurrent);
|
||||
break;
|
||||
@@ -165,7 +165,7 @@ bool wxSoundAiff::PrepareToPlay()
|
||||
m_base_offset = m_input->TellI();
|
||||
// len-8 bytes of samples
|
||||
FinishPreparation(len - 8);
|
||||
end_headers = TRUE;
|
||||
end_headers = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -173,28 +173,28 @@ bool wxSoundAiff::PrepareToPlay()
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundAiff::PrepareToRecord(wxUint32 WXUNUSED(time))
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSoundAiff::FinishRecording()
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSoundAiff::RepositionStream(wxUint32 WXUNUSED(position))
|
||||
{
|
||||
// If the stream is not seekable "TellI() returns wxInvalidOffset" we cannot reposition stream
|
||||
if (m_base_offset == wxInvalidOffset)
|
||||
return FALSE;
|
||||
return false;
|
||||
m_input->SeekI(m_base_offset, wxFromStart);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxUint32 wxSoundAiff::GetData(void *buffer, wxUint32 len)
|
||||
|
@@ -72,7 +72,7 @@ wxSoundStream::~wxSoundStream()
|
||||
// important function of the wxSoundStream class. It prepares the stream to
|
||||
// receive or send the data in a strict format. Normally, the sound stream
|
||||
// should be ready to accept any format it is asked to manage but in certain
|
||||
// cases, it really cannot: in that case it returns FALSE. To have more
|
||||
// cases, it really cannot: in that case it returns false. To have more
|
||||
// details in the functionnalities of SetSoundFormat see
|
||||
// wxSoundRouterStream::SetSoundFormat()
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -84,7 +84,7 @@ bool wxSoundStream::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
|
||||
// create a new one by cloning the format passed in parameter
|
||||
m_sndformat = format.Clone();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -279,11 +279,11 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
if (m_sndio->SetSoundFormat(format)) {
|
||||
m_function_out = NULL;
|
||||
m_function_in = NULL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (format.GetType() != wxSOUND_PCM) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (m_sndformat)
|
||||
delete m_sndformat;
|
||||
@@ -300,11 +300,11 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
|
||||
src_rate = pcm_format->GetSampleRate();
|
||||
dst_rate = pcm_format2->GetSampleRate();
|
||||
m_needResampling = TRUE;
|
||||
m_needResampling = true;
|
||||
if (src_rate < dst_rate)
|
||||
m_expandSamples = TRUE;
|
||||
m_expandSamples = true;
|
||||
else
|
||||
m_expandSamples = FALSE;
|
||||
m_expandSamples = false;
|
||||
m_pitch = (src_rate << FLOATBITS) / dst_rate;
|
||||
}
|
||||
#endif
|
||||
@@ -327,7 +327,7 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
break;
|
||||
default:
|
||||
// TODO: Add something here: error, log, ...
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
switch (pcm_format2->GetBPS()) {
|
||||
case 8:
|
||||
@@ -338,7 +338,7 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
break;
|
||||
default:
|
||||
// TODO: Add something here: error, log, ...
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pcm_format2->Signed() != pcm_format->Signed())
|
||||
@@ -399,7 +399,7 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
wxUnusedVar( SetSoundFormatReturn );
|
||||
|
||||
m_sndformat = new_format;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxUint32 wxSoundStreamPcm::GetWriteSize(wxUint32 len) const
|
||||
|
@@ -62,7 +62,7 @@ wxSoundStreamESD::wxSoundStreamESD(const wxString& hostname)
|
||||
wxSoundFormatPcm pcm_default;
|
||||
|
||||
// First, we make some basic test: is there ESD on this computer ?
|
||||
m_esd_ok = FALSE;
|
||||
m_esd_ok = false;
|
||||
|
||||
if (hostname.IsNull())
|
||||
m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050,
|
||||
@@ -86,9 +86,9 @@ wxSoundStreamESD::wxSoundStreamESD(const wxString& hostname)
|
||||
|
||||
// Initialize some variable
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
m_esd_stop = TRUE;
|
||||
m_q_filled = TRUE;
|
||||
m_esd_ok = TRUE;
|
||||
m_esd_stop = true;
|
||||
m_q_filled = true;
|
||||
m_esd_ok = true;
|
||||
m_fd_output= -1;
|
||||
m_fd_input = -1;
|
||||
#endif // defined HAVE_ESD_H
|
||||
@@ -154,7 +154,7 @@ wxSoundStream& wxSoundStreamESD::Write(const void *buffer, wxUint32 len)
|
||||
else
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
|
||||
m_q_filled = TRUE;
|
||||
m_q_filled = true;
|
||||
|
||||
return *this;
|
||||
#endif // defined HAVE_ESD_H
|
||||
@@ -168,18 +168,18 @@ bool wxSoundStreamESD::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
#ifndef HAVE_ESD_H
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
#else
|
||||
wxSoundFormatPcm *pcm_format;
|
||||
|
||||
if (format.GetType() != wxSOUND_PCM) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_esd_ok) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_sndformat)
|
||||
@@ -188,7 +188,7 @@ bool wxSoundStreamESD::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_sndformat = format.Clone();
|
||||
if (!m_sndformat) {
|
||||
m_snderror = wxSOUND_MEMERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
pcm_format = (wxSoundFormatPcm *)m_sndformat;
|
||||
|
||||
@@ -198,9 +198,9 @@ bool wxSoundStreamESD::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
if (*pcm_format != format) {
|
||||
m_snderror = wxSOUND_NOEXACT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
#endif // defined HAVE_ESD_H
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ static void _wxSound_OSS_CBack(gpointer data, int source,
|
||||
// --------------------------------------------------------------------------
|
||||
void wxSoundStreamESD::WakeUpEvt(int evt)
|
||||
{
|
||||
m_q_filled = FALSE;
|
||||
m_q_filled = false;
|
||||
OnSoundEvent(evt);
|
||||
}
|
||||
|
||||
@@ -245,14 +245,14 @@ bool wxSoundStreamESD::StartProduction(int evt)
|
||||
{
|
||||
#ifndef HAVE_ESD_H
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
#else
|
||||
wxSoundFormatPcm *pcm;
|
||||
int flag = 0;
|
||||
|
||||
if (!m_esd_ok) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_esd_stop)
|
||||
@@ -286,10 +286,10 @@ bool wxSoundStreamESD::StartProduction(int evt)
|
||||
}
|
||||
#endif
|
||||
|
||||
m_esd_stop = FALSE;
|
||||
m_q_filled = FALSE;
|
||||
m_esd_stop = false;
|
||||
m_q_filled = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
#endif // defined HAVE_ESD_H
|
||||
}
|
||||
|
||||
@@ -300,10 +300,10 @@ bool wxSoundStreamESD::StopProduction()
|
||||
{
|
||||
#ifndef HAVE_ESD_H
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
#else
|
||||
if (m_esd_stop)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (m_fd_input != -1) {
|
||||
esd_close(m_fd_input);
|
||||
@@ -320,9 +320,9 @@ bool wxSoundStreamESD::StopProduction()
|
||||
|
||||
m_fd_input = -1;
|
||||
m_fd_output= -1;
|
||||
m_esd_stop = TRUE;
|
||||
m_q_filled = TRUE;
|
||||
return TRUE;
|
||||
m_esd_stop = true;
|
||||
m_q_filled = true;
|
||||
return true;
|
||||
#endif // defined HAVE_ESD_H
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ void wxSoundStreamESD::DetectBest(wxSoundFormatPcm *pcm)
|
||||
best_pcm.SetBPS(8);
|
||||
|
||||
best_pcm.SetOrder(wxLITTLE_ENDIAN);
|
||||
best_pcm.Signed(TRUE);
|
||||
best_pcm.Signed(true);
|
||||
|
||||
// Finally recopy the new format
|
||||
*pcm = best_pcm;
|
||||
|
@@ -78,7 +78,7 @@ wxSoundStream& wxSoundRouterStream::Write(const void *buffer, wxUint32 len)
|
||||
// sound driver using the specified format. If this fails, it uses personnal
|
||||
// codec converters: for the moment there is a PCM converter (PCM to PCM:
|
||||
// with optional resampling, ...), an ULAW converter (ULAW to PCM), a G72X
|
||||
// converter (G72X to PCM). If nothing works, it returns FALSE.
|
||||
// converter (G72X to PCM). If nothing works, it returns false.
|
||||
// --------------------------------------------------------------------------
|
||||
bool wxSoundRouterStream::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
@@ -89,12 +89,12 @@ bool wxSoundRouterStream::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
if (m_sndio->SetSoundFormat(format)) {
|
||||
// We are lucky, it is working.
|
||||
wxSoundStream::SetSoundFormat(m_sndio->GetSoundFormat());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch(format.GetType()) {
|
||||
case wxSOUND_NOFORMAT:
|
||||
return FALSE;
|
||||
return false;
|
||||
case wxSOUND_PCM:
|
||||
m_router = new wxSoundStreamPcm(*m_sndio);
|
||||
m_router->SetSoundFormat(format);
|
||||
@@ -112,11 +112,11 @@ bool wxSoundRouterStream::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_router->SetSoundFormat(format);
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
}
|
||||
wxSoundStream::SetSoundFormat(m_router->GetSoundFormat());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -139,19 +139,19 @@ bool wxSoundRouterStream::StartProduction(int evt)
|
||||
{
|
||||
if (!m_router) {
|
||||
if (m_sndio->StartProduction(evt))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
m_snderror = m_sndio->GetError();
|
||||
m_lastcount = m_sndio->GetLastAccess();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_router->StartProduction(evt))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
m_snderror = m_router->GetError();
|
||||
m_lastcount = m_router->GetLastAccess();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -161,19 +161,19 @@ bool wxSoundRouterStream::StopProduction()
|
||||
{
|
||||
if (!m_router) {
|
||||
if (m_sndio->StopProduction())
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
m_snderror = m_sndio->GetError();
|
||||
m_lastcount = m_sndio->GetLastAccess();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_router->StopProduction())
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
m_snderror = m_router->GetError();
|
||||
m_lastcount = m_router->GetLastAccess();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -187,7 +187,7 @@ wxSoundFileStream::wxSoundFileStream(wxInputStream& stream,
|
||||
{
|
||||
m_length = 0;
|
||||
m_bytes_left = 0;
|
||||
m_prepared = FALSE;
|
||||
m_prepared = false;
|
||||
}
|
||||
|
||||
wxSoundFileStream::wxSoundFileStream(wxOutputStream& stream,
|
||||
@@ -197,7 +197,7 @@ wxSoundFileStream::wxSoundFileStream(wxOutputStream& stream,
|
||||
{
|
||||
m_length = 0;
|
||||
m_bytes_left = 0;
|
||||
m_prepared = FALSE;
|
||||
m_prepared = false;
|
||||
}
|
||||
|
||||
wxSoundFileStream::~wxSoundFileStream()
|
||||
@@ -209,51 +209,51 @@ wxSoundFileStream::~wxSoundFileStream()
|
||||
bool wxSoundFileStream::Play()
|
||||
{
|
||||
if (m_state != wxSOUND_FILE_STOPPED)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!m_prepared)
|
||||
if (!PrepareToPlay())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_state = wxSOUND_FILE_PLAYING;
|
||||
|
||||
if (!StartProduction(wxSOUND_OUTPUT))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundFileStream::Record(wxUint32 time)
|
||||
{
|
||||
if (m_state != wxSOUND_FILE_STOPPED)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!PrepareToRecord(time))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
FinishPreparation(m_sndformat->GetBytesFromTime(time));
|
||||
|
||||
m_state = wxSOUND_FILE_RECORDING;
|
||||
if (!StartProduction(wxSOUND_INPUT))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundFileStream::Stop()
|
||||
{
|
||||
if (m_state == wxSOUND_FILE_STOPPED)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!StopProduction())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_prepared = FALSE;
|
||||
m_prepared = false;
|
||||
|
||||
if (m_state == wxSOUND_FILE_RECORDING)
|
||||
if (!FinishRecording()) {
|
||||
m_state = wxSOUND_FILE_STOPPED;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_input)
|
||||
@@ -263,35 +263,35 @@ bool wxSoundFileStream::Stop()
|
||||
m_output->SeekO(0, wxFromStart);
|
||||
|
||||
m_state = wxSOUND_FILE_STOPPED;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundFileStream::Pause()
|
||||
{
|
||||
if (m_state == wxSOUND_FILE_PAUSED || m_state == wxSOUND_FILE_STOPPED)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!StopProduction())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_oldstate = m_state;
|
||||
m_state = wxSOUND_FILE_PAUSED;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundFileStream::Resume()
|
||||
{
|
||||
if (m_state == wxSOUND_FILE_PLAYING || m_state == wxSOUND_FILE_RECORDING ||
|
||||
m_state == wxSOUND_FILE_STOPPED)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!StartProduction( (m_oldstate == wxSOUND_FILE_PLAYING) ?
|
||||
wxSOUND_OUTPUT : wxSOUND_INPUT))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_state = m_oldstate;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSoundStream& wxSoundFileStream::Read(void *buffer, wxUint32 len)
|
||||
@@ -321,9 +321,9 @@ bool wxSoundFileStream::StartProduction(int evt)
|
||||
m_sndio->SetEventHandler(this);
|
||||
|
||||
if (!m_codec.StartProduction(evt))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundFileStream::StopProduction()
|
||||
@@ -334,7 +334,7 @@ bool wxSoundFileStream::StopProduction()
|
||||
void wxSoundFileStream::FinishPreparation(wxUint32 len)
|
||||
{
|
||||
m_bytes_left = m_length = len;
|
||||
m_prepared = TRUE;
|
||||
m_prepared = true;
|
||||
}
|
||||
|
||||
wxString wxSoundFileStream::GetCodecName() const
|
||||
|
@@ -104,7 +104,7 @@ bool wxSoundFormatG72X::operator !=(const wxSoundFormatBase& frmt2) const
|
||||
wxSoundFormatG72X *g72x = (wxSoundFormatG72X *)&frmt2;
|
||||
|
||||
if (frmt2.GetType() != wxSOUND_G72X)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return (g72x->m_srate != m_srate || g72x->m_g72x_type != m_g72x_type);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ bool wxSoundStreamG72X::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
if (format.GetType() != wxSOUND_G72X) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSoundFormatPcm pcm;
|
||||
@@ -210,7 +210,7 @@ bool wxSoundStreamG72X::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
pcm.SetSampleRate(g72x->GetSampleRate());
|
||||
pcm.SetBPS(16);
|
||||
pcm.SetChannels(1); // Only mono supported
|
||||
pcm.Signed(TRUE);
|
||||
pcm.Signed(true);
|
||||
pcm.SetOrder(wxBYTE_ORDER);
|
||||
|
||||
// Look for the correct codec to use and set its bit width
|
||||
@@ -235,7 +235,7 @@ bool wxSoundStreamG72X::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
// Let the router finish the work
|
||||
m_router->SetSoundFormat(pcm);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#define BYTE_SIZE 8
|
||||
|
@@ -130,7 +130,7 @@ bool wxSoundFormatMSAdpcm::operator !=(const wxSoundFormatBase& frmt2) const
|
||||
const wxSoundFormatMSAdpcm *adpcm = (const wxSoundFormatMSAdpcm *)&frmt2;
|
||||
|
||||
if (frmt2.GetType() != wxSOUND_MSADPCM)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return (adpcm->m_srate != m_srate) && (adpcm->m_nchannels != m_nchannels);
|
||||
}
|
||||
@@ -143,8 +143,8 @@ wxSoundStreamMSAdpcm::wxSoundStreamMSAdpcm(wxSoundStream& sndio)
|
||||
{
|
||||
// PCM converter
|
||||
m_router = new wxSoundRouterStream(sndio);
|
||||
m_got_header = FALSE;
|
||||
m_stereo = FALSE;
|
||||
m_got_header = false;
|
||||
m_stereo = false;
|
||||
}
|
||||
|
||||
wxSoundStreamMSAdpcm::~wxSoundStreamMSAdpcm()
|
||||
@@ -354,7 +354,7 @@ bool wxSoundStreamMSAdpcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
if (format.GetType() != wxSOUND_MSADPCM) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSoundFormatPcm pcm;
|
||||
@@ -369,13 +369,13 @@ bool wxSoundStreamMSAdpcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
|
||||
if (!ncoefs) {
|
||||
wxLogError(wxT("Number of ADPCM coefficients must be non null"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
pcm.SetSampleRate(adpcm->GetSampleRate());
|
||||
pcm.SetBPS(16);
|
||||
pcm.SetChannels(adpcm->GetChannels());
|
||||
pcm.Signed(TRUE);
|
||||
pcm.Signed(true);
|
||||
pcm.SetOrder(wxBYTE_ORDER);
|
||||
|
||||
m_stereo = (adpcm->GetChannels() == 2);
|
||||
@@ -384,6 +384,6 @@ bool wxSoundStreamMSAdpcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
|
||||
m_router->SetSoundFormat(pcm);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@ wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name)
|
||||
m_fd = open(dev_name.mb_str(), O_WRONLY);
|
||||
if (m_fd == -1) {
|
||||
// OSS not found
|
||||
m_oss_ok = FALSE;
|
||||
m_oss_ok = false;
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return;
|
||||
}
|
||||
@@ -59,9 +59,9 @@ wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name)
|
||||
// Close OSS
|
||||
close(m_fd);
|
||||
|
||||
m_oss_ok = TRUE;
|
||||
m_oss_stop = TRUE;
|
||||
m_q_filled = TRUE;
|
||||
m_oss_ok = true;
|
||||
m_oss_stop = true;
|
||||
m_q_filled = true;
|
||||
}
|
||||
|
||||
wxSoundStreamOSS::~wxSoundStreamOSS()
|
||||
@@ -86,7 +86,7 @@ wxSoundStream& wxSoundStreamOSS::Read(void *buffer, wxUint32 len)
|
||||
}
|
||||
|
||||
m_lastcount = (wxUint32)ret = read(m_fd, buffer, len);
|
||||
m_q_filled = TRUE;
|
||||
m_q_filled = true;
|
||||
|
||||
if (ret < 0)
|
||||
m_snderror = wxSOUND_IOERROR;
|
||||
@@ -107,7 +107,7 @@ wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, wxUint32 len)
|
||||
}
|
||||
|
||||
ret = write(m_fd, buffer, len);
|
||||
m_q_filled = TRUE;
|
||||
m_q_filled = true;
|
||||
|
||||
if (ret < 0) {
|
||||
m_lastcount = 0;
|
||||
@@ -127,12 +127,12 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
|
||||
if (format.GetType() != wxSOUND_PCM) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_oss_ok) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_sndformat)
|
||||
@@ -141,7 +141,7 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_sndformat = format.Clone();
|
||||
if (!m_sndformat) {
|
||||
m_snderror = wxSOUND_MEMERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
pcm_format = (wxSoundFormatPcm *)m_sndformat;
|
||||
|
||||
@@ -150,7 +150,7 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_fd = open(m_devname.mb_str(), O_WRONLY);
|
||||
if (m_fd == -1) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,10 +176,10 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
if (*pcm_format != format) {
|
||||
m_snderror = wxSOUND_NOEXACT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format)
|
||||
@@ -217,34 +217,34 @@ bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format)
|
||||
switch (tmp) {
|
||||
case AFMT_U8:
|
||||
pcm_format->SetBPS(8);
|
||||
pcm_format->Signed(FALSE);
|
||||
pcm_format->Signed(false);
|
||||
break;
|
||||
case AFMT_S8:
|
||||
pcm_format->SetBPS(8);
|
||||
pcm_format->Signed(TRUE);
|
||||
pcm_format->Signed(true);
|
||||
break;
|
||||
case AFMT_U16_LE:
|
||||
pcm_format->SetBPS(16);
|
||||
pcm_format->Signed(FALSE);
|
||||
pcm_format->Signed(false);
|
||||
pcm_format->SetOrder(wxLITTLE_ENDIAN);
|
||||
break;
|
||||
case AFMT_U16_BE:
|
||||
pcm_format->SetBPS(16);
|
||||
pcm_format->Signed(FALSE);
|
||||
pcm_format->Signed(false);
|
||||
pcm_format->SetOrder(wxBIG_ENDIAN);
|
||||
break;
|
||||
case AFMT_S16_LE:
|
||||
pcm_format->SetBPS(16);
|
||||
pcm_format->Signed(TRUE);
|
||||
pcm_format->Signed(true);
|
||||
pcm_format->SetOrder(wxLITTLE_ENDIAN);
|
||||
break;
|
||||
case AFMT_S16_BE:
|
||||
pcm_format->SetBPS(16);
|
||||
pcm_format->Signed(TRUE);
|
||||
pcm_format->Signed(true);
|
||||
pcm_format->SetOrder(wxBIG_ENDIAN);
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __WXGTK__
|
||||
@@ -268,7 +268,7 @@ static void _wxSound_OSS_CBack(gpointer data, int source,
|
||||
|
||||
void wxSoundStreamOSS::WakeUpEvt(int evt)
|
||||
{
|
||||
m_q_filled = FALSE;
|
||||
m_q_filled = false;
|
||||
OnSoundEvent(evt);
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ bool wxSoundStreamOSS::StartProduction(int evt)
|
||||
old_frmt = m_sndformat->Clone();
|
||||
if (!old_frmt) {
|
||||
m_snderror = wxSOUND_MEMERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (evt == wxSOUND_OUTPUT)
|
||||
@@ -292,7 +292,7 @@ bool wxSoundStreamOSS::StartProduction(int evt)
|
||||
|
||||
if (m_fd == -1) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
SetSoundFormat(*old_frmt);
|
||||
@@ -314,25 +314,25 @@ bool wxSoundStreamOSS::StartProduction(int evt)
|
||||
|
||||
ioctl(m_fd, SNDCTL_DSP_SETTRIGGER, &trig);
|
||||
|
||||
m_oss_stop = FALSE;
|
||||
m_q_filled = FALSE;
|
||||
m_oss_stop = false;
|
||||
m_q_filled = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundStreamOSS::StopProduction()
|
||||
{
|
||||
if (m_oss_stop)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifdef __WXGTK__
|
||||
gdk_input_remove(m_tag);
|
||||
#endif
|
||||
|
||||
close(m_fd);
|
||||
m_oss_stop = TRUE;
|
||||
m_q_filled = TRUE;
|
||||
return TRUE;
|
||||
m_oss_stop = true;
|
||||
m_q_filled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundStreamOSS::QueueFilled() const
|
||||
@@ -375,12 +375,12 @@ void wxSoundStreamOSS::DetectBest(wxSoundFormatPcm *pcm)
|
||||
// It supports signed samples
|
||||
if (pcm->Signed() &&
|
||||
((fmt_mask & (AFMT_S16_LE | AFMT_S16_BE | AFMT_S8)) != 0))
|
||||
best_pcm.Signed(TRUE);
|
||||
best_pcm.Signed(true);
|
||||
|
||||
// It supports unsigned samples
|
||||
if (!pcm->Signed() &&
|
||||
((fmt_mask & (AFMT_U16_LE | AFMT_U16_BE | AFMT_U8)) != 0))
|
||||
best_pcm.Signed(FALSE);
|
||||
best_pcm.Signed(false);
|
||||
|
||||
// Finally recopy the new format
|
||||
*pcm = best_pcm;
|
||||
|
@@ -88,7 +88,7 @@ bool wxSoundFormatPcm::operator!=(const wxSoundFormatBase& format) const
|
||||
wxSoundFormatPcm *format2 = (wxSoundFormatPcm *)&format;
|
||||
|
||||
if (format.GetType() != wxSOUND_PCM)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return ( (m_srate != format2->m_srate) ||
|
||||
(m_bps != format2->m_bps) ||
|
||||
|
@@ -82,7 +82,7 @@ bool wxSoundFormatUlaw::operator !=(const wxSoundFormatBase& frmt2) const
|
||||
wxSoundFormatUlaw *ulaw = (wxSoundFormatUlaw *)&frmt2;
|
||||
|
||||
if (frmt2.GetType() != wxSOUND_ULAW)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return (ulaw->m_srate != m_srate);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ bool wxSoundStreamUlaw::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
if (format.GetType() != wxSOUND_ULAW) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// As the codec only support 16 bits, Mono we must use a wxSoundRouter
|
||||
@@ -177,10 +177,10 @@ bool wxSoundStreamUlaw::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
pcm.SetSampleRate(ulaw->GetSampleRate());
|
||||
pcm.SetBPS(16);
|
||||
pcm.SetChannels(ulaw->GetChannels());
|
||||
pcm.Signed(TRUE);
|
||||
pcm.Signed(true);
|
||||
pcm.SetOrder(wxBYTE_ORDER);
|
||||
|
||||
m_router->SetSoundFormat(pcm);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ wxString wxSoundWave::GetCodecName() const
|
||||
return wxString(wxT("wxSoundWave codec"));
|
||||
}
|
||||
|
||||
#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return FALSE; }
|
||||
#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return false; }
|
||||
|
||||
bool wxSoundWave::CanRead()
|
||||
{
|
||||
@@ -77,7 +77,7 @@ bool wxSoundWave::CanRead()
|
||||
|
||||
if (wxUINT32_SWAP_ON_BE(signature1) != RIFF_SIGNATURE) {
|
||||
m_input->Ungetch(&signature1, 4);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Pass the global length
|
||||
@@ -93,9 +93,9 @@ bool wxSoundWave::CanRead()
|
||||
|
||||
// Test the second signature
|
||||
if (wxUINT32_SWAP_ON_BE(signature2) != WAVE_SIGNATURE)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundWave::HandleOutputPCM(wxDataInputStream& WXUNUSED(data), wxUint32 len,
|
||||
@@ -108,15 +108,15 @@ bool wxSoundWave::HandleOutputPCM(wxDataInputStream& WXUNUSED(data), wxUint32 le
|
||||
sndformat.SetSampleRate(sample_fq);
|
||||
sndformat.SetBPS(bits_p_spl);
|
||||
sndformat.SetChannels(channels);
|
||||
sndformat.Signed(TRUE);
|
||||
sndformat.Signed(true);
|
||||
sndformat.SetOrder(wxLITTLE_ENDIAN);
|
||||
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_input->SeekI(len, wxFromCurrent);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundWave::HandleOutputMSADPCM(wxDataInputStream& data, wxUint32 len,
|
||||
@@ -150,13 +150,13 @@ bool wxSoundWave::HandleOutputMSADPCM(wxDataInputStream& data, wxUint32 len,
|
||||
delete[] coefs[1];
|
||||
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
len -= coefs_len*4 + 4;
|
||||
|
||||
m_input->SeekI(len, wxFromCurrent);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundWave::HandleOutputG721(wxDataInputStream& WXUNUSED(data), wxUint32 len,
|
||||
@@ -170,11 +170,11 @@ bool wxSoundWave::HandleOutputG721(wxDataInputStream& WXUNUSED(data), wxUint32 l
|
||||
sndformat.SetG72XType(wxSOUND_G721);
|
||||
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_input->SeekI(len, wxFromCurrent);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundWave::PrepareToPlay()
|
||||
@@ -184,11 +184,11 @@ bool wxSoundWave::PrepareToPlay()
|
||||
|
||||
if (!m_input) {
|
||||
m_snderror = wxSOUND_INVSTRM;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxDataInputStream data(*m_input);
|
||||
data.BigEndianOrdered(FALSE);
|
||||
data.BigEndianOrdered(false);
|
||||
|
||||
// Get the first signature
|
||||
FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM);
|
||||
@@ -205,7 +205,7 @@ bool wxSoundWave::PrepareToPlay()
|
||||
FAIL_WITH(wxUINT32_SWAP_ON_BE(signature) != WAVE_SIGNATURE, wxSOUND_INVSTRM);
|
||||
// "WAVE"
|
||||
|
||||
end_headers = FALSE;
|
||||
end_headers = false;
|
||||
// Chunk loop
|
||||
while (!end_headers) {
|
||||
FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM);
|
||||
@@ -228,31 +228,31 @@ bool wxSoundWave::PrepareToPlay()
|
||||
if (!HandleOutputPCM(data, len, channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl,
|
||||
bits_p_spl))
|
||||
return FALSE;
|
||||
return false;
|
||||
break;
|
||||
case 0x02: // MS ADPCM
|
||||
if (!HandleOutputMSADPCM(data, len,
|
||||
channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl,
|
||||
bits_p_spl))
|
||||
return FALSE;
|
||||
return false;
|
||||
break;
|
||||
case 0x40: // G721
|
||||
if (!HandleOutputG721(data, len,
|
||||
channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl,
|
||||
bits_p_spl))
|
||||
return FALSE;
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
m_snderror = wxSOUND_NOCODEC;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DATA_SIGNATURE: // "data"
|
||||
m_base_offset = m_input->TellI();
|
||||
end_headers = TRUE;
|
||||
end_headers = true;
|
||||
FinishPreparation(len);
|
||||
break;
|
||||
default:
|
||||
@@ -261,7 +261,7 @@ bool wxSoundWave::PrepareToPlay()
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSoundFormatBase *wxSoundWave::HandleInputPCM(wxDataOutputStream& data)
|
||||
@@ -282,7 +282,7 @@ wxSoundFormatBase *wxSoundWave::HandleInputPCM(wxDataOutputStream& data)
|
||||
byte_p_sec = pcm->GetBytesFromTime(1);
|
||||
format = 0x01;
|
||||
|
||||
pcm->Signed(TRUE);
|
||||
pcm->Signed(true);
|
||||
pcm->SetOrder(wxLITTLE_ENDIAN);
|
||||
|
||||
data << format << channels << sample_fq
|
||||
@@ -330,14 +330,14 @@ FAIL_WITH(s->Write(&signature, 4).LastWrite() != 4, wxSOUND_INVSTRM);
|
||||
|
||||
if (!m_output) {
|
||||
m_snderror = wxSOUND_INVSTRM;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxDataOutputStream data(*m_output);
|
||||
wxDataOutputStream fmt_d_data(fmt_data);
|
||||
|
||||
data.BigEndianOrdered(FALSE);
|
||||
fmt_d_data.BigEndianOrdered(FALSE);
|
||||
data.BigEndianOrdered(false);
|
||||
fmt_d_data.BigEndianOrdered(false);
|
||||
|
||||
WRITE_SIGNATURE(m_output, RIFF_SIGNATURE);
|
||||
|
||||
@@ -359,14 +359,14 @@ FAIL_WITH(s->Write(&signature, 4).LastWrite() != 4, wxSOUND_INVSTRM);
|
||||
break;
|
||||
default:
|
||||
m_snderror = wxSOUND_NOCODEC;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
FAIL_WITH(!frmt, wxSOUND_NOCODEC);
|
||||
|
||||
if (!SetSoundFormat(*frmt)) {
|
||||
delete frmt;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
delete frmt;
|
||||
@@ -387,28 +387,28 @@ FAIL_WITH(s->Write(&signature, 4).LastWrite() != 4, wxSOUND_INVSTRM);
|
||||
|
||||
WRITE_SIGNATURE(m_output, DATA_SIGNATURE);
|
||||
data.Write32(m_sndformat->GetBytesFromTime(time));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundWave::FinishRecording()
|
||||
{
|
||||
if (m_output->SeekO(0, wxFromStart) == wxInvalidOffset)
|
||||
// We can't but there is no error.
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (m_bytes_left == 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// TODO: Update headers when we stop before the specified time (if possible)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSoundWave::RepositionStream(wxUint32 WXUNUSED(position))
|
||||
{
|
||||
if (m_base_offset == wxInvalidOffset)
|
||||
return FALSE;
|
||||
return false;
|
||||
m_input->SeekI(m_base_offset, wxFromStart);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxUint32 wxSoundWave::GetData(void *buffer, wxUint32 len)
|
||||
|
@@ -80,7 +80,7 @@ wxSoundStreamWin::wxSoundStreamWin()
|
||||
{
|
||||
wxSoundFormatPcm pcm;
|
||||
|
||||
m_production_started = FALSE;
|
||||
m_production_started = false;
|
||||
m_internal = new wxSoundInternal;
|
||||
if (!m_internal) {
|
||||
m_snderror = wxSOUND_MEMERROR;
|
||||
@@ -93,10 +93,10 @@ wxSoundStreamWin::wxSoundStreamWin()
|
||||
CreateSndWindow();
|
||||
SetSoundFormat(pcm);
|
||||
|
||||
m_internal->m_input_enabled = FALSE;
|
||||
m_internal->m_output_enabled = FALSE;
|
||||
m_internal->m_input_enabled = false;
|
||||
m_internal->m_output_enabled = false;
|
||||
|
||||
m_waiting_for = FALSE;
|
||||
m_waiting_for = false;
|
||||
|
||||
if (!OpenDevice(wxSOUND_OUTPUT)) {
|
||||
m_snderror = wxSOUND_NOERROR; //next call to OpenDevice won't do this
|
||||
@@ -199,7 +199,7 @@ bool wxSoundStreamWin::OpenDevice(int mode)
|
||||
|
||||
if (!m_sndformat) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
pcm = (wxSoundFormatPcm *)m_sndformat;
|
||||
@@ -225,13 +225,13 @@ bool wxSoundStreamWin::OpenDevice(int mode)
|
||||
|
||||
if (result != MMSYSERR_NOERROR) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_output_frag_out = WXSOUND_MAX_QUEUE-1;
|
||||
m_current_frag_out = 0;
|
||||
|
||||
m_internal->m_output_enabled = TRUE;
|
||||
m_internal->m_output_enabled = true;
|
||||
}
|
||||
// -----------------------------------
|
||||
// Open the driver for Input operation
|
||||
@@ -246,29 +246,29 @@ bool wxSoundStreamWin::OpenDevice(int mode)
|
||||
|
||||
if (result != MMSYSERR_NOERROR) {
|
||||
m_snderror = wxSOUND_INVDEV;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_current_frag_in = WXSOUND_MAX_QUEUE-1;
|
||||
m_input_frag_in = 0;
|
||||
|
||||
m_internal->m_input_enabled = TRUE;
|
||||
m_internal->m_input_enabled = true;
|
||||
}
|
||||
|
||||
if (mode & wxSOUND_OUTPUT) {
|
||||
if (!AllocHeaders(wxSOUND_OUTPUT)) {
|
||||
CloseDevice();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (mode & wxSOUND_INPUT) {
|
||||
if (!AllocHeaders(wxSOUND_INPUT)) {
|
||||
CloseDevice();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -279,13 +279,13 @@ void wxSoundStreamWin::CloseDevice()
|
||||
{
|
||||
if (m_internal->m_output_enabled) {
|
||||
FreeHeaders(wxSOUND_OUTPUT);
|
||||
m_internal->m_output_enabled = FALSE;
|
||||
m_internal->m_output_enabled = false;
|
||||
waveOutClose(m_internal->m_devout);
|
||||
}
|
||||
|
||||
if (m_internal->m_input_enabled) {
|
||||
FreeHeaders(wxSOUND_INPUT);
|
||||
m_internal->m_input_enabled = FALSE;
|
||||
m_internal->m_input_enabled = false;
|
||||
waveInClose(m_internal->m_devin);
|
||||
}
|
||||
}
|
||||
@@ -381,8 +381,8 @@ wxSoundInfoHeader *wxSoundStreamWin::AllocHeader(int mode)
|
||||
// AllocHeaders() allocates WXSOUND_MAX_QUEUE (= 128) blocks for an operation
|
||||
// queue. It uses AllocHeader() for each element.
|
||||
//
|
||||
// Once it has allocated all blocks, it returns TRUE and if an error occured
|
||||
// it returns FALSE.
|
||||
// Once it has allocated all blocks, it returns true and if an error occured
|
||||
// it returns false.
|
||||
// -------------------------------------------------------------------------
|
||||
bool wxSoundStreamWin::AllocHeaders(int mode)
|
||||
{
|
||||
@@ -400,10 +400,10 @@ bool wxSoundStreamWin::AllocHeaders(int mode)
|
||||
headers[i] = AllocHeader(mode);
|
||||
if (!headers[i]) {
|
||||
FreeHeaders(mode);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -482,11 +482,11 @@ void wxSoundStreamWin::WaitFor(wxSoundInfoHeader *info)
|
||||
// PROBLEM //
|
||||
return;
|
||||
}
|
||||
m_waiting_for = TRUE;
|
||||
m_waiting_for = true;
|
||||
// Else, we wait for its termination
|
||||
while (info->m_playing || info->m_recording)
|
||||
wxYield();
|
||||
m_waiting_for = FALSE;
|
||||
m_waiting_for = false;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -508,18 +508,18 @@ bool wxSoundStreamWin::AddToQueue(wxSoundInfoHeader *info)
|
||||
result = waveInAddBuffer(m_internal->m_devin,
|
||||
info->m_header, sizeof(WAVEHDR));
|
||||
if (result == MMSYSERR_NOERROR)
|
||||
info->m_recording = TRUE;
|
||||
info->m_recording = true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if (info->m_mode == wxSOUND_OUTPUT) {
|
||||
result = waveOutWrite(m_internal->m_devout,
|
||||
info->m_header, sizeof(WAVEHDR));
|
||||
if (result == MMSYSERR_NOERROR)
|
||||
info->m_playing = TRUE;
|
||||
info->m_playing = true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -530,8 +530,8 @@ bool wxSoundStreamWin::AddToQueue(wxSoundInfoHeader *info)
|
||||
// -------------------------------------------------------------------------
|
||||
void wxSoundStreamWin::ClearHeader(wxSoundInfoHeader *info)
|
||||
{
|
||||
info->m_playing = FALSE;
|
||||
info->m_recording = FALSE;
|
||||
info->m_playing = false;
|
||||
info->m_recording = false;
|
||||
info->m_position = 0;
|
||||
info->m_size = GetBestSize();
|
||||
}
|
||||
@@ -552,7 +552,7 @@ wxSoundInfoHeader *wxSoundStreamWin::NextFragmentOutput()
|
||||
WaitFor(m_headers_play[m_current_frag_out]);
|
||||
}
|
||||
if (m_current_frag_out == m_output_frag_out)
|
||||
m_queue_filled = TRUE;
|
||||
m_queue_filled = true;
|
||||
return m_headers_play[m_current_frag_out];
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ wxSoundInfoHeader *wxSoundStreamWin::NextFragmentInput()
|
||||
|
||||
// We reached the writer position: the queue is full.
|
||||
if (m_current_frag_in == m_input_frag_in)
|
||||
m_queue_filled = TRUE;
|
||||
m_queue_filled = true;
|
||||
|
||||
return header;
|
||||
}
|
||||
@@ -672,7 +672,7 @@ void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 WXUNUSED(dev_handle), int flag)
|
||||
info = m_headers_play[m_output_frag_out];
|
||||
// Clear header to tell the system the buffer is free now
|
||||
ClearHeader(info);
|
||||
m_queue_filled = FALSE;
|
||||
m_queue_filled = false;
|
||||
if (!m_waiting_for)
|
||||
// Try to requeue a new buffer.
|
||||
OnSoundEvent(wxSOUND_OUTPUT);
|
||||
@@ -681,12 +681,12 @@ void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 WXUNUSED(dev_handle), int flag)
|
||||
return;
|
||||
|
||||
// Recording completed
|
||||
m_headers_rec[m_input_frag_in]->m_recording = FALSE;
|
||||
m_headers_rec[m_input_frag_in]->m_recording = false;
|
||||
// Queue pointer: writer
|
||||
m_input_frag_in = (m_input_frag_in + 1) % WXSOUND_MAX_QUEUE;
|
||||
if (!m_waiting_for)
|
||||
OnSoundEvent(wxSOUND_INPUT);
|
||||
m_queue_filled = FALSE;
|
||||
m_queue_filled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,17 +705,17 @@ bool wxSoundStreamWin::SetSoundFormat(const wxSoundFormatBase& base)
|
||||
bool wxSoundStreamWin::StartProduction(int evt)
|
||||
{
|
||||
if (!m_internal)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if ((m_internal->m_output_enabled && (evt & wxSOUND_OUTPUT)) ||
|
||||
(m_internal->m_input_enabled && (evt & wxSOUND_INPUT)))
|
||||
CloseDevice();
|
||||
|
||||
if (!OpenDevice(evt))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_production_started = TRUE;
|
||||
m_queue_filled = FALSE;
|
||||
m_production_started = true;
|
||||
m_queue_filled = false;
|
||||
// Send a dummy event to start.
|
||||
if (evt & wxSOUND_OUTPUT)
|
||||
OnSoundEvent(wxSOUND_OUTPUT);
|
||||
@@ -728,7 +728,7 @@ bool wxSoundStreamWin::StartProduction(int evt)
|
||||
waveInStart(m_internal->m_devin);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -738,13 +738,13 @@ bool wxSoundStreamWin::StopProduction()
|
||||
{
|
||||
if (!m_production_started) {
|
||||
m_snderror = wxSOUND_NOTSTARTED;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
m_production_started = FALSE;
|
||||
m_production_started = false;
|
||||
CloseDevice();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -771,7 +771,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSoundWinModule, wxModule)
|
||||
|
||||
bool wxSoundWinModule::OnInit() {
|
||||
wxSoundHandleList = new wxList(wxKEY_INTEGER);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSoundWinModule::OnExit() {
|
||||
|
@@ -50,7 +50,7 @@ wxVideoBaseDriver::~wxVideoBaseDriver()
|
||||
bool wxVideoBaseDriver::AttachOutput(wxWindow& output)
|
||||
{
|
||||
m_video_output = &output;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxVideoBaseDriver::DetachOutput()
|
||||
@@ -62,11 +62,11 @@ void wxVideoBaseDriver::DetachOutput()
|
||||
|
||||
wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv)
|
||||
{
|
||||
wxFrame *frame = new wxFrame(NULL, -1, _("Video Output"), wxDefaultPosition, wxSize(100, 100));
|
||||
wxWindow *vid_out = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(300, 300));
|
||||
wxFrame *frame = new wxFrame(NULL, wxID_ANY, _("Video Output"), wxDefaultPosition, wxSize(100, 100));
|
||||
wxWindow *vid_out = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(300, 300));
|
||||
|
||||
frame->Layout();
|
||||
frame->Show(TRUE);
|
||||
frame->Show(true);
|
||||
|
||||
vid_drv->AttachOutput(*vid_out);
|
||||
vid_drv->Play();
|
||||
|
@@ -49,10 +49,10 @@ wxVideoWindows::wxVideoWindows(wxInputStream& str)
|
||||
: wxVideoBaseDriver(str)
|
||||
{
|
||||
m_internal = new wxVIDWinternal;
|
||||
m_remove_file = TRUE;
|
||||
m_remove_file = true;
|
||||
m_filename = wxGetTempFileName(_T("wxvid"));
|
||||
m_paused = FALSE;
|
||||
m_stopped = TRUE;
|
||||
m_paused = false;
|
||||
m_stopped = true;
|
||||
m_frameRate = 1.0;
|
||||
|
||||
wxFileOutputStream temp_file(m_filename);
|
||||
@@ -65,10 +65,10 @@ wxVideoWindows::wxVideoWindows(const wxString& filename)
|
||||
: wxVideoBaseDriver(filename)
|
||||
{
|
||||
m_internal = new wxVIDWinternal;
|
||||
m_remove_file = FALSE;
|
||||
m_remove_file = false;
|
||||
m_filename = filename;
|
||||
m_paused = FALSE;
|
||||
m_stopped = TRUE;
|
||||
m_paused = false;
|
||||
m_stopped = true;
|
||||
m_frameRate = 1.0;
|
||||
OpenFile();
|
||||
}
|
||||
@@ -122,16 +122,16 @@ void wxVideoWindows::OpenFile()
|
||||
bool wxVideoWindows::Pause()
|
||||
{
|
||||
if (m_paused || m_stopped)
|
||||
return TRUE;
|
||||
m_paused = TRUE;
|
||||
return true;
|
||||
m_paused = true;
|
||||
return (mciSendCommand(m_internal->m_dev_id, MCI_PAUSE, MCI_WAIT, 0) == 0);
|
||||
}
|
||||
|
||||
bool wxVideoWindows::Resume()
|
||||
{
|
||||
if (!m_paused || m_stopped)
|
||||
return TRUE;
|
||||
m_paused = FALSE;
|
||||
return true;
|
||||
m_paused = false;
|
||||
return (mciSendCommand(m_internal->m_dev_id, MCI_RESUME, 0, 0) == 0);
|
||||
}
|
||||
|
||||
@@ -149,12 +149,12 @@ bool wxVideoWindows::GetSize(wxSize& size) const
|
||||
{
|
||||
size.SetWidth(200);
|
||||
size.SetHeight(200);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVideoWindows::SetSize(wxSize WXUNUSED(size))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVideoWindows::IsCapable(wxVideoType v_type) const
|
||||
@@ -167,12 +167,12 @@ bool wxVideoWindows::AttachOutput(wxWindow& output)
|
||||
MCI_DGV_WINDOW_PARMS win_struct;
|
||||
|
||||
if (!wxVideoBaseDriver::AttachOutput(output))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
win_struct.hWnd = (HWND)output.GetHWND();
|
||||
mciSendCommand(m_internal->m_dev_id, MCI_WINDOW,
|
||||
MCI_DGV_WINDOW_HWND, (DWORD)(LPVOID)&win_struct);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxVideoWindows::DetachOutput()
|
||||
@@ -189,8 +189,8 @@ void wxVideoWindows::DetachOutput()
|
||||
bool wxVideoWindows::Play()
|
||||
{
|
||||
if (!m_stopped)
|
||||
return FALSE;
|
||||
m_stopped = FALSE;
|
||||
return false;
|
||||
m_stopped = false;
|
||||
return (mciSendCommand(m_internal->m_dev_id, MCI_PLAY, 0, NULL) == 0);
|
||||
}
|
||||
|
||||
@@ -199,10 +199,10 @@ bool wxVideoWindows::Stop()
|
||||
MCI_SEEK_PARMS seekStruct;
|
||||
|
||||
if (m_stopped)
|
||||
return FALSE;
|
||||
m_stopped = TRUE;
|
||||
return false;
|
||||
m_stopped = true;
|
||||
if (::mciSendCommand(m_internal->m_dev_id, MCI_STOP, MCI_WAIT, NULL) != 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
seekStruct.dwCallback = 0;
|
||||
seekStruct.dwTo = 0;
|
||||
|
@@ -77,14 +77,14 @@ wxVideoXANIMProcess::wxVideoXANIMProcess(wxVideoXANIM *xanim)
|
||||
|
||||
void wxVideoXANIMProcess::OnTerminate(int WXUNUSED(pid), int WXUNUSED(status))
|
||||
{
|
||||
m_vid_xanim->m_xanim_started = FALSE;
|
||||
m_vid_xanim->m_xanim_started = false;
|
||||
m_vid_xanim->OnFinished();
|
||||
}
|
||||
|
||||
wxVideoXANIMOutput::wxVideoXANIMOutput()
|
||||
: wxProcess(NULL, -1)
|
||||
: wxProcess(NULL, wxID_ANY)
|
||||
{
|
||||
m_terminated = FALSE;
|
||||
m_terminated = false;
|
||||
Redirect();
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ bool wxVideoXANIMOutput::IsTerminated() const
|
||||
|
||||
void wxVideoXANIMOutput::OnTerminate(int pid, int status)
|
||||
{
|
||||
m_terminated = TRUE;
|
||||
m_terminated = true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -106,10 +106,10 @@ wxVideoXANIM::wxVideoXANIM()
|
||||
{
|
||||
m_internal = new wxXANIMinternal;
|
||||
m_xanim_detector = new wxVideoXANIMProcess(this);
|
||||
m_xanim_started = FALSE;
|
||||
m_paused = FALSE;
|
||||
m_xanim_started = false;
|
||||
m_paused = false;
|
||||
m_filename = wxEmptyString;
|
||||
m_remove_file = FALSE;
|
||||
m_remove_file = false;
|
||||
}
|
||||
|
||||
wxVideoXANIM::wxVideoXANIM(wxInputStream& str)
|
||||
@@ -117,13 +117,13 @@ wxVideoXANIM::wxVideoXANIM(wxInputStream& str)
|
||||
{
|
||||
m_internal = new wxXANIMinternal;
|
||||
m_xanim_detector = new wxVideoXANIMProcess(this);
|
||||
m_xanim_started = FALSE;
|
||||
m_paused = FALSE;
|
||||
m_xanim_started = false;
|
||||
m_paused = false;
|
||||
m_size[0] = 0;
|
||||
m_size[1] = 0;
|
||||
|
||||
m_filename = wxGetTempFileName(_T("vidxa"));
|
||||
m_remove_file = TRUE;
|
||||
m_remove_file = true;
|
||||
wxFileOutputStream fout(m_filename);
|
||||
|
||||
fout << str;
|
||||
@@ -135,11 +135,11 @@ wxVideoXANIM::wxVideoXANIM(const wxString& filename)
|
||||
{
|
||||
m_internal = new wxXANIMinternal;
|
||||
m_xanim_detector = new wxVideoXANIMProcess(this);
|
||||
m_xanim_started = FALSE;
|
||||
m_paused = FALSE;
|
||||
m_xanim_started = false;
|
||||
m_paused = false;
|
||||
|
||||
m_filename = filename;
|
||||
m_remove_file = FALSE;
|
||||
m_remove_file = false;
|
||||
m_size[0] = 0;
|
||||
m_size[1] = 0;
|
||||
|
||||
@@ -163,42 +163,42 @@ wxVideoXANIM::~wxVideoXANIM()
|
||||
bool wxVideoXANIM::Play()
|
||||
{
|
||||
if (!m_paused && m_xanim_started)
|
||||
return TRUE;
|
||||
return true;
|
||||
if (!m_video_output) {
|
||||
wxVideoCreateFrame(this);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// The movie starts with xanim
|
||||
if (RestartXANIM()) {
|
||||
m_paused = FALSE;
|
||||
return TRUE;
|
||||
m_paused = false;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxVideoXANIM::Pause()
|
||||
{
|
||||
if (!m_paused && SendCommand(" ")) {
|
||||
m_paused = TRUE;
|
||||
return TRUE;
|
||||
m_paused = true;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxVideoXANIM::Resume()
|
||||
{
|
||||
if (m_paused && SendCommand(" ")) {
|
||||
m_paused = FALSE;
|
||||
return TRUE;
|
||||
m_paused = false;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxVideoXANIM::Stop()
|
||||
{
|
||||
if (!m_xanim_started)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
SendCommand("q");
|
||||
|
||||
@@ -207,9 +207,9 @@ bool wxVideoXANIM::Stop()
|
||||
wxYield();
|
||||
}
|
||||
|
||||
m_paused = FALSE;
|
||||
m_paused = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -218,18 +218,18 @@ bool wxVideoXANIM::Stop()
|
||||
bool wxVideoXANIM::SetSize(wxSize size)
|
||||
{
|
||||
if (!m_video_output)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_video_output->SetSize(size.GetWidth(), size.GetHeight());
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxVideoXANIM::GetSize(wxSize& size) const
|
||||
{
|
||||
if (m_size[0] == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
size.Set(m_size[0], m_size[1]);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -240,9 +240,9 @@ bool wxVideoXANIM::IsCapable(wxVideoType v_type) const
|
||||
if (v_type == wxVIDEO_MSAVI || v_type == wxVIDEO_MPEG ||
|
||||
v_type == wxVIDEO_QT || v_type == wxVIDEO_GIF || v_type == wxVIDEO_JMOV ||
|
||||
v_type == wxVIDEO_FLI || v_type == wxVIDEO_IFF || v_type == wxVIDEO_SGI)
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -314,16 +314,16 @@ bool wxVideoXANIM::IsStopped() const
|
||||
bool wxVideoXANIM::AttachOutput(wxWindow& out)
|
||||
{
|
||||
if (!wxVideoBaseDriver::AttachOutput(out))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxVideoXANIM::DetachOutput()
|
||||
{
|
||||
SendCommand("q");
|
||||
m_xanim_started = FALSE;
|
||||
m_paused = FALSE;
|
||||
m_xanim_started = false;
|
||||
m_paused = false;
|
||||
|
||||
wxVideoBaseDriver::DetachOutput();
|
||||
}
|
||||
@@ -336,7 +336,7 @@ bool wxVideoXANIM::SendCommand(const char *command, char **ret,
|
||||
{
|
||||
if (!m_xanim_started)
|
||||
if (!RestartXANIM())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// Send a command to XAnim through X11 Property
|
||||
XChangeProperty(m_internal->xanim_dpy, m_internal->xanim_window,
|
||||
@@ -354,7 +354,7 @@ bool wxVideoXANIM::SendCommand(const char *command, char **ret,
|
||||
&prop_type, &prop_format, (unsigned long *)size,
|
||||
&extra, (unsigned char **)ret);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVideoXANIM::CollectInfo()
|
||||
@@ -366,8 +366,8 @@ bool wxVideoXANIM::CollectInfo()
|
||||
xanimProcess = new wxVideoXANIMOutput;
|
||||
xanim_command = wxT("xanim +v +Zv -Ae ");
|
||||
xanim_command += m_filename;
|
||||
if (!wxExecute(xanim_command, FALSE, xanimProcess))
|
||||
return FALSE;
|
||||
if (!wxExecute(xanim_command, false, xanimProcess))
|
||||
return false;
|
||||
|
||||
wxInputStream *infoStream = xanimProcess->GetInputStream();
|
||||
wxString totalOutput;
|
||||
@@ -443,7 +443,7 @@ i = my_long;
|
||||
|
||||
delete xanimProcess;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVideoXANIM::RestartXANIM()
|
||||
@@ -458,10 +458,10 @@ bool wxVideoXANIM::RestartXANIM()
|
||||
bool xanim_chg_size;
|
||||
|
||||
if (!m_video_output || m_xanim_started)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// Check if we can change the size of the window dynamicly
|
||||
xanim_chg_size = TRUE;
|
||||
xanim_chg_size = true;
|
||||
// Get current display
|
||||
#ifdef __WXGTK__
|
||||
m_internal->xanim_dpy = gdk_display;
|
||||
@@ -481,12 +481,12 @@ bool wxVideoXANIM::RestartXANIM()
|
||||
WXSTRINGCAST m_filename);
|
||||
|
||||
// Execute it
|
||||
if (!wxExecute(xanim_command, FALSE, m_xanim_detector))
|
||||
return FALSE;
|
||||
if (!wxExecute(xanim_command, false, m_xanim_detector))
|
||||
return false;
|
||||
|
||||
// Wait for XAnim to be ready
|
||||
nitems = 0;
|
||||
m_xanim_started = TRUE;
|
||||
m_xanim_started = true;
|
||||
while (nitems == 0 && m_xanim_started) {
|
||||
ret = XGetWindowProperty(m_internal->xanim_dpy, m_internal->xanim_window,
|
||||
m_internal->xanim_atom,
|
||||
@@ -507,7 +507,7 @@ bool wxVideoXANIM::RestartXANIM()
|
||||
// Very useful ! Actually it "should" sends a SETSIZE event to XAnim
|
||||
// FIXME: This event is not sent !!
|
||||
|
||||
m_paused = FALSE;
|
||||
m_paused = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user