src/3rdparty/phonon/mmf/utils.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 8 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
    16 
    16 
    17 */
    17 */
    18 
    18 
    19 #include "utils.h"
    19 #include "utils.h"
    20 #include <e32std.h>
    20 #include <e32std.h>
       
    21 #include <mmf/common/mmferrors.h>
    21 
    22 
    22 QT_BEGIN_NAMESPACE
    23 QT_BEGIN_NAMESPACE
    23 
    24 
    24 using namespace Phonon;
    25 using namespace Phonon;
    25 using namespace Phonon::MMF;
    26 using namespace Phonon::MMF;
    67     }
    68     }
    68 
    69 
    69     return result;
    70     return result;
    70 }
    71 }
    71 
    72 
       
    73 QString MMF::Utils::symbianErrorToString(int errorCode)
       
    74 {
       
    75     /**
       
    76      * Here we translate only the error codes which are likely to be
       
    77      * meaningful to the user.  For example, when an error occurs
       
    78      * during opening of a media file, displaying "not found" or
       
    79      * "permission denied" is informative.  On the other hand,
       
    80      * differentiating between KErrGeneral and KErrArgument at the UI
       
    81      * level does not make sense.
       
    82      */
       
    83     switch (errorCode)
       
    84     {
       
    85     // System-wide errors
       
    86     case KErrNone:
       
    87         return tr("No error");
       
    88     case KErrNotFound:
       
    89         return tr("Not found");
       
    90     case KErrNoMemory:
       
    91         return tr("Out of memory");
       
    92     case KErrNotSupported:
       
    93         return tr("Not supported");
       
    94     case KErrOverflow:
       
    95         return tr("Overflow");
       
    96     case KErrUnderflow:
       
    97         return tr("Underflow");
       
    98     case KErrAlreadyExists:
       
    99         return tr("Already exists");
       
   100     case KErrPathNotFound:
       
   101         return tr("Path not found");
       
   102     case KErrInUse:
       
   103         return tr("In use");
       
   104     case KErrNotReady:
       
   105         return tr("Not ready");
       
   106     case KErrAccessDenied:
       
   107         return tr("Access denied");
       
   108     case KErrCouldNotConnect:
       
   109         return tr("Could not connect");
       
   110     case KErrDisconnected:
       
   111         return tr("Disconnected");
       
   112     case KErrPermissionDenied:
       
   113         return tr("Permission denied");
       
   114 
       
   115     // Multimedia framework errors
       
   116     case KErrMMNotEnoughBandwidth:
       
   117         return tr("Insufficient bandwidth");
       
   118     case KErrMMSocketServiceNotFound:
       
   119     case KErrMMServerSocket:
       
   120         return tr("Network unavailable");
       
   121     case KErrMMNetworkRead:
       
   122     case KErrMMNetworkWrite:
       
   123     case KErrMMUDPReceive:
       
   124         return tr("Network communication error");
       
   125     case KErrMMServerNotSupported:
       
   126         return tr("Streaming not supported");
       
   127     case KErrMMServerAlert:
       
   128         return tr("Server alert");
       
   129     case KErrMMInvalidProtocol:
       
   130         return tr("Invalid protocol");
       
   131     case KErrMMInvalidURL:
       
   132         return tr("Invalid URL");
       
   133     case KErrMMMulticast:
       
   134         return tr("Multicast error");
       
   135     case KErrMMProxyServer:
       
   136     case KErrMMProxyServerConnect:
       
   137         return tr("Proxy server error");
       
   138     case KErrMMProxyServerNotSupported:
       
   139         return tr("Proxy server not supported");
       
   140     case KErrMMAudioDevice:
       
   141         return tr("Audio output error");
       
   142     case KErrMMVideoDevice:
       
   143         return tr("Video output error");
       
   144     case KErrMMDecoder:
       
   145         return tr("Decoder error");
       
   146     case KErrMMPartialPlayback:
       
   147         return tr("Audio or video components could not be played");
       
   148     case KErrMMDRMNotAuthorized:
       
   149         return tr("DRM error");
       
   150 
       
   151     /*
       
   152     // We don't use QoS settings
       
   153     case KErrMMQosLowBandwidth:
       
   154     case KErrMMQosUnsupportedTrafficClass:
       
   155     case KErrMMQosPoorTrafficClass:
       
   156     case KErrMMQosUnsupportedParameters:
       
   157     case KErrMMQosPoorParameters:
       
   158     case KErrMMQosNotSupported:
       
   159     */
       
   160 
       
   161     // Catch-all for errors other than those above
       
   162     default:
       
   163     {
       
   164         return tr("Unknown error (%1)").arg(errorCode);
       
   165     }
       
   166     }
       
   167 }
    72 
   168 
    73 #ifndef QT_NO_DEBUG
   169 #ifndef QT_NO_DEBUG
    74 
   170 
    75 #include <hal.h>
   171 #include <hal.h>
    76 #include <hal_data.h>
   172 #include <hal_data.h>