summaryrefslogtreecommitdiff
path: root/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
blob: 8d421fdc3259e07ddbe041471bb8cd45f7354241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <opie2/osoundsystem.h>

using namespace Opie::MM;

int main( int argc, char** argv )
{
    qDebug( "OPIE Sound System Demo" );

    OSoundSystem* sound = OSoundSystem::instance();

    OSoundSystem::CardIterator it = sound->iterator();
/*
    while ( it.current() )
    {
        qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() );
        ++it;
    }

*/
    OSoundCard* card = it.current();

    OMixerInterface* mixer = card->mixer();

    QStringList channels = mixer->allChannels();

    for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it )
    {
        qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it );
        qDebug( "OSSDEMO:              +--- volume %d (left) | %d (right)", mixer->volume( *it ) & 0xff, mixer->volume( *it ) >> 8 );
    }

    return 0;

}