summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-05-09 10:39:17 (UTC)
committer mickeyl <mickeyl>2005-05-09 10:39:17 (UTC)
commitbeafdf6f2550f14bf8b6a37a25fe3224c887a42d (patch) (unidiff)
treed8dc0249d4b2f148e9d6ad24d25b1df8ddd8ec3f
parentea889d21f3b5bf846ff20a6fad9a756108a28ad7 (diff)
downloadopie-beafdf6f2550f14bf8b6a37a25fe3224c887a42d.zip
opie-beafdf6f2550f14bf8b6a37a25fe3224c887a42d.tar.gz
opie-beafdf6f2550f14bf8b6a37a25fe3224c887a42d.tar.bz2
remove bogus comment
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiemm/osoundsystem.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp
index 6c03203..2956682 100644
--- a/libopie2/opiemm/osoundsystem.cpp
+++ b/libopie2/opiemm/osoundsystem.cpp
@@ -13,100 +13,96 @@
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28 28
29*/ 29*/
30 30
31#include <opie2/osoundsystem.h> 31#include <opie2/osoundsystem.h>
32#include <opie2/odebug.h> 32#include <opie2/odebug.h>
33 33
34#include <errno.h> 34#include <errno.h>
35#include <fcntl.h> 35#include <fcntl.h>
36#include <string.h> 36#include <string.h>
37#include <sys/ioctl.h> 37#include <sys/ioctl.h>
38#include <sys/types.h> 38#include <sys/types.h>
39#include <sys/soundcard.h> 39#include <sys/soundcard.h>
40#include <sys/stat.h> 40#include <sys/stat.h>
41 41
42static const char* device_label[] = SOUND_DEVICE_LABELS; 42static const char* device_label[] = SOUND_DEVICE_LABELS;
43static int max_device_nr = sizeof device_label / sizeof (const char*); 43static int max_device_nr = sizeof device_label / sizeof (const char*);
44 44
45using namespace Opie::Core; 45using namespace Opie::Core;
46using namespace Opie::MM; 46using namespace Opie::MM;
47/*====================================================================================== 47/*======================================================================================
48 * OSoundSystem 48 * OSoundSystem
49 *======================================================================================*/ 49 *======================================================================================*/
50 50
51OSoundSystem* OSoundSystem::_instance = 0; 51OSoundSystem* OSoundSystem::_instance = 0;
52 52
53OSoundSystem::OSoundSystem() 53OSoundSystem::OSoundSystem()
54{ 54{
55 odebug << "OSoundSystem::OSoundSystem()" << oendl; 55 odebug << "OSoundSystem::OSoundSystem()" << oendl;
56 synchronize(); 56 synchronize();
57} 57}
58 58
59void OSoundSystem::synchronize() 59void OSoundSystem::synchronize()
60{ 60{
61 // gather available interfaces by inspecting /dev
62 //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
63 //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices
64
65 _interfaces.clear(); 61 _interfaces.clear();
66 _interfaces.insert( "soundcard", new OSoundCard( this, "soundcard" ) ); 62 _interfaces.insert( "soundcard", new OSoundCard( this, "soundcard" ) );
67 63
68 /* 64 /*
69 65
70 QString str; 66 QString str;
71 QFile f( "/dev/sound" ); 67 QFile f( "/dev/sound" );
72 bool hasFile = f.open( IO_ReadOnly ); 68 bool hasFile = f.open( IO_ReadOnly );
73 if ( !hasFile ) 69 if ( !hasFile )
74 { 70 {
75 odebug << "OSoundSystem: /dev/sound not existing. No sound devices available" << oendl; 71 odebug << "OSoundSystem: /dev/sound not existing. No sound devices available" << oendl;
76 return; 72 return;
77 } 73 }
78 QTextStream s( &f ); 74 QTextStream s( &f );
79 s.readLine(); 75 s.readLine();
80 s.readLine(); 76 s.readLine();
81 while ( !s.atEnd() ) 77 while ( !s.atEnd() )
82 { 78 {
83 s >> str; 79 s >> str;
84 str.truncate( str.find( ':' ) ); 80 str.truncate( str.find( ':' ) );
85 odebug << "OSoundSystem: found interface '" << str << "'" << oendl; 81 odebug << "OSoundSystem: found interface '" << str << "'" << oendl;
86 OAudioInterface* iface; 82 OAudioInterface* iface;
87 iface = new OAudioInterface( this, (const char*) str ); 83 iface = new OAudioInterface( this, (const char*) str );
88 84
89 _interfaces.insert( str, iface ); 85 _interfaces.insert( str, iface );
90 s.readLine(); 86 s.readLine();
91 } 87 }
92*/ 88*/
93} 89}
94 90
95 91
96int OSoundSystem::count() const 92int OSoundSystem::count() const
97{ 93{
98 return _interfaces.count(); 94 return _interfaces.count();
99} 95}
100 96
101 97
102OSoundCard* OSoundSystem::card( const QString& iface ) const 98OSoundCard* OSoundSystem::card( const QString& iface ) const
103{ 99{
104 return _interfaces[iface]; 100 return _interfaces[iface];
105} 101}
106 102
107 103
108OSoundSystem* OSoundSystem::instance() 104OSoundSystem* OSoundSystem::instance()
109{ 105{
110 if ( !_instance ) _instance = new OSoundSystem(); 106 if ( !_instance ) _instance = new OSoundSystem();
111 return _instance; 107 return _instance;
112} 108}