1 /**
2  * MltAudio.cpp - MLT Wrapper
3  * Copyright (C) 2020 Meltytech, LLC
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #include "MltAudio.h"
21 
22 using namespace Mlt;
23 
Audio()24 Audio::Audio( )
25 {
26 	instance = mlt_audio_new();
27 }
28 
Audio(mlt_audio audio)29 Audio::Audio( mlt_audio audio )
30  : instance( audio )
31 {
32 }
33 
~Audio()34 Audio::~Audio( )
35 {
36 	mlt_audio_close( instance );
37 }
38 
data()39 void* Audio::data()
40 {
41 	return instance->data;
42 }
43 
set_data(void * data)44 void Audio::set_data( void* data )
45 {
46 	instance->data = data;
47 }
48 
frequency()49 int Audio::frequency()
50 {
51 	return instance->frequency;
52 }
53 
set_frequency(int frequency)54 void Audio::set_frequency( int frequency )
55 {
56 	instance->frequency = frequency;
57 }
58 
format()59 mlt_audio_format Audio::format()
60 {
61 	return instance->format;
62 }
63 
set_format(mlt_audio_format format)64 void Audio::set_format( mlt_audio_format format )
65 {
66 	instance->format = format;
67 }
68 
samples()69 int Audio::samples()
70 {
71 	return instance->samples;
72 }
73 
set_samples(int samples)74 void Audio::set_samples( int samples )
75 {
76 	instance->samples = samples;
77 }
78 
channels()79 int Audio::channels()
80 {
81 	return instance->channels;
82 }
83 
set_channels(int channels)84 void Audio::set_channels( int channels )
85 {
86 	instance->channels = channels;
87 }
88 
layout()89 mlt_channel_layout Audio::layout()
90 {
91 	return instance->layout;
92 }
93 
set_layout(mlt_channel_layout layout)94 void Audio::set_layout( mlt_channel_layout layout )
95 {
96 	instance->layout = layout;
97 }
98