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

Modified Files:
      Tag: Audacity_UmixIt
        Lyrics.cpp Project.cpp Project.h 
Log Message:
per-project branding (name, logo, url)

Index: Project.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.h,v
retrieving revision 1.70.2.3.2.2
retrieving revision 1.70.2.3.2.3
diff -u -d -r1.70.2.3.2.2 -r1.70.2.3.2.3
--- Project.h   23 Nov 2006 03:48:09 -0000      1.70.2.3.2.2
+++ Project.h   29 Nov 2006 03:14:04 -0000      1.70.2.3.2.3
@@ -48,6 +48,7 @@
 class wxScrollBar;
 class wxProgressDialog;
 
+class Branding;
 class Toolbar;
 class TrackList;
 class Tags;
@@ -99,7 +100,7 @@
 
    virtual bool HandleXMLTag(const char *tag, const char **attrs);
    virtual XMLTagHandler *HandleXMLChild(const char *tag) { return NULL; };
-   virtual void WriteXML(int depth, FILE *fp) {}; //vvv
+   virtual void WriteXML(int depth, FILE *fp) {}; //v
  private: 
    AudacityProject* mProject;
 };
@@ -132,6 +133,7 @@
    DirManager *GetDirManager();
    TrackFactory *GetTrackFactory();
    Tags *GetTags();
+   Branding* GetBranding() { return mBranding; };
    int GetAudioIOToken();
    void SetAudioIOToken(int token);
    LyricsWindow* GetLyricsWindow() { return mLyricsWindow; };
@@ -287,6 +289,8 @@
 
    Tags *mTags;
 
+   Branding* mBranding; // branding (brand name, website URL, logo, color 
scheme)
+
    // List of tracks and display info
 
    TrackList *mTracks;

Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.178.2.17.2.3
retrieving revision 1.178.2.17.2.4
diff -u -d -r1.178.2.17.2.3 -r1.178.2.17.2.4
--- Project.cpp 27 Nov 2006 06:21:59 -0000      1.178.2.17.2.3
+++ Project.cpp 29 Nov 2006 03:14:04 -0000      1.178.2.17.2.4
@@ -62,6 +62,7 @@
 #include "AColor.h"
 #include "AStatus.h"
 #include "AudioIO.h"
+#include "Branding.h"
 #include "ControlToolBar.h"
 #include "EditToolBar.h"
 #include "MeterToolBar.h"
@@ -172,7 +173,7 @@
       if (!wxFile::Exists(FILENAME(strPathname))) return false;
    }
    mProject->Import(strPathname);
-   return true; //vvv UmixIt   result from Import?
+   return true; //v result from Import?
 }
 
 
@@ -576,6 +577,8 @@
    // Create tags object
    mTags = new Tags();
 
+   mBranding = NULL;
+
    mTrackFactory = new TrackFactory(mDirManager);
    mImporter = new Importer;
    mImportingRaw = false;
@@ -640,6 +643,9 @@
    delete mTags;
    mTags = NULL;
 
+   delete mBranding;
+   mBranding = NULL;
+
    mTracks->Clear(true);
    delete mTracks;
    mTracks = NULL;
@@ -2029,6 +2035,11 @@
       return mTags;
    }
 
+   if (!strcmp(tag, "branding")) {
+      mBranding = new Branding();
+      return mBranding;
+   }
+
    if (!strcmp(tag, "wavetrack")) {
       WaveTrack *newTrack = mTrackFactory->NewWaveTrack();
       mTracks->Add(newTrack);
@@ -2088,6 +2099,8 @@
 
    mTags->WriteXML(depth+1, fp);
 
+   if (mBranding) mBranding->WriteXML(depth+1, fp);
+
    Track *t;
    TrackListIterator iter(mTracks);
    t = iter.First();

Index: Lyrics.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Attic/Lyrics.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- Lyrics.cpp  27 Nov 2006 06:22:49 -0000      1.1.2.2
+++ Lyrics.cpp  29 Nov 2006 03:14:04 -0000      1.1.2.3
@@ -17,7 +17,8 @@
 
 #include "Lyrics.h"
 #include "Internat.h"
-#include "Project.h" // for GetActiveProject in OnKeyEvent
+#include "Project.h" // for GetActiveProject
+#include "Branding.h"
 
 #include <wx/arrimpl.cpp>
 WX_DEFINE_OBJARRAY(SyllableArray);
@@ -271,17 +272,40 @@
    else {
       // branding
       AudacityProject* pProject = GetActiveProject();
-      wxString strLogoFilename = "UmixIt.jpg"; //vvv UmixIt: Get name from 
project file.
-      wxString strLogoPathname = 
-         GetActiveProject()->GetDirManager()->GetProjectDataDir() + "\\" + 
strLogoFilename;
-      wxString strURL = "http://www.umixit.com";; //vvv UmixIt: Get url from 
project file.
+      Branding* pBranding = pProject->GetBranding();
       wxString strBranding = "";
-      if (::wxFileExists(FILENAME(strLogoPathname))) 
-         strBranding = 
-            "<center><a href=\"" + FILENAME(strURL) + 
-               "\" target=\"_blank\"><img src=\"" + 
-                  FILENAME(strLogoPathname) + "\" alt=\"" + strLogoFilename + 
"\"><br>" + 
-               strURL + "</a><hr></center>\n";
+      if (pBranding) {
+         wxString strBrandName = pBranding->GetBrandName();
+         wxString strURL = pBranding->GetBrandURL();
+
+         wxString strIMGtag = "";
+         wxString strLogoFilename = pBranding->GetBrandLogoFilename();
+         if (!strLogoFilename.IsEmpty()){
+            wxString strLogoPathname = 
+               pProject->GetDirManager()->GetProjectDataDir() + "\\" + 
strLogoFilename;
+            if (::wxFileExists(FILENAME(strLogoPathname))) 
+               strIMGtag = "<img src=\"" + FILENAME(strLogoPathname) + "\" 
alt=\"" + strLogoFilename + "\"><br>";
+         }
+
+         if (strURL.IsEmpty()) {
+            if (strIMGtag.IsEmpty()) {
+               if (!strBrandName.IsEmpty()) 
+                  strBranding = "<center><h1>" + strBrandName + 
"</h1><hr></center>\n";
+            } else {
+               strBranding = "<center>" + strIMGtag + "<hr></center>\n";
+            }
+         } else {
+            if (strIMGtag.IsEmpty()) {
+               if (!strBrandName.IsEmpty()) 
+                  strBranding = 
+                     "<center><h1>" + strBrandName + 
+                     "</h1><br><a href=\"" + FILENAME(strURL) + "\">" + strURL 
+ "</a><hr></center>\n";
+            } else {
+               strBranding = 
+                  "<center><a href=\"" + FILENAME(strURL) + "\">" + strIMGtag 
+ strURL + "</a><hr></center>\n";
+            }
+         }
+      }
 
       // Size the whole htmlText.
       // Map nFontRelativeSize into -2 to +4, in increments of 
DEFAULT_FONT_POINTSIZE/2


-------------------------------------------------------------------------
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