wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Content / JSVideo.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 2a7e7cd..500a619
@@ -15,8 +15,6 @@
 // limitations under the License.
 //
 
-
-#include <dpl/log/log.h>
 #include <CommonsJavaScript/Converter.h>
 #include <CommonsJavaScript/JSUtils.h>
 #include <JSTizenException.h>
@@ -26,6 +24,7 @@
 #include "ContentConverter.h"
 #include "JSVideo.h"
 #include "JSUtil.h"
+#include <Logger.h>
 
 #define TIZEN_CONTENT_VIDEO_ATTRIBUTENAME      "VideoContent"
 #define TIZEN_CONTENT_VIDEO_GEOLOCATION                "geolocation"
@@ -80,17 +79,17 @@ JSClassRef JSVideo::m_jsClassRef = JSClassCreate(JSVideo::getClassInfo());
 
 void JSVideo::initialize(JSContextRef context, JSObjectRef object)
 {
-    LogDebug( "entered" );
+    LoggerD( "entered" );
     VideoPrivObject *priv = static_cast<VideoPrivObject*>( JSObjectGetPrivate( object ) );
     if (!priv)
     {
         MediacontentVideoPtr privateData(new MediacontentVideo());
         priv = new VideoPrivObject(context, privateData);
         JSObjectSetPrivate(object, static_cast<void*>(priv));
-        LogDebug("new pravite object is created" );
+        LoggerD("new pravite object is created" );
     }
     else {
-        LogDebug("private object already exists");
+        LoggerD("private object already exists");
                MediacontentVideoPtr video = getVideoObject(object);
                DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(video->getVideoLatitude(),video->getVideoLongitude()));
                JSUtil::setProperty(context, object, TIZEN_CONTENT_VIDEO_GEOLOCATION,
@@ -101,7 +100,7 @@ void JSVideo::initialize(JSContextRef context, JSObjectRef object)
 
 void JSVideo::finalize(JSObjectRef object)
 {
-    LogDebug( "entered" );
+    LoggerD( "entered" );
        VideoPrivObject *priv =  static_cast<VideoPrivObject*>( JSObjectGetPrivate( object ) ) ;
        if (priv != NULL)
        {
@@ -116,7 +115,7 @@ void JSVideo::finalize(JSObjectRef object)
 
 const JSClassRef JSVideo::getClassRef()
 {
-       LogDebug("JSVideo::getClassRef()");
+       LoggerD("JSVideo::getClassRef()");
 
     if (!m_jsClassRef)
     {
@@ -132,7 +131,7 @@ const JSClassDefinition* JSVideo::getClassInfo()
 
 MediacontentVideoPtr JSVideo::getVideoObject(JSObjectRef object)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     VideoPrivObject *priv = static_cast<VideoPrivObject*>(JSObjectGetPrivate(object));
     if(!priv)
     {
@@ -152,7 +151,7 @@ JSValueRef JSVideo::getPropertyGeoLocation(
                                                                        JSStringRef propertyName,
                                                                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -162,7 +161,7 @@ JSValueRef JSVideo::getPropertyGeoLocation(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -174,7 +173,7 @@ bool JSVideo::setPropertyGeoLocation(
                                        JSValueRef value,
                                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
                Converter converter(context);
@@ -191,7 +190,7 @@ bool JSVideo::setPropertyGeoLocation(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
                return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR);
     }
        return false;
@@ -204,7 +203,7 @@ JSValueRef JSVideo::getPropertyAlbum(
                                                                JSStringRef propertyName, 
                                                                JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
                Converter converter(context);
@@ -215,7 +214,7 @@ JSValueRef JSVideo::getPropertyAlbum(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -227,7 +226,7 @@ JSValueRef JSVideo::getPropertyArtist(
                                                                JSStringRef propertyName, 
                                                                JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
                Converter converter(context);
@@ -239,7 +238,7 @@ JSValueRef JSVideo::getPropertyArtist(
 
                for( unsigned int i=0; i < video->getVideoArtist().size(); i++) {
                        string artist = video->getVideoArtist().at(i);
-                       LogDebug("artist : "  << artist);
+                       LoggerD("artist : "  << artist);
                        JSValueRef val = converter.toJSValueRef(artist);
 
                        if(!JSSetArrayElement(context, jsResult, i, val)){
@@ -249,7 +248,7 @@ JSValueRef JSVideo::getPropertyArtist(
                return jsResult;
     }
        Catch(Exception){
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -261,7 +260,7 @@ JSValueRef JSVideo::getPropertyDuration(
                                                                JSStringRef propertyName,
                                                                JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -272,7 +271,7 @@ JSValueRef JSVideo::getPropertyDuration(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeUndefined(context);
 }
@@ -283,7 +282,7 @@ JSValueRef JSVideo::getPropertyWidth(
                                                                JSStringRef propertyName,
                                                                JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -294,7 +293,7 @@ JSValueRef JSVideo::getPropertyWidth(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeUndefined(context);
 }
@@ -306,7 +305,7 @@ JSValueRef JSVideo::getPropertyHeight(
                                                                JSStringRef propertyName,
                                                                JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -317,7 +316,7 @@ JSValueRef JSVideo::getPropertyHeight(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeUndefined(context);
 }
@@ -329,7 +328,7 @@ bool JSVideo::setPropertyArtists(
                                        JSValueRef value,
                                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -354,7 +353,7 @@ bool JSVideo::setPropertyArtists(
     }
        Catch(Exception)
        {
-           LogWarning("trying to set incorrect value");
+           LoggerW("trying to set incorrect value");
            DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
        }
        return false;
@@ -367,7 +366,7 @@ bool JSVideo::setPropertyAlbum(
                                        JSValueRef value,
                                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -381,7 +380,7 @@ bool JSVideo::setPropertyAlbum(
        }
     Catch(Exception)
     {
-        LogWarning("trying to set incorrect value");
+        LoggerW("trying to set incorrect value");
         DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
     }
        return false;