[Tizen] temporal API to make users use Container class
[platform/core/csapi/nui.git] / NUISamples / examples / ttsplayer-test.cs
1 /*
2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18 using System;
19 using Tizen.NUI;
20
21 namespace TTSPlayerTest
22 {
23     class Example : NUIApplication
24     {
25         public Example() : base()
26         {
27         }
28
29         public Example(string stylesheet) : base(stylesheet)
30         {
31         }
32
33         public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
34         {
35         }
36
37         protected override void OnCreate()
38         {
39             base.OnCreate();
40             Initialize();
41         }
42
43         public void Initialize()
44         {
45             Window window = Window.Instance;
46             window.BackgroundColor = Color.White;
47
48             TTSPlayer ttsPlayer = TTSPlayer.Get(TTSPlayer.TTSMode.Default);
49             ttsPlayer.Play("tts player test");
50
51             ttsPlayer.StateChanged += (s, e) =>
52             {
53                 Tizen.Log.Debug("NUI", "TTS state changed!!!");
54             };
55             ttsPlayer.Pause();
56             ttsPlayer.Resume();
57             ttsPlayer.Stop();
58             Tizen.Log.Debug("NUI", "TTS state: " + ttsPlayer.GetState());
59         }
60
61         [STAThread]
62         static void _Main(string[] args)
63         {
64             Example example = new Example();
65             example.Run(args);
66         }
67     }
68 }