MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
encoder.cpp
Go to the documentation of this file.
1 #include <iostream>
2 
3 #include <musicmetadata.h>
4 #include <mythcontext.h>
5 
6 #include "encoder.h"
7 
8 
9 using namespace std;
10 
11 Encoder::Encoder(const QString &outfile, int qualitylevel, MusicMetadata *metadata)
12  : m_outfile(outfile), m_out(NULL), m_quality(qualitylevel),
13  m_metadata(metadata)
14 {
15  if (!m_outfile.isEmpty())
16  {
17  QByteArray outfile = m_outfile.toLocal8Bit();
18  m_out = fopen(outfile.constData(), "w+");
19  if (!m_out)
20  {
21  LOG(VB_GENERAL, LOG_ERR, QString("Error opening output file: '%1'")
22  .arg(m_outfile));
23  }
24  }
25 }
26 
28 {
29  if (m_out)
30  fclose(m_out);
31 }