summaryrefslogtreecommitdiff
path: root/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
Unidiff
Diffstat (limited to 'libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
new file mode 100644
index 0000000..79bf327
--- a/dev/null
+++ b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
@@ -0,0 +1,32 @@
1#include <opie2/osoundsystem.h>
2
3int main( int argc, char** argv )
4{
5 qDebug( "OPIE Sound System Demo" );
6
7 OSoundSystem* sound = OSoundSystem::instance();
8
9 OSoundSystem::CardIterator it = sound->iterator();
10/*
11 while ( it.current() )
12 {
13 qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() );
14 ++it;
15 }
16
17*/
18 OSoundCard* card = it.current();
19
20 OMixerInterface* mixer = card->mixer();
21
22 QStringList channels = mixer->allChannels();
23
24 for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it )
25 {
26 qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it );
27 qDebug( "OSSDEMO: +--- volume %d (left) | %d (right)", mixer->volume( *it ) & 0xff, mixer->volume( *it ) >> 8 );
28 }
29
30 return 0;
31
32}