summaryrefslogtreecommitdiff
path: root/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
Unidiff
Diffstat (limited to 'examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp b/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
new file mode 100644
index 0000000..f74a1b9
--- a/dev/null
+++ b/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
@@ -0,0 +1,66 @@
1/*
2 =. This file is part of the Opie Project
3 .=l. Copyright (C) 2004 Opie Team <opie-devel@handhelds.org>
4 .>+-=
5 _;:, .> :=|. This library is free software; you can
6.> <`_, > . <= redistribute it and/or modify it under
7:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This library is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29/* OPIE */
30#include <opie2/osoundsystem.h>
31#include <opie2/odebug.h>
32
33using namespace Opie::MM;
34
35int main( int argc, char** argv )
36{
37 odebug << "OPIE Sound System Demo" << oendl;
38
39 OSoundSystem* sound = OSoundSystem::instance();
40
41 OSoundSystem::CardIterator it = sound->iterator();
42/*
43 while ( it.current() )
44 {
45 odebug << "DEMO: OSoundSystem contains Interface '" << it.current()->name() << "'" << oendl;
46 ++it;
47 }
48
49*/
50 OSoundCard* card = it.current();
51
52 OMixerInterface* mixer = card->mixer();
53
54 QStringList channels = mixer->allChannels();
55
56 for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it )
57 {
58 bool stereo = mixer->isStereo( *it );
59 odebug << "OSSDEMO: Mixer has channel " << *it << ( stereo ? "[stereo]" : "[mono]" ) << oendl;
60 odebug << "OSSDEMO: +--- volume " << ( mixer->volume( *it ) & 0xff )
61 << " (left) | " << ( mixer->volume( *it ) >> 8 ) << " (right)" << oendl;
62 }
63
64 return 0;
65
66}