Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv13694

Added Files:
      Tag: Audacity_UmixIt
        Branding.cpp Branding.h 
Log Message:
project branding

--- NEW FILE: Branding.cpp ---
/**********************************************************************

   Audacity: A Digital Audio Editor

   Branding.h

   Vaughan Johnson, November 2006

   Project-specific branding (brand name, website URL, logo, color scheme)

  
**********************************************************************/

#include "Branding.h"

Branding::Branding()
{
   m_strBrandName = "";
   m_strBrandURL = "";
   m_strBrandLogoFilename = "";
   m_strBrandColorScheme = "";
}

bool Branding::HandleXMLTag(const char *tag, const char **attrs) 
{
   if (strcmp(tag, "branding")) return false;

   // loop through attrs, null-terminated list of attribute-value pairs
   while (*attrs) {
      const char *attr = *attrs++;
      const char *value = *attrs++;

      if (!value) break;

      if (!strcmp(attr, "brandname")) m_strBrandName = value;
      else if (!strcmp(attr, "url")) m_strBrandURL = value;
      else if (!strcmp(attr, "logofilename")) m_strBrandLogoFilename = value;
      else if (!strcmp(attr, "colorscheme")) m_strBrandColorScheme = value;
   } // while

   return true; 
}

void Branding::WriteXML(int depth, FILE *fp)
{
   int i;

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "<branding ");
   fprintf(fp, "brandname=\"%s\" ", XMLEsc(m_strBrandName).c_str());
   fprintf(fp, "url=\"%s\" ", XMLEsc(m_strBrandURL).c_str());
   fprintf(fp, "logofilename=\"%s\" ", XMLEsc(m_strBrandLogoFilename).c_str());
   fprintf(fp, "colorscheme=\"%s\" ", XMLEsc(m_strBrandColorScheme).c_str());
   fprintf(fp, "/>\n"); // XML shorthand for childless tag
}


--- NEW FILE: Branding.h ---
/**********************************************************************

   Audacity: A Digital Audio Editor

   Branding.h

   Vaughan Johnson, November 2006

   Project-specific branding (brand name, website URL, logo, color scheme)

  
**********************************************************************/

#pragma once

#include "Audacity.h"
#include "xml/xmltaghandler.h"

class Branding : public XMLTagHandler
{
public:
   Branding();

   virtual bool HandleXMLTag(const char *tag, const char **attrs);
   virtual XMLTagHandler *HandleXMLChild(const char *tag) { return NULL; }; //v
   virtual void WriteXML(int depth, FILE *fp);

   wxString GetBrandName() { return m_strBrandName; }
   wxString GetBrandURL() { return m_strBrandURL; }
   wxString GetBrandLogoFilename() { return m_strBrandLogoFilename; }
   wxString GetBrandColorScheme() { return m_strBrandColorScheme; }

public:
   wxString m_strBrandName;
   wxString m_strBrandURL;
   wxString m_strBrandLogoFilename;
   wxString m_strBrandColorScheme;
};


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to