]> git.sesse.net Git - vlc/blob - bindings/libvlcpp/src/audio.cpp
01bb812a0d807ffd72886cde05a1543c0f9e57e8
[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( libvlc_media_player_t *player )
30 {
31     m_player = player;
32     libvlc_media_player_retain( m_player );
33 }
34
35 Audio::~Audio()
36 {
37     libvlc_media_player_release( m_player );
38 }
39
40 void Audio::toggleMute()
41 {
42     libvlc_audio_toggle_mute( m_player );
43 }
44
45 int Audio::mute()
46 {
47     return libvlc_audio_get_mute( m_player );
48 }
49
50 void Audio::setMute( int mute )
51 {
52     libvlc_audio_set_mute( m_player, mute );
53 }
54
55 int Audio::volume()
56 {
57     return libvlc_audio_get_volume( m_player );
58 }
59
60 void Audio::setVolume( int volume )
61 {
62     libvlc_audio_set_volume( m_player, volume );
63 }
64
65 int Audio::track()
66 {
67     return libvlc_audio_get_track( m_player );
68 }
69
70 int Audio::trackCount()
71 {
72     return libvlc_audio_get_track_count( m_player );
73 }
74
75 void Audio::setTrack( int track )
76 {
77     libvlc_audio_set_track( m_player, track );
78 }
79