00001 /* 00002 =. This file is part of the Opie Project 00003 .=l. Copyright (C) 2004 Opie Team <opie-devel@handhelds.org> 00004 .>+-= 00005 _;:, .> :=|. This library is free software; you can 00006 .> <`_, > . <= redistribute it and/or modify it under 00007 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00008 .="- .-=="i, .._ License as published by the Free Software 00009 - . .-<_> .<> Foundation; either version 2 of the License, 00010 ._= =} : or (at your option) any later version. 00011 .%`+i> _;_. 00012 .i_,=:_. -<s. This library is distributed in the hope that 00013 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00014 : .. .:, . . . without even the implied warranty of 00015 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00016 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00017 ..}^=.= = ; Library General Public License for more 00018 ++= -. .` .: details. 00019 : = ...= . :.=- 00020 -. .:....=;==+<; You should have received a copy of the GNU 00021 -_. . . )=. = Library General Public License along with 00022 -- :-=` this library; see the file COPYING.LIB. 00023 If not, write to the Free Software Foundation, 00024 Inc., 59 Temple Place - Suite 330, 00025 Boston, MA 02111-1307, USA. 00026 00027 */ 00028 00029 /* OPIE */ 00030 #include <opie2/osoundsystem.h> 00031 #include <opie2/odebug.h> 00032 00033 using namespace Opie::MM; 00034 00035 int main( int argc, char** argv ) 00036 { 00037 odebug << "OPIE Sound System Demo" << oendl; 00038 00039 OSoundSystem* sound = OSoundSystem::instance(); 00040 00041 OSoundSystem::CardIterator it = sound->iterator(); 00042 /* 00043 while ( it.current() ) 00044 { 00045 odebug << "DEMO: OSoundSystem contains Interface '" << it.current()->name() << "'" << oendl; 00046 ++it; 00047 } 00048 00049 */ 00050 OSoundCard* card = it.current(); 00051 OMixerInterface* mixer = card->mixer(); 00052 odebug << "This device " << ( mixer->hasMultipleRecording() ? "does" : "does not" ) << " feature multiple recording sources." << oendl; 00053 00054 QStringList channels = mixer->allChannels(); 00055 00056 for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) 00057 { 00058 bool stereo = mixer->isStereo( *it ); 00059 bool recsrc = mixer->isRecordable( *it ); 00060 QString line = "OSSDEMO: Mixer has channel " + *it + " "; 00061 line = line.leftJustify( 50 ) + ( stereo ? "[stereo]" : "[mono]" ); 00062 line = line.leftJustify( 60 ) + ( recsrc ? "[recsrc]" : "[ ]" ); 00063 line = line.leftJustify( 70 ); 00064 line += " [ " + QString::number( mixer->volume( *it ) & 0xff ).rightJustify( 3 ); 00065 if ( stereo ) line += " | " + QString::number( mixer->volume( *it ) >> 8 ).rightJustify( 3 ); 00066 line += " ]"; 00067 odebug << line << oendl; 00068 } 00069 00070 return 0; 00071 00072 }
1.4.2