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()24Audio::Audio( ) 25 { 26 instance = mlt_audio_new(); 27 } 28 Audio(mlt_audio audio)29Audio::Audio( mlt_audio audio ) 30 : instance( audio ) 31 { 32 } 33 ~Audio()34Audio::~Audio( ) 35 { 36 mlt_audio_close( instance ); 37 } 38 data()39void* Audio::data() 40 { 41 return instance->data; 42 } 43 set_data(void * data)44void Audio::set_data( void* data ) 45 { 46 instance->data = data; 47 } 48 frequency()49int Audio::frequency() 50 { 51 return instance->frequency; 52 } 53 set_frequency(int frequency)54void Audio::set_frequency( int frequency ) 55 { 56 instance->frequency = frequency; 57 } 58 format()59mlt_audio_format Audio::format() 60 { 61 return instance->format; 62 } 63 set_format(mlt_audio_format format)64void Audio::set_format( mlt_audio_format format ) 65 { 66 instance->format = format; 67 } 68 samples()69int Audio::samples() 70 { 71 return instance->samples; 72 } 73 set_samples(int samples)74void Audio::set_samples( int samples ) 75 { 76 instance->samples = samples; 77 } 78 channels()79int Audio::channels() 80 { 81 return instance->channels; 82 } 83 set_channels(int channels)84void Audio::set_channels( int channels ) 85 { 86 instance->channels = channels; 87 } 88 layout()89mlt_channel_layout Audio::layout() 90 { 91 return instance->layout; 92 } 93 set_layout(mlt_channel_layout layout)94void Audio::set_layout( mlt_channel_layout layout ) 95 { 96 instance->layout = layout; 97 } 98