Merge "seek expection handling bug" into tizen_2.2
[platform/framework/native/media.git] / src / FMedia_AudioRouteInfoImpl.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 #include <FBaseSysLog.h>
20 #include "FMedia_AudioRouteInfoImpl.h"
21 using namespace Tizen::Base;
22
23 namespace Tizen { namespace Media
24 {
25
26 _AudioRouteInfoImpl::_AudioRouteInfoImpl(InputAudioDevice in, OutputAudioDevice out)
27         : __in(in)
28         , __out(out)
29 {
30 }
31
32 _AudioRouteInfoImpl::~_AudioRouteInfoImpl()
33 {
34 }
35
36 _AudioRouteInfoImpl::_AudioRouteInfoImpl(const _AudioRouteInfoImpl& rhs)
37 {
38         __in = rhs.__in;
39         __out = rhs.__out;
40 }
41
42 void
43 _AudioRouteInfoImpl::SetInputAudioDevice(InputAudioDevice in)
44 {
45         __in = in;
46 }
47
48 void
49 _AudioRouteInfoImpl::SetOutputAudioDevice(OutputAudioDevice out)
50 {
51         __out = out;
52 }
53
54 InputAudioDevice
55 _AudioRouteInfoImpl::GetInputAudioDevice(void) const
56 {
57         return __in;
58 }
59
60 OutputAudioDevice
61 _AudioRouteInfoImpl::GetOutputAudioDevice(void) const
62 {
63         return __out;
64 }
65
66 _AudioRouteInfoImpl&
67 _AudioRouteInfoImpl::operator =(const _AudioRouteInfoImpl& rhs)
68 {
69         if (this == &rhs)
70         {
71                 return *this;
72         }
73         this->__in = rhs.__in;
74         this->__out = rhs.__out;
75
76         return *this;
77 }
78
79 bool
80 _AudioRouteInfoImpl::Equals(const Object& obj) const
81 {
82         const _AudioRouteInfoImpl *pRhs = dynamic_cast<const _AudioRouteInfoImpl *>(&obj);
83         if (pRhs == null)
84         {
85                 return false;
86         }
87         return ((__in == pRhs->__in) && (__out == pRhs->__out));
88
89 }
90
91 int
92 _AudioRouteInfoImpl::GetHashCode(void) const
93 {
94         return __in + __out;
95 }
96
97 };
98 };