Index: programs/mythbackend/httpstatus.cpp
===================================================================
--- programs/mythbackend/httpstatus.cpp	(revision 12904)
+++ programs/mythbackend/httpstatus.cpp	(working copy)
@@ -83,6 +83,10 @@
     if (sURI == "getCMGRDesc"          ) return( HSM_GetCMGRDesc     );
     if (sURI == "getMSRRDesc"          ) return( HSM_GetMSRRDesc     );
 
+    if (sURI == "getRecProfiles"       ) return( HSM_GetRecProfiles   );
+    if (sURI == "delRecProfiles"       ) return( HSM_DelRecProfiles   );
+    if (sURI == "createRecProfiles"    ) return( HSM_CreateRecProfiles);
+
     if (sURI == "*"                    ) return( HSM_Asterisk        );
 
     return( HSM_Unknown );
@@ -124,6 +128,10 @@
                 case HSM_GetMusic       : GetMusic       ( pThread, pRequest ); return( true );
                 case HSM_GetVideo       : GetVideo       ( pThread, pRequest ); return( true );
 
+                case HSM_GetRecProfiles    : GetRecProfiles    ( pRequest ); return( true );
+                case HSM_DelRecProfiles    : DelRecProfiles    ( pRequest ); return( true );
+                case HSM_CreateRecProfiles : CreateRecProfiles ( pRequest ); return( true );
+
                 default: 
                 {
 				    pRequest->m_eResponseType   = ResponseTypeHTML;
@@ -1236,6 +1244,142 @@
 //
 /////////////////////////////////////////////////////////////////////////////
 
+void HttpStatus::GetRecProfiles( HTTPRequest *pRequest )
+{
+    QString group_name = pRequest->m_mapParams[ "groupname" ];
+
+    // Build Response XML
+    QDomDocument doc( "Profiles" );
+
+    QDomElement root = doc.createElement("Profiles");
+    doc.appendChild(root);
+
+    root.setAttribute("asOf"      , QDateTime::currentDateTime().toString( Qt::ISODate ));
+    root.setAttribute("version"   , MYTH_BINARY_VERSION           );
+    root.setAttribute("protoVer"  , MYTH_PROTO_VERSION            );
+
+    MSqlQuery query(MSqlQuery::InitCon());
+
+    if (group_name != "")
+    {
+        query.prepare( "SELECT r.* FROM recordingprofiles r,profilegroups p" 
+                        " WHERE p.name=:GROUPNAME AND r.profilegroup = p.id" );
+        query.bindValue(":GROUPNAME", group_name);
+    } else
+        query.prepare( "SELECT * FROM recordingprofiles" );
+
+    if (!query.exec() || !query.isActive())
+        MythContext::DBError("No Profiles", query);
+
+    if (query.size() > 0)
+    {
+
+        while(query.next())
+        {
+            QDomElement profile = doc.createElement("Profile");
+            root.appendChild(profile);
+
+            profile.setAttribute("acodec"   , query.value(3).toString());
+            profile.setAttribute("vcodec"   , query.value(2).toString());
+            profile.setAttribute("name"     , query.value(1).toString());
+            profile.setAttribute("id"       , query.value(0).toString());
+
+        }
+
+    }
+
+    // Sends back the response
+    pRequest->m_mapRespHeaders[ "Cache-Control" ] = "no-cache=\"Ext\", max-age = 5000";
+    pRequest->m_eResponseType = ResponseTypeXML;
+    pRequest->m_response << doc.toString();
+
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+/////////////////////////////////////////////////////////////////////////////
+void HttpStatus::CreateRecProfiles( HTTPRequest *pRequest )
+{
+    pRequest->m_eResponseType   = ResponseTypeXML;
+    pRequest->m_mapRespHeaders[ "Cache-Control" ] = "no-cache=\"Ext\", max-age = 5000";
+
+    QString profile_name = pRequest->m_mapParams[ "profilename" ];
+    QString group_name   = pRequest->m_mapParams[ "groupname" ];
+    QString vcodec       = pRequest->m_mapParams[ "vcodec" ];
+    QString acodec       = pRequest->m_mapParams[ "acodec" ];
+
+    if (profile_name != "" && vcodec != "" && acodec != "" && group_name != "")
+    {
+        MSqlQuery query(MSqlQuery::InitCon());
+
+        query.prepare("SELECT id FROM profilegroups WHERE name=:GROUPNAME");
+        query.bindValue(":GROUPNAME", group_name);
+
+        if (!query.exec() || !query.isActive())
+            MythContext::DBError("Query problem while trying to " 
+                                 "retrieve id from Group_Name", query);
+
+        if (query.size() > 0)
+        {
+            query.first();
+            QString group = query.value(0).toString();
+
+            query.prepare("INSERT INTO recordingprofiles VALUES"
+                        " (NULL,:PNAME,:VCODEC,:ACODEC,:GROUP)" );
+            query.bindValue(":PNAME", profile_name );
+            query.bindValue(":VCODEC", vcodec );
+            query.bindValue(":ACODEC", acodec );
+            query.bindValue(":GROUP", group );
+
+            if (!query.exec() || !query.isActive())
+            {
+                MythContext::DBError("Problems while inserting profile", query);
+                pRequest->m_response <<  "<Error>Problem with the MySQL Query</Error>";
+            }
+            else pRequest->m_response <<  "<Success>Profile Created</Success>";
+
+        }
+        else
+            pRequest->m_response <<  "<Error>No Result from SQL Query</Error>";
+    }
+    else
+        pRequest->m_response <<  "<Error>You must specify ALL the parameters</Error>";
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+/////////////////////////////////////////////////////////////////////////////
+
+void HttpStatus::DelRecProfiles( HTTPRequest *pRequest )
+{
+    pRequest->m_eResponseType   = ResponseTypeXML;
+    pRequest->m_mapRespHeaders[ "Cache-Control" ] = "no-cache=\"Ext\", max-age = 5000";
+
+    QString profile_id = pRequest->m_mapParams[ "id" ];
+
+    if (profile_id != "")
+    {
+        MSqlQuery query(MSqlQuery::InitCon());
+        query.prepare("DELETE FROM recordingprofiles WHERE"
+                    " id = :ID" );
+        query.bindValue(":ID", profile_id );
+
+        if (!query.exec() || !query.isActive())
+        {
+            MythContext::DBError("Problems while deleting profile", query);
+            pRequest->m_response <<  "<Error>Problem with the MySQL Query</Error>";
+        }
+        else pRequest->m_response <<  "<Success>Profile Deleted</Success>";
+
+    }
+    else
+        pRequest->m_response <<  "<Error>You must specify the id to delete</Error>";
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+/////////////////////////////////////////////////////////////////////////////
+
 void HttpStatus::GetStatusXML( HTTPRequest *pRequest )
 {
     QDomDocument doc( "Status" );                        
Index: programs/mythbackend/httpstatus.h
===================================================================
--- programs/mythbackend/httpstatus.h	(revision 12904)
+++ programs/mythbackend/httpstatus.h	(working copy)
@@ -1,4 +1,5 @@
-//////////////////////////////////////////////////////////////////////////////
+//////////
+////////////////////////////////////////////////////////////////////
 // Program Name: httpstatus.h
 //                                                                            
 // Purpose - Html & XML status HttpServerExtension 
@@ -51,8 +52,12 @@
     HSM_GetProgramDetails = 18,
 
     HSM_GetVideo        = 19,
-    HSM_GetMSRRDesc     = 20
+    HSM_GetMSRRDesc     = 20,
 
+    HSM_GetRecProfiles    = 21,
+    HSM_DelRecProfiles    = 22,
+    HSM_CreateRecProfiles = 23
+
 } HttpStatusMethod;
 
 /////////////////////////////////////////////////////////////////////////////
@@ -180,6 +185,10 @@
         void    GetVideo       ( HttpWorkerThread *pThread,
                                  HTTPRequest      *pRequest );
 
+        void    GetRecProfiles    ( HTTPRequest *pRequest );
+        void    DelRecProfiles    ( HTTPRequest *pRequest );
+        void    CreateRecProfiles ( HTTPRequest *pRequest );
+
         void    GetDeviceDesc  ( HTTPRequest *pRequest ); 
         void    GetFile        ( HTTPRequest *pRequest, QString sFileName );
 
