Tizen 2.0 Release
[framework/osp/media.git] / src / FMedia_RecorderEventArg.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                        FMedia_RecorderEventArg.cpp
20  * @brief                       This file contains the implementation of event processing argument for the Recorder
21  */
22
23 #include "FMedia_RecorderEventArg.h"
24
25 namespace Tizen { namespace Media
26 {
27
28 _RecorderEventArg::_RecorderEventArg(void)
29         : __recorderEventType(_RECORDER_EVENT_NONE)
30         , __pRecordedData(null)
31         , __result(E_SUCCESS)
32         , __error(RECORDER_ERROR_NONE)
33 {
34
35 }
36
37 _RecorderEventArg::~_RecorderEventArg(void)
38 {
39         if (__pRecordedData != null)
40         {
41                 delete (Tizen::Base::ByteBuffer*) __pRecordedData;
42                 __pRecordedData = null;
43         }
44 }
45
46 void
47 _RecorderEventArg::SetEventType(_RecorderEventType eType)
48 {
49         __recorderEventType = eType;
50 }
51
52 _RecorderEventType
53 _RecorderEventArg::GetEventType(void) const
54 {
55         return __recorderEventType;
56 }
57
58 void
59 _RecorderEventArg::SetData(Tizen::Base::ByteBuffer* data)
60 {
61         __pRecordedData = data;
62 }
63
64 Tizen::Base::ByteBuffer*
65 _RecorderEventArg::GetData(void) const
66 {
67         return __pRecordedData;
68 }
69
70 result
71 _RecorderEventArg::GetResult(void) const
72 {
73         return __result;
74 }
75
76 void
77 _RecorderEventArg::SetResult(result r)
78 {
79         __result = r;
80 }
81
82 RecorderErrorReason
83 _RecorderEventArg::GetError(void) const
84 {
85         return __error;
86 }
87
88 void
89 _RecorderEventArg::SetError(RecorderErrorReason r)
90 {
91         __error = r;
92 }
93
94 }}// Tizen::Media