RPR plugin getFilterList

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(Examples)
(C++)
 
Line 7: Line 7:
==Examples==
==Examples==
===C++===
===C++===
-
<source lang=cpp>
+
<source lang=cpp highlight=6>
 +
//
 +
// This is a code fragment, taken from SWS_MediaPoolWnd, from the SWS extensions
 +
//
 +
char projPath[MAX_PATH];
 +
GetProjectPath(projPath, MAX_PATH);
 +
char* pFiles = BrowseForFiles("Select file(s)", projPath, NULL, true, plugin_getFilterList());
 +
if (pFiles)
 +
{
 +
  char* pBuf = pFiles;
 +
  bool bUndo = false;
 +
  while(pFiles[0])
 +
  {
 +
    char* pExt = strrchr(pFiles, '.');
 +
    if (pExt && IsMediaExtension(pExt+1, false))
 +
    {
 +
      m_curGroup->AddFile(pFiles, m_curGroup->m_files.GetSize(), false);
 +
      bUndo = !m_curGroup->m_bGlobal;
 +
    }
 +
    pFiles += strlen(pFiles) + 1;
 +
  }
 +
  free(pBuf);
 +
  if (bUndo)
 +
    Undo_OnStateChangeEx("Add files to project media pool", UNDO_STATE_MISCCFG, -1);
 +
}
</source>
</source>
-
 
===Perl===
===Perl===

Latest revision as of 21:27, 11 February 2010

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR plugin getFilterList
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR plugin getFilterList

Contents

plugin_getFilterList()

char* plugin_getFilterList()

Parameters

Returns

char* 

Examples

C++

//
// This is a code fragment, taken from SWS_MediaPoolWnd, from the SWS extensions
//
char projPath[MAX_PATH];
GetProjectPath(projPath, MAX_PATH);
char* pFiles = BrowseForFiles("Select file(s)", projPath, NULL, true, plugin_getFilterList());if (pFiles)
{
  char* pBuf = pFiles;
  bool bUndo = false;
  while(pFiles[0])
  {
    char* pExt = strrchr(pFiles, '.');
    if (pExt && IsMediaExtension(pExt+1, false))
    {
      m_curGroup->AddFile(pFiles, m_curGroup->m_files.GetSize(), false);
      bUndo = !m_curGroup->m_bGlobal;
    }
    pFiles += strlen(pFiles) + 1;
  }
  free(pBuf);
  if (bUndo)
    Undo_OnStateChangeEx("Add files to project media pool", UNDO_STATE_MISCCFG, -1);
}

Perl

 


Python

 

See Also

Stuff

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR plugin getFilterList
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR plugin getFilterList