]> git.sesse.net Git - vlc/blob - bindings/libvlcpp/src/audio.cpp
d829ec1f9c5ca8e68245ca5e33544f1e48aa8c47
[vlc] / bindings / libvlcpp / src / audio.cpp
1 /*****************************************************************************
2  * audio.cpp: audio part of the media player
3  *****************************************************************************
4  * Copyright (C) 2010 the VideoLAN team
5  * $Id$
6  *
7  * Authors: RĂ©mi Duraffort <ivoire@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "audio.hpp"
25
26
27 using namespace libvlc;
28
29 Audio::Audio()
30 {
31 }
32
33 Audio::~Audio()
34 {
35     libvlc_media_player_release( m_player );
36 }
37
38 void Audio::toggleMute()
39 {
40     libvlc_audio_toggle_mute( m_player );
41 }
42
43 int Audio::mute()
44 {
45     return libvlc_audio_get_mute( m_player );
46 }
47
48 void Audio::setMute( int mute )
49 {
50     libvlc_audio_set_mute( m_player, mute );
51 }
52
53 int Audio::volume()
54 {
55     return libvlc_audio_get_volume( m_player );
56 }
57
58 void Audio::setVolume( int volume )
59 {
60     libvlc_audio_set_volume( m_player, volume );
61 }
62
63 int Audio::track()
64 {
65     return libvlc_audio_get_track( m_player );
66 }
67
68 int Audio::trackCount()
69 {
70     return libvlc_audio_get_track_count( m_player );
71 }
72
73 void Audio::setTrack( int track )
74 {
75     libvlc_audio_set_track( m_player, track );
76 }
77
78 void Audio::setMediaPlayer( libvlc_media_player_t *player )
79 {
80     libvlc_media_player_retain( player );
81     m_player = player;
82 }