mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
[Summary] Fixed export on windows: made tmp files deleted
[Reviewed by] VKamyshniy
This commit is contained in:
parent
6edcd4064b
commit
6dd3b0d95f
2 changed files with 20 additions and 1 deletions
|
|
@ -35,7 +35,10 @@ class TmpFile : public SndfileWriter<T>, public SndfileReader<T>
|
||||||
~TmpFile()
|
~TmpFile()
|
||||||
{
|
{
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
std::remove(filename.c_str());
|
SndfileHandle::close();
|
||||||
|
if (std::remove(filename.c_str() ) != 0) {
|
||||||
|
std::cout << "TmpFile::~TmpFile () : Error removing temp file: " << strerror(errno) << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ class SndfileHandle
|
||||||
|
|
||||||
bool operator == (const SndfileHandle &rhs) const { return (p == rhs.p) ; }
|
bool operator == (const SndfileHandle &rhs) const { return (p == rhs.p) ; }
|
||||||
|
|
||||||
|
int close (void);
|
||||||
|
|
||||||
sf_count_t frames (void) const { return p ? p->sfinfo.frames : 0 ; }
|
sf_count_t frames (void) const { return p ? p->sfinfo.frames : 0 ; }
|
||||||
int format (void) const { return p ? p->sfinfo.format : 0 ; }
|
int format (void) const { return p ? p->sfinfo.format : 0 ; }
|
||||||
int channels (void) const { return p ? p->sfinfo.channels : 0 ; }
|
int channels (void) const { return p ? p->sfinfo.channels : 0 ; }
|
||||||
|
|
@ -250,6 +252,20 @@ SndfileHandle::operator = (const SndfileHandle &rhs)
|
||||||
return *this ;
|
return *this ;
|
||||||
} /* SndfileHandle assignment operator */
|
} /* SndfileHandle assignment operator */
|
||||||
|
|
||||||
|
int
|
||||||
|
SndfileHandle::close (void)
|
||||||
|
{
|
||||||
|
if ( (p->sf != NULL) && (sf_close (p->sf) == 0 ) )
|
||||||
|
{
|
||||||
|
p->sf = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1 ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
SndfileHandle::error (void) const
|
SndfileHandle::error (void) const
|
||||||
{ return sf_error (p->sf) ; }
|
{ return sf_error (p->sf) ; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue