]> git.sesse.net Git - vlc/blob - bindings/libvlcpp/src/audio.hpp
libvlcpp: add an audio class to handle audio functions.
[vlc] / bindings / libvlcpp / src / audio.hpp
1 /*****************************************************************************
2  * audio.hpp: 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 #ifndef LIBVLCPP_AUDIO_HPP
25 #define LIBVLCPP_AUDIO_HPP
26
27 #include <vlc/libvlc.h>
28 #include <vlc/libvlc_media.h>
29 #include <vlc/libvlc_media_player.h>
30
31 #include "libvlc.hpp"
32
33 namespace libvlc
34 {
35
36 class Audio
37 {
38 public:
39     /**
40      * Constructor
41      * @param libvlcInstance: the libvlc instance
42      * @param player: the player handling the audio
43      */
44     Audio( libvlc_instance_t *libvlcInstance, libvlc_media_player_t *player );
45
46     /** Destructor */
47     ~Audio();
48
49     /**
50      * Toggle mute status
51      */
52     void toggleMute();
53
54     /**
55      * Get the mute status
56      * @return true if the sound is muted
57      */
58     int mute();
59
60     /**
61      * Set the mute status
62      * @param mute: true to mute, otherwise unmute
63      */
64     void setMute( int mute );
65
66     /**
67      * Get the current volume
68      * @return the current volume
69      */
70     int volume();
71
72     /**
73      * Set the volume
74      * @param volume: the new volume
75      */
76     void setVolume( int volume );
77
78
79     /**
80      * Get the current track
81      * @return the current audio track
82      */
83     int track();
84
85     /**
86      * Get the number of audio tracks
87      * @return the number of audio tracks
88      */
89     int trackCount();
90
91     /**
92      * Set the audio track
93      * @param track: the audio track
94      */
95     void setTrack( int track );
96
97     /**
98      * Get the current audio channel
99      * @return the current audio channel
100      */
101     int channel();
102
103     /**
104      * Set the audio channel
105      * @param channel: the new audio channel
106      */
107     void setChannel( int channel );
108
109     /** trackDescription */
110
111 private:
112     /** The media player instance of libvlc */
113     libvlc_media_player_t *m_player;
114
115     /** The instance of libvlc */
116     libvlc_instance_t *m_libvlcInstance;
117 };
118
119 };
120
121 #endif // LIBVLCPP_AUDIO_HPP
122