mpviewplugins/mpplaybackviewplugin/src/mpequalizerwrapper.cpp
branchGCC_SURGE
changeset 44 eff9df3d9c98
parent 30 b95ddb5a0d10
parent 42 79c49924ae23
equal deleted inserted replaced
30:b95ddb5a0d10 44:eff9df3d9c98
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: Wrapper for equalizer utility.
       
    15 *
       
    16 */
       
    17 
       
    18 // System includes
       
    19 #include <qstringlist>
       
    20 #include <qdebug>
       
    21 
       
    22 // User includes
       
    23 #include "mpequalizerwrapper.h"
       
    24 #include "mpequalizerwrapper_p.h"
       
    25 #include "mptrace.h"
       
    26 
       
    27 /*!
       
    28     \class MpEqualizerWrapper
       
    29     \ingroup musicplayer
       
    30     \brief Wrapper for equalizer utility.
       
    31     \since 10.1
       
    32     
       
    33     Playback wrapper provides Qt style interface to the audio equalizer
       
    34     utilities. Its implementation is hidden using private class data pattern.
       
    35     
       
    36     This class defines several APIs that are needed from \a MpPlaybackView
       
    37     and other components in \a mpplaybackviewplugin.
       
    38 
       
    39     \sa MpEqualizerWrapperPrivate
       
    40 */
       
    41 
       
    42 /*!
       
    43     \fn MpEqualizerWrapper::equalizerReady()
       
    44 
       
    45     This signal will be emitted when Audio Eqalizer is initialized. This is
       
    46     when all APIs, like \a applyPreset, are ready to be used.
       
    47     
       
    48     \sa MpEqualizerWrapperPrivate::MapcInitComplete
       
    49 */
       
    50 
       
    51 /*!
       
    52     Constructs a new MpEqualizerWrapper with \a parent and initializes
       
    53     private imaplementation.
       
    54 
       
    55 */
       
    56 MpEqualizerWrapper::MpEqualizerWrapper( QObject *parent )
       
    57     : QObject(parent)
       
    58 {
       
    59     TX_ENTRY
       
    60 
       
    61     d_ptr = new MpEqualizerWrapperPrivate(this);
       
    62     d_ptr->init();
       
    63 
       
    64     TX_EXIT
       
    65 }
       
    66 
       
    67 /*!
       
    68     Destructs the class and its private imaplementation.
       
    69     
       
    70  */
       
    71 MpEqualizerWrapper::~MpEqualizerWrapper()
       
    72 {
       
    73     TX_LOG
       
    74 
       
    75     delete d_ptr;
       
    76 }
       
    77 
       
    78 /*!
       
    79     Apply the preset by giving preset index. The index is starting with 0
       
    80     which if the "Off". The command then relays to its private implementation.
       
    81 
       
    82  */
       
    83 void MpEqualizerWrapper::applyPreset( int preset )
       
    84 {
       
    85     TX_ENTRY_ARGS( "Preset: " << preset );
       
    86     
       
    87 	d_ptr->applyPreset(preset);
       
    88 
       
    89     TX_EXIT
       
    90 }
       
    91 
       
    92 /*!
       
    93     Disabling the eqaulizer. The command then relays to its private implementation.
       
    94 
       
    95  */
       
    96 void MpEqualizerWrapper::disableEqualizer()
       
    97 {
       
    98     TX_ENTRY
       
    99 
       
   100     d_ptr->disableEqualizer();
       
   101 
       
   102     TX_EXIT
       
   103 }
       
   104 
       
   105 /*!
       
   106     Returning currectly activated preset. The command then relays to its private 
       
   107     implementation. -1 will be returned if the adaptation is not ready or
       
   108     no available preset.
       
   109 
       
   110  */
       
   111 int MpEqualizerWrapper::activePreset()
       
   112 {
       
   113     TX_LOG
       
   114     return d_ptr->activePreset();
       
   115 }
       
   116 
       
   117 /*!
       
   118     Returning the list of availale preset names. The command then relays to its 
       
   119     private implementation. 
       
   120 
       
   121  */
       
   122  QStringList MpEqualizerWrapper::presetNames()
       
   123 {
       
   124     TX_ENTRY_ARGS( "Names=" << d_ptr->presetNames());
       
   125 
       
   126     return d_ptr->presetNames();
       
   127 }
       
   128 
       
   129  //End of File