controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp
author hgs
Fri, 25 Jun 2010 17:12:20 +0800
changeset 22 a5692c68d772
parent 21 2883a5458389
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 * 
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 * 
hgs
parents:
diff changeset
    14
 * Description:
hgs
parents:
diff changeset
    15
 *     The source file for tone fetcher engine.
hgs
parents:
diff changeset
    16
 *     
hgs
parents:
diff changeset
    17
 */
hgs
parents:
diff changeset
    18
#include "tonefetcherengine.h"
22
hgs
parents: 21
diff changeset
    19
#ifdef Q_OS_SYMBIAN
hgs
parents: 21
diff changeset
    20
#include "tonefetcherengine_symbian.h"
hgs
parents: 21
diff changeset
    21
#else
hgs
parents: 21
diff changeset
    22
#include "tonefetcherengine_stub.h"
hgs
parents: 21
diff changeset
    23
#endif
19
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
ToneFetcherEngine::ToneFetcherEngine(QObject* parent) : QObject(parent)
hgs
parents:
diff changeset
    26
{
22
hgs
parents: 21
diff changeset
    27
    d = new ToneFetcherEnginePrivate();
19
hgs
parents:
diff changeset
    28
    Q_ASSERT(d);
22
hgs
parents: 21
diff changeset
    29
    
19
hgs
parents:
diff changeset
    30
    connect(d, SIGNAL(mdeSessionOpened()), 
hgs
parents:
diff changeset
    31
            this, SIGNAL(mdeSessionOpened()));
hgs
parents:
diff changeset
    32
    connect(d, SIGNAL(mdeSessionError(int)),
hgs
parents:
diff changeset
    33
            this, SIGNAL(mdeSessionError(int)));
22
hgs
parents: 21
diff changeset
    34
    connect(d, SIGNAL(queryComplete(QStringList)),
hgs
parents: 21
diff changeset
    35
            this, SIGNAL(queryComplete(QStringList)));
19
hgs
parents:
diff changeset
    36
    connect(d, SIGNAL(queryError(int)),
hgs
parents:
diff changeset
    37
            this, SIGNAL(queryError(int)));
hgs
parents:
diff changeset
    38
    connect(d, SIGNAL(notifyObjectChanged()),
22
hgs
parents: 21
diff changeset
    39
            this, SIGNAL(notifyObjectChanged()));    
hgs
parents: 21
diff changeset
    40
    connect(d, SIGNAL(notifyPreviewEvent(int)),
hgs
parents: 21
diff changeset
    41
            this, SIGNAL(notifyPreviewEvent(int)));
19
hgs
parents:
diff changeset
    42
}
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
ToneFetcherEngine::~ToneFetcherEngine()
hgs
parents:
diff changeset
    45
{
hgs
parents:
diff changeset
    46
    delete d;
hgs
parents:
diff changeset
    47
}
hgs
parents:
diff changeset
    48
22
hgs
parents: 21
diff changeset
    49
void ToneFetcherEngine::getTones()
19
hgs
parents:
diff changeset
    50
{
22
hgs
parents: 21
diff changeset
    51
    d->getTones();
19
hgs
parents:
diff changeset
    52
}
hgs
parents:
diff changeset
    53
22
hgs
parents: 21
diff changeset
    54
void ToneFetcherEngine::play(const QString &file)
hgs
parents: 21
diff changeset
    55
{    
hgs
parents: 21
diff changeset
    56
    d->play(file);
19
hgs
parents:
diff changeset
    57
}
hgs
parents:
diff changeset
    58
22
hgs
parents: 21
diff changeset
    59
bool ToneFetcherEngine::isPlaying()
19
hgs
parents:
diff changeset
    60
{
22
hgs
parents: 21
diff changeset
    61
    return d->isPlaying();
19
hgs
parents:
diff changeset
    62
}
21
hgs
parents: 19
diff changeset
    63
22
hgs
parents: 21
diff changeset
    64
void ToneFetcherEngine::stopPlaying()
21
hgs
parents: 19
diff changeset
    65
{
22
hgs
parents: 21
diff changeset
    66
    d->stopPlaying();
21
hgs
parents: 19
diff changeset
    67
}
hgs
parents: 19
diff changeset
    68
19
hgs
parents:
diff changeset
    69
//End of File