summaryrefslogtreecommitdiff
path: root/orkbasecxx/audiofile/AudioFile.cpp
blob: 0f1295804ef4f07f98904793dc44cec1d7b070cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Oreka -- A media capture and retrieval platform
 * 
 * Copyright (C) 2005, orecx LLC
 *
 * http://www.orecx.com
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License.
 * Please refer to http://www.gnu.org/copyleft/gpl.html
 *
 */

#include "AudioFile.h"
#include "ace/OS_NS_unistd.h"

void AudioFile::Open(fileOpenModeEnum mode, bool stereo , int sampleRate)
{
	Open(m_filename, mode, stereo, sampleRate);
}

void AudioFile::MoveOrig()
{
	CStdString newName = m_filename + ".orig";
	if (ACE_OS::rename((PCSTR)m_filename, (PCSTR)newName) == 0)
	{
		m_filename = newName;
	}
	else
	{
		throw(CStdString("AudioFile::MoveOrig: could not rename file:" + m_filename));
	}
}

void AudioFile::Delete()
{
	ACE_OS::unlink((PCSTR)m_filename);
}

void AudioFile::SetFilename(CStdString& filename)
{
	m_filename = filename;
}


int AudioFile::GetSampleRate()
{
	return m_sampleRate;
}