547ee9125f4f5b7886af7d9cd9c29ff89b61599c
[profile/ivi/ico-uxf-homescreen.git] / lib / common / CicoSound.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSound.h
13  *
14  *  @brief  This file is definition of CicoSound class
15  */
16 //==========================================================================
17 #ifndef __CICO_SOUND_H__
18 #define __CICO_SOUND_H__
19
20 #include <string>
21
22 #define ICO_CONFIG_SOUND            "sound"
23 #define ICO_CONFIG_COMMAND          "command"
24 #define ICO_CONFIG_OPERATION        "operation"
25 #define ICO_CONFIG_SUCCESS          "success"
26 #define ICO_CONFIG_FAILURE          "failure"
27
28 #define ICO_SOUND_DEFAULT_COMMAND   "paplay --stream-name=HOMESCREEN_BEEP"
29 #define ICO_SOUND_DEFAULT_OPERATION "/usr/apps/org.tizen.ico.homescreen/res/sound/operation.wav"
30 #define ICO_SOUND_DEFAULT_SUCCESS   "/usr/apps/org.tizen.ico.homescreen/res/sound/success.wav"
31 #define ICO_SOUND_DEFAULT_FAILURE   "/usr/apps/org.tizen.ico.homescreen/res/sound/failure.wav"
32
33 //--------------------------------------------------------------------------
34 /**
35  *  @brief  sound of operation function
36  */
37 //--------------------------------------------------------------------------
38 class CicoSound
39 {
40 public:
41     // get singleton instance
42     static CicoSound* GetInstance(void);
43
44     // initialized
45     bool Initialize(CicoGKeyFileConfig *hs_config);
46
47     // play sound
48     bool PlaySound(std::string & soundFile);
49
50     // play opreration sound
51     bool PlayOperationSound(void);
52
53     // play success sound
54     bool PlaySuccessSound(void);
55
56     // play failure sound
57     bool PlayFailureSound(void);
58
59 protected:
60     // default constructor
61     CicoSound();
62
63     // destructor
64     ~CicoSound();
65
66     // assignment operator
67     CicoSound operator=(const CicoSound&);
68
69     // copy constructor
70     CicoSound(const CicoSound&);
71
72 private:
73     // my instance
74     static CicoSound *m_myInstance;
75
76     // initialiezed flag
77     bool m_initialized;
78
79     // play sound command
80     std::string m_command;
81
82     // operation sound file
83     std::string m_operationSFile;
84
85     // success sound file
86     std::string m_successSFile;
87
88     // failure sound file
89     std::string m_failureSFile;
90 };
91 #endif  //__CICO_SOUND_H__
92 // vim: set expandtab ts=4 sw=4: