~ubuntu-branches/ubuntu/maverick/ekiga/maverick

« back to all changes in this revision

Viewing changes to src/devices/audiodev.h

  • Committer: Bazaar Package Importer
  • Author(s): Eugen Dedu, Eugen Dedu, Loic Minier
  • Date: 2008-09-27 10:00:00 UTC
  • mfrom: (1.1.8 upstream)
  • mto: (1.4.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20080927100000-l5k5werb6czr5b3h
Tags: 3.0.1-1
[ Eugen Dedu ]
* New version.  (Closes: #500089).
* Add our own changelog file in /usr/share/doc.
* Remove gnomemeeting transitional package.
* Discover new interfaces.  (Closes: #488199).
* Compile with dbus support.  (Closes: #467212).
* Numeric keypad inserts digits at correct position.  (Closes: #440159).
* Use libnotify upon call.  (Closes: #412604).
* Symlink identical GNOME help files, to reduce size.  (Closes: #505536).
* Explicitely build-depends on a few dev packages, even if they were
  pulled out anyway by the other dependencies.

[ Loic Minier ]
* Use clean:: instead of clean: in rules.
* Don't disable Uploaders: generation for control.in -> control generation
  in rules.
* Fix some tabs which were size 4 anyway.
* Generate a PO template during build by calling intltool-update -p in
  install; thanks Ubuntu and Martin Pitt; closes: #505535.
* Also let the -dbg depend on ${misc:Depends}.
* Cleanup rules; in particular, use dpkg-parsechangelog and honor
  distclean/clean failures, remove old clean rules, commented out stuff,
  gtk-only stuff.
* Pass -s to dh_* in binary-arch.
* Use debian/*.links and debian/*.manpages instead of symlink manually or
  passing files to dh_installman.
* Use ftp.gnome.org in copyright.
* Switch to quilt and fix target deps in the process; build-dep on quilt
  instead of dpatch; rename news.dpatch to 00_news.patch and refresh;
  replace 00list with series.
* Install autotools-dev config.guess and .sub after patching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* Ekiga -- A VoIP and Video-Conferencing application
 
3
 * Copyright (C) 2000-2008 Damien Sandras
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program 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
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software Foundation,
 
17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
18
 *
 
19
 *
 
20
 * Ekiga is licensed under the GPL license and as a special exception,
 
21
 * you have permission to link or otherwise combine this program with the
 
22
 * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
 
23
 * without applying the requirements of the GNU GPL to the OPAL, OpenH323
 
24
 * and PWLIB programs, as long as you do follow the requirements of the
 
25
 * GNU GPL for all the rest of the software thus combined.
 
26
 */
 
27
 
 
28
 
 
29
/*
 
30
 *                         audiodev.h  -  description
 
31
 *                         --------------------------------
 
32
 *   begin                : Thu Mar 06 2008
 
33
 *   copyright            : (C) 2008 by Matthias Schneider
 
34
 *   description          : Audio dummy device to allow opal make use of 
 
35
 *                          the Ekiga Engine 
 
36
 *
 
37
 */
 
38
 
 
39
#ifndef _EKIGA_AUDIO_DEVICE_H_
 
40
#define _EKIGA_AUDIO_DEVICE_H_
 
41
 
 
42
#include <ptlib.h>
 
43
#include <ptlib/sound.h>
 
44
 
 
45
#include "audioinput-core.h"
 
46
#include "audiooutput-core.h"
 
47
 
 
48
class PSoundChannel_EKIGA : public PSoundChannel {
 
49
  PCLASSINFO(PSoundChannel_EKIGA, PSoundChannel); 
 
50
public:
 
51
  PSoundChannel_EKIGA(Ekiga::ServiceCore & core);
 
52
  PSoundChannel_EKIGA(const PString &device,
 
53
                   PSoundChannel::Directions dir,
 
54
                   unsigned numChannels,
 
55
                   unsigned sampleRate,
 
56
                   unsigned bitsPerSample,
 
57
                   Ekiga::ServiceCore & _core);
 
58
  ~PSoundChannel_EKIGA();
 
59
  static PString GetDefaultDevice(PSoundChannel::Directions);
 
60
  bool Open(const PString & _device,
 
61
       Directions _dir,
 
62
       unsigned _numChannels,
 
63
       unsigned _sampleRate,
 
64
       unsigned _bitsPerSample);
 
65
  bool Close();
 
66
  bool Write(const void * buf, PINDEX len);
 
67
  bool Read(void * buf, PINDEX len);
 
68
  unsigned GetChannels() const;
 
69
  unsigned GetSampleRate() const;
 
70
  unsigned GetSampleSize() const;
 
71
  bool SetBuffers(PINDEX size, PINDEX count);
 
72
  bool GetBuffers(PINDEX & size, PINDEX & count);
 
73
  bool IsOpen() const;
 
74
 
 
75
 private:
 
76
 
 
77
  PSoundChannel::Directions direction;
 
78
  PString device;
 
79
  unsigned mNumChannels;
 
80
  unsigned mSampleRate;
 
81
  unsigned mBitsPerSample;
 
82
  bool isInitialised;
 
83
 
 
84
  PMutex device_mutex;
 
85
 
 
86
  /**number of 30 (or 20) ms long sound intervals stored by EKIGA. Typically, 2.*/
 
87
  PINDEX storedPeriods;
 
88
 
 
89
  /**Total number of bytes of audio stored by EKIGA.  Typically, 2*480 or 960.*/
 
90
  PINDEX storedSize;
 
91
 
 
92
  PINDEX storedVolume;
 
93
 
 
94
  Ekiga::ServiceCore & core;
 
95
  Ekiga::AudioInputCore & audioinput_core;
 
96
  Ekiga::AudioOutputCore & audiooutput_core;
 
97
  bool opened;
 
98
};
 
99
 
 
100
#endif