wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Content / JSAudio.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 762b5fc..8a48a29
@@ -15,8 +15,6 @@
 // limitations under the License.
 //
 
-
-#include <dpl/log/log.h>
 #include <CommonsJavaScript/PrivateObject.h>
 #include <CommonsJavaScript/Converter.h>
 #include <CommonsJavaScript/JSUtils.h>
@@ -28,7 +26,7 @@
 #include "ContentConverter.h"
 #include "AudioLyricsUtil.h"
 #include "ContentUtility.h"
-
+#include <Logger.h>
 
 #define TIZEN_CONTENT_AUDIO_ATTRIBUTENAME      "AudioContent"
 #define TIZEN_CONTENT_AUDIO_ALBUM                      "album"
@@ -88,23 +86,23 @@ JSClassRef JSAudio::m_jsClassRef = JSClassCreate(JSAudio::getClassInfo());
 
 void JSAudio::initialize(JSContextRef context, JSObjectRef object)
 {
-    LogDebug( "entered" );
+    LoggerD( "entered" );
     AudioPrivObject *priv = static_cast<AudioPrivObject*>( JSObjectGetPrivate( object ) );
     if (!priv)
     {
         MediacontentAudioPtr privateData(new MediacontentAudio());
         priv = new AudioPrivObject(context, privateData);
         JSObjectSetPrivate(object, static_cast<void*>(priv));
-        LogDebug("new Private Object is created" );
+        LoggerD("new Private Object is created" );
     }
     else {
-        LogDebug("private object already exists");
+        LoggerD("private object already exists");
     }
 }
 
 void JSAudio::finalize(JSObjectRef object)
 {
-    LogDebug( "entered" );
+    LoggerD( "entered" );
        AudioPrivObject *priv =  static_cast<AudioPrivObject*>( JSObjectGetPrivate( object ) ) ;
        if (priv != NULL)
        {
@@ -116,7 +114,7 @@ void JSAudio::finalize(JSObjectRef object)
 
 const JSClassRef JSAudio::getClassRef()
 {
-       LogDebug("JSAudio::getClassRef()");
+       LoggerD("JSAudio::getClassRef()");
 
     if (!m_jsClassRef) 
     {
@@ -133,7 +131,7 @@ const JSClassDefinition* JSAudio::getClassInfo()
 
 MediacontentAudioPtr JSAudio::getAudioObject(JSObjectRef object)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     AudioPrivObject *priv = static_cast<AudioPrivObject*>(JSObjectGetPrivate(object));
     if(!priv) 
     {
@@ -153,7 +151,7 @@ JSValueRef JSAudio::getPropertyAlbum(
                        JSStringRef propertyName,
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -164,7 +162,7 @@ JSValueRef JSAudio::getPropertyAlbum(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -175,7 +173,7 @@ JSValueRef JSAudio::getPropertyArtist(
                                JSStringRef propertyName,
                                JSValueRef* exception)
 {
-    LogDebug("getPropertyArtist::entered");
+    LoggerD("getPropertyArtist::entered");
     Try
     {  
         Converter converter(context);
@@ -187,7 +185,7 @@ JSValueRef JSAudio::getPropertyArtist(
             }
             for( unsigned int i=0; i < audio->getAudioArtist().size(); i++){
                 string artist = audio->getAudioArtist().at(i);
-                LogDebug("artist : "  << artist);
+                LoggerD("artist : "  << artist);
                 JSValueRef val = converter.toJSValueRef(artist);
                 if(!JSSetArrayElement(context, jsResult, i, val)){
                     ThrowMsg(UnknownException, "Could not insert value into js array");
@@ -198,7 +196,7 @@ JSValueRef JSAudio::getPropertyArtist(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -211,7 +209,7 @@ JSValueRef JSAudio::getPropertyGenre(
                        JSStringRef propertyName, 
                        JSValueRef* exception)
 {
-    LogDebug("getPropertyGenre::entered");
+    LoggerD("getPropertyGenre::entered");
     Try
     {
         Converter converter(context);
@@ -235,7 +233,7 @@ JSValueRef JSAudio::getPropertyGenre(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -247,7 +245,7 @@ JSValueRef JSAudio::getPropertyComposer(
                        JSStringRef propertyName, 
                        JSValueRef* exception)
 {
-    LogDebug("getPropertyComposer::entered");
+    LoggerD("getPropertyComposer::entered");
     Try
     {  
         Converter converter(context);
@@ -269,7 +267,7 @@ JSValueRef JSAudio::getPropertyComposer(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -280,7 +278,7 @@ JSValueRef JSAudio::getPropertyCopyright(
                        JSStringRef propertyName, 
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -291,7 +289,7 @@ JSValueRef JSAudio::getPropertyCopyright(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -302,7 +300,7 @@ JSValueRef JSAudio::getPropertyLyrics(
                        JSStringRef propertyName,
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
                MediaConverterFactory::ConverterType converter = MediaConverterFactory::getConverter(context);
@@ -321,7 +319,7 @@ JSValueRef JSAudio::getPropertyLyrics(
        JSContextRef globalContext = priv->getContext();
 
        //check lyrics state
-       LogDebug("lyrics state : " << audio->getLyricsState());
+       LoggerD("lyrics state : " << audio->getLyricsState());
 
        if ( CONTENT_LYRIC_UNKNOWN == audio->getLyricsState()  ||
                CONTENT_LYRIC_EXISTENT == audio->getLyricsState() )
@@ -344,14 +342,14 @@ JSValueRef JSAudio::getPropertyLyrics(
                
                if (mediaContent && (audio->getLyricsState() != CONTENT_LYRIC_NON_EXISTENT))
                {
-                       LogDebug(" lyrics success ");
+                       LoggerD(" lyrics success ");
                        JSObjectRef jsobject;
                        jsobject = JSMediaLyrics::createJSObject(globalContext, mediaContent);
                        return jsobject;        
                }
                else
                {
-                       LogDebug(" lyrics success ");
+                       LoggerD(" lyrics success ");
                        audio->setAudioLyricNonExistent();
                }
        }
@@ -359,7 +357,7 @@ JSValueRef JSAudio::getPropertyLyrics(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
 
     return JSValueMakeNull(context);
@@ -371,7 +369,7 @@ JSValueRef JSAudio::getPropertyBitrate(
                        JSStringRef propertyName,
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -380,7 +378,7 @@ JSValueRef JSAudio::getPropertyBitrate(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -391,7 +389,7 @@ JSValueRef JSAudio::getPropertyTrackNum(
                        JSStringRef propertyName,
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -400,7 +398,7 @@ JSValueRef JSAudio::getPropertyTrackNum(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -411,7 +409,7 @@ JSValueRef JSAudio::getPropertyDuration(
                        JSStringRef propertyName,
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -420,7 +418,7 @@ JSValueRef JSAudio::getPropertyDuration(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeNull(context);
 }
@@ -431,7 +429,7 @@ JSValueRef JSAudio::getPropertySize(
                        JSStringRef propertyName,
                        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -441,7 +439,7 @@ JSValueRef JSAudio::getPropertySize(
     }
     Catch(Exception)
     {
-        LogWarning("trying to get incorrect value");
+        LoggerW("trying to get incorrect value");
     }
     return JSValueMakeUndefined(context);
 }
@@ -453,7 +451,7 @@ bool JSAudio::setPropertyAlbum(
                   JSValueRef value,
                   JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -465,7 +463,7 @@ bool JSAudio::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);
     }
 
@@ -480,7 +478,7 @@ bool  JSAudio::setPropertyArtist(
                   JSValueRef value,
                   JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -513,7 +511,7 @@ bool  JSAudio::setPropertyArtist(
     }
     Catch(Exception)
     {
-        LogWarning("trying to set incorrect value");
+        LoggerW("trying to set incorrect value");
         return DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
     }
        
@@ -528,7 +526,7 @@ bool JSAudio::setPropertyComposer(
                   JSValueRef value,
                   JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -557,7 +555,7 @@ bool JSAudio::setPropertyComposer(
     }
     Catch(Exception)
     {
-        LogWarning("trying to set incorrect value");
+        LoggerW("trying to set incorrect value");
         return DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
     }
        
@@ -571,7 +569,7 @@ bool        JSAudio::setPropertyGenre(
                JSValueRef value,
                JSValueRef* exception) 
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -601,7 +599,7 @@ bool        JSAudio::setPropertyGenre(
     }
     Catch(Exception)
     {
-        LogWarning("trying to set incorrect value");
+        LoggerW("trying to set incorrect value");
         return DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
     }
 
@@ -615,7 +613,7 @@ bool JSAudio::setPropertyTrackNumber(
        JSValueRef value,
        JSValueRef* exception)
 {
-    LogDebug("entered");
+    LoggerD("entered");
     Try
     {
         Converter converter(context);
@@ -627,7 +625,7 @@ bool JSAudio::setPropertyTrackNumber(
     }
     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);
     }