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

Modified Files:
        ImportFLAC.cpp ImportMP3.cpp ImportPCM.cpp ImportPlugin.h 
        ImportLOF.cpp Import.h ImportOGG.cpp 
Log Message:
Removed all usage of wxStringList as it has been deprecated and was causing a 
tremendous slowdown in DirManager when dealing with a large number of files.

Index: ImportPCM.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportPCM.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- ImportPCM.cpp       25 Aug 2006 05:12:37 -0000      1.26
+++ ImportPCM.cpp       17 Sep 2006 01:03:35 -0000      1.27
@@ -47,7 +47,7 @@
 {
 public:
    PCMImportPlugin():
-      ImportPlugin(wxStringList())
+      ImportPlugin(wxArrayString())
    {
       sf_get_all_extensions(mExtensions);
    }

Index: ImportFLAC.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportFLAC.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ImportFLAC.cpp      25 Aug 2006 05:12:37 -0000      1.14
+++ ImportFLAC.cpp      17 Sep 2006 01:03:35 -0000      1.15
@@ -28,14 +28,19 @@
 
 #define FLAC_HEADER "fLaC"
 
+static const wxChar *exts[] =
+{
+   wxT("flac"),
+   wxT("flc")
+};
+
 #ifndef USE_LIBFLAC
 
 void GetFLACImportPlugin(ImportPluginList *importPluginList,
                         UnusableImportPluginList *unusableImportPluginList)
 {
    UnusableImportPlugin* flacIsUnsupported =
-      new UnusableImportPlugin(wxT("FLAC"),
-                               wxStringList(wxT("flac"), wxT("flc"), NULL));
+      new UnusableImportPlugin(wxT("FLAC"), wxArrayString(2, exts));
 
    unusableImportPluginList->Append(flacIsUnsupported);
 }
@@ -88,7 +93,7 @@
 {
  public:
    FLACImportPlugin():
-      ImportPlugin(wxStringList(wxT("flac"),NULL))
+      ImportPlugin(wxArrayString(2, exts))
    {
    }
 

Index: ImportLOF.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportLOF.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ImportLOF.cpp       7 Jul 2006 11:22:01 -0000       1.11
+++ ImportLOF.cpp       17 Sep 2006 01:03:35 -0000      1.12
@@ -89,11 +89,16 @@
 
 #define BINARY_FILE_CHECK_BUFFER_SIZE 1024
 
+static const wxChar *exts[] =
+{
+   wxT("lof")
+};
+
 class LOFImportPlugin : public ImportPlugin
 {
 public:
    LOFImportPlugin():
-      ImportPlugin(wxStringList(wxT("lof"), NULL))
+      ImportPlugin(wxArrayString(1, exts))
    {
    }
 

Index: ImportOGG.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportOGG.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- ImportOGG.cpp       25 Aug 2006 05:12:37 -0000      1.24
+++ ImportOGG.cpp       17 Sep 2006 01:03:35 -0000      1.25
@@ -31,6 +31,11 @@
 #include "ImportOGG.h"
 #include "../Internat.h"
 
+static const wxChar *exts[] =
+{
+   wxT("ogg")
+};
+
 #ifndef USE_LIBVORBIS
 /* BPF There is no real reason to compile without LIBVORBIS, but if you do, 
you will needs this header */
 #include "ImportPlugin.h"  
@@ -39,8 +44,7 @@
                         UnusableImportPluginList *unusableImportPluginList)
 {
    UnusableImportPlugin* oggIsUnsupported =
-      new UnusableImportPlugin(wxT("Ogg Vorbis"),
-                               wxStringList(wxT("ogg"), NULL));
+      new UnusableImportPlugin(wxT("Ogg Vorbis"), wxArrayString(1, exts));
 
    unusableImportPluginList->Append(oggIsUnsupported);
 }
@@ -65,7 +69,7 @@
 {
 public:
    OggImportPlugin():
-      ImportPlugin(wxStringList(wxT("ogg"), NULL))
+      ImportPlugin(wxArrayString(1, exts))
    {
    }
 

Index: ImportPlugin.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportPlugin.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ImportPlugin.h      7 Jul 2006 11:22:01 -0000       1.7
+++ ImportPlugin.h      17 Sep 2006 01:03:35 -0000      1.8
@@ -80,7 +80,7 @@
    // Get a list of extensions this plugin expects to be able to
    // import.  If a filename matches any of these extensions,
    // this importer will get first dibs on importing it.
-   virtual wxStringList GetSupportedExtensions()
+   virtual wxArrayString GetSupportedExtensions()
    {
       return mExtensions;
    }
@@ -88,15 +88,7 @@
    bool SupportsExtension(wxString extension)
    {
       // Case-insensitive check if extension is supported
-      for (wxStringListNode* node = mExtensions.GetFirst();
-           node; node = node->GetNext())
-      {
-         wxString ext = wxString(node->GetData());
-         if (ext.CmpNoCase(extension) == 0)
-            return true;
-      }
-
-      return false;
+      return mExtensions.Index(extension, false) != wxNOT_FOUND;
    }
 
    // Open the given file, returning true if it is in a recognized
@@ -108,12 +100,12 @@
 
 protected:
 
-   ImportPlugin(wxStringList supportedExtensions):
+   ImportPlugin(wxArrayString supportedExtensions):
       mExtensions(supportedExtensions)
    {
    }
 
-   wxStringList mExtensions;
+   wxArrayString mExtensions;
 };
 
 
@@ -146,7 +138,7 @@
 class UnusableImportPlugin
 {
 public:
-   UnusableImportPlugin(wxString formatName, wxStringList extensions):
+   UnusableImportPlugin(wxString formatName, wxArrayString extensions):
       mFormatName(formatName),
       mExtensions(extensions)
    {
@@ -159,12 +151,12 @@
 
    bool SupportsExtension(wxString extension)
    {
-      return mExtensions.Member(extension);
+      return mExtensions.Index(extension, false) != wxNOT_FOUND;
    }
 
 private:
    wxString mFormatName;
-   wxStringList mExtensions;
+   wxArrayString mExtensions;
 };
 
 WX_DECLARE_LIST(ImportPlugin, ImportPluginList);

Index: Import.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/Import.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Import.h    29 Jun 2006 09:35:26 -0000      1.6
+++ Import.h    17 Sep 2006 01:03:35 -0000      1.7
@@ -25,9 +25,9 @@
 class Format {
 public:
    wxString formatName;
-   wxStringList formatExtensions;
+   wxArrayString formatExtensions;
 
-   Format(wxString _formatName, wxStringList _formatExtensions):
+   Format(wxString _formatName, wxArrayString _formatExtensions):
       formatName(_formatName),
       formatExtensions(_formatExtensions)
    {

Index: ImportMP3.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportMP3.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ImportMP3.cpp       25 Aug 2006 05:12:37 -0000      1.28
+++ ImportMP3.cpp       17 Sep 2006 01:03:35 -0000      1.29
@@ -34,14 +34,21 @@
 #include "ImportPlugin.h"
 #include "../Internat.h"
 
+static const wxChar *exts[] =
+{
+   wxT("mp3"),
+   wxT("mp2"),
+   wxT("mpg"),
+   wxT("mpeg")
+};
+
 #ifndef USE_LIBMAD
 
 void GetMP3ImportPlugin(ImportPluginList *importPluginList,
                         UnusableImportPluginList *unusableImportPluginList)
 {
    UnusableImportPlugin* mp3IsUnsupported =
-      new UnusableImportPlugin(wxT("MP3"),
-                               wxStringList(wxT("mp3"), wxT("mp2"), 
wxT("mpg"), wxT("mpeg"), NULL));
+      new UnusableImportPlugin(wxT("MP3"), wxArrayString(4, exts));
 
    unusableImportPluginList->Append(mp3IsUnsupported);
 }
@@ -84,7 +91,7 @@
 {
 public:
    MP3ImportPlugin():
-      ImportPlugin(wxStringList(wxT("mp3"), wxT("mp2"), wxT("mpg"), 
wxT("mpeg"), NULL))
+      ImportPlugin(wxArrayString(4, exts))
    {
    }
 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to