~ubuntu-branches/ubuntu/vivid/sflphone/vivid

« back to all changes in this revision

Viewing changes to daemon/src/audio/pulseaudio/pulselayer.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-30 11:40:56 UTC
  • mfrom: (4.1.18 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130630114056-0np50jkyqo6vnmii
Tags: 1.2.3-2
* changeset_r92d62cfc54732bbbcfff2b1d36c096b120b981a5.diff 
  - fixes automatic endian detection 
* Update Vcs: fixes vcs-field-not-canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3
3
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
4
4
 *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
 
5
 *  Author: Андрей Лухнов <aol.nnov@gmail.com>
5
6
 *
6
7
 *  This program is free software; you can redistribute it and/or modify
7
8
 *  it under the terms of the GNU General Public License as published by
15
16
 *
16
17
 *  You should have received a copy of the GNU General Public License
17
18
 *  along with this program; if not, write to the Free Software
18
 
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
19
20
 *
20
21
 *  Additional permission under GNU GPL version 3 section 7:
21
22
 *
39
40
#include "audio/audiolayer.h"
40
41
#include "noncopyable.h"
41
42
 
 
43
class AudioPreference;
42
44
class AudioStream;
43
45
 
44
46
class PulseLayer : public AudioLayer {
45
47
    public:
46
 
        PulseLayer();
 
48
        PulseLayer(AudioPreference &pref);
47
49
        ~PulseLayer();
48
50
 
49
51
        /**
62
64
 
63
65
        bool inSourceList(const std::string &deviceName) const;
64
66
 
65
 
        virtual std::vector<std::string> getAudioDeviceList(AudioStreamDirection dir) const;
 
67
        virtual std::vector<std::string> getCaptureDeviceList() const;
 
68
        virtual std::vector<std::string> getPlaybackDeviceList() const;
 
69
        int getAudioDeviceIndex(const std::string& name) const;
 
70
        std::string getAudioDeviceName(int index, PCMType type) const;
66
71
 
67
72
        virtual void startStream();
68
73
 
69
74
        virtual void stopStream();
70
75
 
71
 
 
72
76
    private:
73
77
        static void context_state_callback(pa_context* c, void* user_data);
74
78
        static void context_changed_callback(pa_context* c,
81
85
                                             const pa_sink_info *i,
82
86
                                             int eol, void *userdata);
83
87
 
 
88
        virtual void updatePreference(AudioPreference &pref, int index, PCMType type);
 
89
 
 
90
        virtual int getIndexCapture() const;
 
91
        virtual int getIndexPlayback() const;
 
92
        virtual int getIndexRingtone() const;
 
93
 
84
94
        NON_COPYABLE(PulseLayer);
85
95
 
86
96
        /**
128
138
        /** PulseAudio context and asynchronous loop */
129
139
        pa_context* context_;
130
140
        pa_threaded_mainloop* mainloop_;
 
141
        bool enumeratingSinks_;
 
142
        bool enumeratingSources_;
 
143
        AudioPreference &preference_;
131
144
 
132
145
        friend class AudioLayerTest;
133
146
};