summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 26c6dca..129215b 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -710,76 +710,80 @@ void ODevice::virtual_hook(int, void* ){
710 710
711} 711}
712 712
713/** 713/**
714 * Sends a QCOP message to channel QPE/System 714 * Sends a QCOP message to channel QPE/System
715 * with the message "aboutToSuspend()" if this 715 * with the message "aboutToSuspend()" if this
716 * is the windowing server 716 * is the windowing server
717 */ 717 */
718void ODevice::sendSuspendmsg() 718void ODevice::sendSuspendmsg()
719{ 719{
720 if ( isQWS() ) 720 if ( isQWS() )
721 return; 721 return;
722 722
723 QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); 723 QCopEnvelope ( "QPE/System", "aboutToSuspend()" );
724} 724}
725 725
726/** 726/**
727 * \brief Prepend the QWSServer::KeyboardFilter to the list of installed KeyFilters 727 * \brief Prepend the QWSServer::KeyboardFilter to the list of installed KeyFilters
728 * 728 *
729 * Prepend a QWSServer::KeyboardFilter to the List of Keyboard 729 * Prepend a QWSServer::KeyboardFilter to the List of Keyboard
730 * Filters. This function is the only way to prepend a KeyFilter. 730 * Filters. This function is the only way to prepend a KeyFilter.
731 * 731 *
732 * @param aFilter The KeyFilter to be prepended to the list of filters 732 * @param aFilter The KeyFilter to be prepended to the list of filters
733 * 733 *
734 * @see Opie::Core::OKeyFilter 734 * @see Opie::Core::OKeyFilter
735 * @see Opie::Core::OKeyFilter::inst() 735 * @see Opie::Core::OKeyFilter::inst()
736 */ 736 */
737void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) 737void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter)
738{ 738{
739 Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); 739 Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter);
740} 740}
741 741
742/** 742/**
743 * \brief Remove the QWSServer::KeyboardFilter in the param from the list 743 * \brief Remove the QWSServer::KeyboardFilter in the param from the list
744 * 744 *
745 * Remove the QWSServer::KeyboardFilter \par aFilter from the List 745 * Remove the QWSServer::KeyboardFilter \par aFilter from the List
746 * of Keyfilters. Call this when you delete the KeyFilter! 746 * of Keyfilters. Call this when you delete the KeyFilter!
747 * 747 *
748 * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter 748 * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter
749 * @see Opie::Core::ODevice::addPreHandler 749 * @see Opie::Core::ODevice::addPreHandler
750 */ 750 */
751void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) 751void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter)
752{ 752{
753 Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); 753 Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter);
754} 754}
755 755
756void ODevice::playingStopped() { 756void ODevice::playingStopped() {
757 const_cast<QObject*>(sender())->disconnect( this ); 757 const_cast<QObject*>(sender())->disconnect( this );
758#ifndef QT_NO_SOUND
758 if ( d->m_sound >= 0 ) { 759 if ( d->m_sound >= 0 ) {
759 ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); 760 ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol );
760 ::close ( d->m_sound ); 761 ::close ( d->m_sound );
761 } 762 }
763#endif
762} 764}
763 765
764void ODevice::changeMixerForAlarm( int mixer, const char* file, Sound *snd ) { 766void ODevice::changeMixerForAlarm( int mixer, const char* file, Sound *snd ) {
767#ifndef QT_NO_SOUND
765 if (( d->m_sound = ::open ( file, O_RDWR )) >= 0 ) { 768 if (( d->m_sound = ::open ( file, O_RDWR )) >= 0 ) {
766 if ( ::ioctl ( d->m_sound, MIXER_READ( mixer ), &d->m_vol ) >= 0 ) { 769 if ( ::ioctl ( d->m_sound, MIXER_READ( mixer ), &d->m_vol ) >= 0 ) {
767 Config cfg ( "qpe" ); 770 Config cfg ( "qpe" );
768 cfg. setGroup ( "Volume" ); 771 cfg. setGroup ( "Volume" );
769 772
770 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); 773 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
771 if ( volalarm < 0 ) 774 if ( volalarm < 0 )
772 volalarm = 0; 775 volalarm = 0;
773 else if ( volalarm > 100 ) 776 else if ( volalarm > 100 )
774 volalarm = 100; 777 volalarm = 100;
775 volalarm |= ( volalarm << 8 ); 778 volalarm |= ( volalarm << 8 );
776 779
777 if ( ::ioctl ( d->m_sound, MIXER_WRITE( mixer ), &volalarm ) >= 0 ) 780 if ( ::ioctl ( d->m_sound, MIXER_WRITE( mixer ), &volalarm ) >= 0 )
778 register_qpe_sound_finished(snd, this, SLOT(playingStopped())); 781 register_qpe_sound_finished(snd, this, SLOT(playingStopped()));
779 } 782 }
780 d->m_mixer = mixer; 783 d->m_mixer = mixer;
781 } 784 }
785#endif
782} 786}
783 787
784} 788}
785} 789}