|
From: <pst...@us...> - 2011-03-23 00:39:37
|
Revision: 837
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=837&view=rev
Author: pstieber
Date: 2011-03-23 00:39:31 +0000 (Wed, 23 Mar 2011)
Log Message:
-----------
1. Checked for an empty file name instead of trating the file name like a
pointer.
2. Changed the first argument to SaveWave from const char* to const wxString&.
Modified Paths:
--------------
trunk/jazz/src/Audio.cpp
trunk/jazz/src/Audio.h
Modified: trunk/jazz/src/Audio.cpp
===================================================================
--- trunk/jazz/src/Audio.cpp 2011-03-23 00:24:40 UTC (rev 836)
+++ trunk/jazz/src/Audio.cpp 2011-03-23 00:39:31 UTC (rev 837)
@@ -325,7 +325,7 @@
continue;
}
assert(0 <= key && key < eSampleCount);
- mSamples[key]->SetFileName(SampleFileName.GetFullPath().c_str());
+ mSamples[key]->SetFileName(SampleFileName.GetFullPath());
mSamples[key]->SetLabel(Label.c_str());
mSamples[key]->SetVolume(vol);
mSamples[key]->SetPan(pan);
@@ -860,7 +860,7 @@
false,
has_changed,
"*.spl");
- if (FileName)
+ if (!FileName.empty())
{
Load(FileName);
}
@@ -877,7 +877,7 @@
true,
has_changed,
"*.spl");
- if (FileName)
+ if (!FileName.empty())
{
Save(FileName);
}
@@ -1027,7 +1027,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void JZSampleSet::SaveWave(
- const char* pFileName,
+ const wxString& FileName,
long frc,
long toc,
JZAudioRecordBuffer& buf)
@@ -1060,7 +1060,7 @@
wh.data_length = (end_index - start_index) * sizeof(short);
wh.length = wh.data_length + sizeof(WaveHeader);
- ofstream os(pFileName, ios::out | ios::binary | ios::trunc);
+ ofstream os(FileName.c_str(), ios::out | ios::binary | ios::trunc);
os.write((char*)&wh, sizeof(wh));
Modified: trunk/jazz/src/Audio.h
===================================================================
--- trunk/jazz/src/Audio.h 2011-03-23 00:24:40 UTC (rev 836)
+++ trunk/jazz/src/Audio.h 2011-03-23 00:39:31 UTC (rev 837)
@@ -358,7 +358,7 @@
void SaveRecordingDlg(long frc, long toc, JZAudioRecordBuffer &buf);
void SaveWave(
- const char *fname,
+ const wxString& FileName,
long frc,
long toc,
JZAudioRecordBuffer &buf);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|