17 */ |
17 */ |
18 |
18 |
19 #ifndef TONEFETCHERENGINE_H |
19 #ifndef TONEFETCHERENGINE_H |
20 #define TONEFETCHERENGINE_H |
20 #define TONEFETCHERENGINE_H |
21 #include <QObject> |
21 #include <QObject> |
22 #include "toneselectionengine_p.h" |
|
23 #include <QStringList> |
22 #include <QStringList> |
24 class TonePreviewPrivate; |
23 |
25 class ToneSelectionEnginePrivate; |
24 class ToneFetcherEnginePrivate; |
26 |
25 |
27 // CLASS DECLARATION |
26 // CLASS DECLARATION |
28 /** |
27 /** |
29 * This class is used for interacting with platform based codes |
28 * This class is used for interacting with platform based codes |
30 * including fetching tones from MDE (Metadata Engine) and previewing tones |
29 * including fetching tones from MDE (Metadata Engine) and playing tones |
31 * using platform-dependant interface. |
30 * using platform-dependant interface. |
32 * |
31 * |
33 */ |
32 */ |
34 class ToneFetcherEngine : public QObject |
33 class ToneFetcherEngine : public QObject |
35 { |
34 { |
36 Q_OBJECT |
35 Q_OBJECT |
37 |
36 |
38 public: |
37 public: |
39 enum TMediaFileListAttribute { |
|
40 // max media file size |
|
41 EAttrFileSize = 0, |
|
42 // ringing volume (TProfileRingingVolume from Profile.hrh) |
|
43 EAttrVolume, |
|
44 // ringing type, (TProfileRingingType from Profile.hrh) |
|
45 EAttrRingingType, |
|
46 // vibra on/off (Boolean) |
|
47 EAttrVibra, |
|
48 // 3D effect (TProfile3DToneEffect from ProfileInternal.hrh) |
|
49 EAttr3DEffect, |
|
50 // 3D echo (TProfile3DToneEcho from ProfileInternal.hrh) |
|
51 EAttr3DEcho, |
|
52 // excluded mime type text |
|
53 EAttrExcludeMimeType, |
|
54 // for file protection checking |
|
55 EAttrAutomatedType, |
|
56 // media file dialog title |
|
57 EAttrTitle, |
|
58 // excluded folder (see enum TFolderType) |
|
59 EAttrExcludeFolder |
|
60 }; |
|
61 |
|
62 enum State { |
|
63 SessionConnected = 0, |
|
64 SessionError |
|
65 }; |
|
66 |
|
67 enum TPreviewEvent { |
|
68 EAudioPreviewComplete, |
|
69 EPreviewError |
|
70 }; |
|
71 explicit ToneFetcherEngine( QObject* parent = 0 ); |
38 explicit ToneFetcherEngine( QObject* parent = 0 ); |
72 ~ToneFetcherEngine(); |
39 ~ToneFetcherEngine(); |
73 /* |
40 /* |
74 * search the tone using MDE, not including rom files. |
41 * search the tone using MDE, not including rom files. |
75 */ |
42 */ |
76 void getTone(); |
43 void getTones(); |
77 |
44 |
78 /* |
45 /* |
79 * preview the tone |
46 * preview the tone |
80 * @param file the absolute path of the file. |
47 * @param file the absolute path of the file. |
81 */ |
48 */ |
82 void preview(const QString &file); |
49 void play(const QString &file); |
83 |
50 |
84 bool IsPlaying(); |
51 bool isPlaying(); |
|
52 |
|
53 /* |
|
54 * stop playing |
|
55 */ |
|
56 void stopPlaying(); |
|
57 |
85 signals: |
58 signals: |
86 void mdeSessionOpened(); |
59 void mdeSessionOpened(); |
87 void mdeSessionError(int error); |
60 void mdeSessionError(int error); |
88 void queryComplete(const QStringList &nameList, const QStringList &uriList); |
61 void queryComplete(const QStringList &uriList); |
89 void queryError(int error); |
62 void queryError(int error); |
90 void notifyPreviewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId); |
63 void notifyPreviewEvent(int event); |
91 void notifyObjectChanged(); |
64 void notifyObjectChanged(); |
|
65 |
92 private: |
66 private: |
93 ToneSelectionEnginePrivate *d; |
67 ToneFetcherEnginePrivate *d; |
94 TonePreviewPrivate *mAudioPlayer; |
|
95 }; |
68 }; |
96 #endif |
69 #endif |