當前位置: 首頁>>代碼示例>>C++>>正文


C++ FILENAME函數代碼示例

本文整理匯總了C++中FILENAME函數的典型用法代碼示例。如果您正苦於以下問題:C++ FILENAME函數的具體用法?C++ FILENAME怎麽用?C++ FILENAME使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FILENAME函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: Export

bool Export(AudacityProject *project,
            bool selectionOnly, double t0, double t1)
{
   wxString fName;
   wxString formatStr;
   wxString extension;
   wxString actualName;
   bool     success;
   int      format;
   bool     stereo;
   
   format = ReadExportFormatPref();
                         
   formatStr = sf_header_name(format & SF_FORMAT_TYPEMASK);
   extension = "." + sf_header_extension(format & SF_FORMAT_TYPEMASK);

   fName = ExportCommon(project, formatStr, extension,
                        selectionOnly, &t0, &t1, &stereo,
                        actualName);

   if (fName == "")
      return false;

   success = ::ExportPCM(project, stereo, fName,
                         selectionOnly, t0, t1);

   if (success && actualName != fName)
      ::wxRenameFile(FILENAME(fName), FILENAME(actualName));

   return success;
}
開發者ID:CoolOppo,項目名稱:audacity,代碼行數:31,代碼來源:Export.cpp

示例2: wxGetUserId

bool AudacityApp::CreateSingleInstanceChecker(wxString dir)
{
   wxLogNull dontLog;

   wxString name = wxString::Format(wxT("audacity-lock-%s"), wxGetUserId().c_str());
   mChecker = new wxSingleInstanceChecker();

   if (!mChecker->Create(FILENAME(name), FILENAME(dir))) {
      // Error initializing the wxSingleInstanceChecker.  We don't know
      // whether there is another instance running or not.

      wxString prompt =
         _("Audacity was not able to lock the temporary files directory.\nThis folder may be in use by another copy of Audacity.\nRunning two copies of Audacity simultaneously may cause\ndata loss or cause your system to crash.\n\nDo you still want to start Audacity?");
      int action = wxMessageBox(prompt,
                                _("Error locking temporary folder"),
                                wxYES_NO | wxICON_EXCLAMATION,
                                NULL);
      if (action == wxNO) {
         delete mChecker;
         return false;
      }
   }
   else if ( mChecker->IsAnotherRunning() ) {
      // There is another copy of Audacity running.  Force quit.
      
      wxString prompt =
         _("The system has detected that another copy of Audacity is running.\nRunning two copies of Audacity simultaneously may lead to\ndata loss or cause your system to crash, so is not allowed.\n\nUse the New or Open commands in the currently running Audacity\nprocess to open multiple projects simultaneously.\n");
      wxMessageBox(prompt, _("Audacity is already running"),
            wxOK | wxICON_ERROR);
      delete mChecker;
      return false;
   }

   return true;
}
開發者ID:Kirushanr,項目名稱:audacity,代碼行數:35,代碼來源:AudacityApp.cpp

示例3: AutoRollbackRenamer

 AutoRollbackRenamer(wxString oldName, wxString newName) {
    mOldName = oldName;
    mNewName = newName;
    mRenameSucceeded = ::wxRenameFile(FILENAME(mOldName), FILENAME(mNewName));
    mFinished = false;
    mNewFile = NULL;
 }
開發者ID:Kirushanr,項目名稱:audacity,代碼行數:7,代碼來源:Legacy.cpp

示例4: build_drive_gui

static APTR build_drive_gui(void)
{
    APTR app, ui, ok, cancel;

    app = mui_get_app();

    ui = GroupObject,
    FILENAME(ui_to_from_drive[0].object, "1541", hook_object_drive[0])
    FILENAME(ui_to_from_drive[1].object, "1541-II", hook_object_drive[1])
    FILENAME(ui_to_from_drive[2].object, "1570", hook_object_drive[2])
    FILENAME(ui_to_from_drive[3].object, "1571", hook_object_drive[3])
    FILENAME(ui_to_from_drive[4].object, "1581", hook_object_drive[4])
    FILENAME(ui_to_from_drive[5].object, "2031", hook_object_drive[5])
    FILENAME(ui_to_from_drive[6].object, "2030", hook_object_drive[6])
    FILENAME(ui_to_from_drive[7].object, "3040", hook_object_drive[7])
    FILENAME(ui_to_from_drive[8].object, "4040", hook_object_drive[8])
    FILENAME(ui_to_from_drive[9].object, "1001", hook_object_drive[9])
    OK_CANCEL_BUTTON
    End;

    if (ui != NULL) {
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, BTN_OK);

        DoMethod(hook_object_drive[0], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive0);

        DoMethod(hook_object_drive[1], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive1);

        DoMethod(hook_object_drive[2], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive2);

        DoMethod(hook_object_drive[3], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive3);

        DoMethod(hook_object_drive[4], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive4);

        DoMethod(hook_object_drive[5], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive5);

        DoMethod(hook_object_drive[6], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive6);

        DoMethod(hook_object_drive[7], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive7);

        DoMethod(hook_object_drive[8], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive8);

        DoMethod(hook_object_drive[9], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseDrive9);
    }

    return ui;
}
開發者ID:BigBoss21X,項目名稱:vice-emu,代碼行數:60,代碼來源:uiromc64vic20settings.c

示例5: build_computer_gui

static APTR build_computer_gui(void)
{
    APTR app, ui, ok, cancel;

    app = mui_get_app();

    ui = GroupObject,
           FILENAME(ui_to_from_computer[0].object, "Kernal", hook_object_computer[0])
           FILENAME(ui_to_from_computer[1].object, "Basic", hook_object_computer[1])
           FILENAME(ui_to_from_computer[2].object, "Character", hook_object_computer[2])
           OK_CANCEL_BUTTON
         End;

    if (ui != NULL) {
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, BTN_OK);

        DoMethod(hook_object_computer[0], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseComputer0);

        DoMethod(hook_object_computer[1], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseComputer1);

        DoMethod(hook_object_computer[2], MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseComputer2);
    }

    return ui;
}
開發者ID:carriercomm,項目名稱:VICE-Core,代碼行數:32,代碼來源:uiromvic20settings.c

示例6: write_comment

void write_comment(TreeState *state)
{
    fprintf(FILENAME(state), "    /* ");
    IDL_tree_to_IDL(state->tree, state->ns, FILENAME(state),
                    IDLF_OUTPUT_NO_NEWLINES |
                    IDLF_OUTPUT_NO_QUALIFY_IDENTS |
                    IDLF_OUTPUT_PROPERTIES);
    fputs(" */\n", FILENAME(state));
}
開發者ID:gtron,項目名稱:atrapalotray,代碼行數:9,代碼來源:xpidl_java.c

示例7: ExportLossy

bool ExportLossy(AudacityProject *project,
                 bool selectionOnly, double t0, double t1)
{
   wxString fName;
   bool stereo;
   wxString actualName;
   bool     success = false;
   wxString format = gPrefs->Read("/FileFormats/LossyExportFormat", "MP3");

   if( format == "MP3" ) {
      fName = ExportCommon(project, "MP3", ".mp3",
                           selectionOnly, &t0, &t1, &stereo,
                           actualName);

      if (fName == "")
         return false;

      success = ::ExportMP3(project, stereo, fName,
                            selectionOnly, t0, t1);
   }
   else if( format == "OGG" ) {
#ifdef USE_LIBVORBIS
      fName = ExportCommon(project, "OGG", ".ogg",
                           selectionOnly, &t0, &t1, &stereo,
                           actualName);

      if (fName == "")
         return false;

      success = ::ExportOGG(project, stereo, fName,
                      selectionOnly, t0, t1);
#else
      wxMessageBox(_("Ogg Vorbis support is not included in this build of Audacity"));
#endif
   }
   else if( format == "External Program" ) {
#ifdef __WXGTK__
      wxString extension = gPrefs->Read( "/FileFormats/ExternalProgramExportExtension", "" );
      fName = ExportCommon(project, "External Program", "." + extension,
                           selectionOnly, &t0, &t1, &stereo,
                           actualName);

      if (fName == "")
         return false;

      success = ::ExportCL(project, stereo, fName,
                           selectionOnly, t0, t1);
#else
      wxMessageBox(_("Command-line exporting is only supported on UNIX"));
#endif
   }

   if (success && actualName != fName)
      ::wxRenameFile(FILENAME(fName), FILENAME(actualName));

   return success;
}
開發者ID:CoolOppo,項目名稱:audacity,代碼行數:57,代碼來源:Export.cpp

示例8: fclose

   ~AutoRollbackRenamer()
   {
      if (mNewFile)
         fclose(mNewFile);

      if (mRenameSucceeded && !mFinished) {
         ::wxRemoveFile(FILENAME(mOldName));
         ::wxRenameFile(FILENAME(mNewName), FILENAME(mOldName));
      }
   }
開發者ID:Kirushanr,項目名稱:audacity,代碼行數:10,代碼來源:Legacy.cpp

示例9: LoadLadspaEffect

void LoadLadspaEffect(wxString fname)
{
   wxLogNull logNo;
   LADSPA_Descriptor_Function mainFn = NULL;

   // As a courtesy to some plug-ins that might be bridges to
   // open other plug-ins, we set the current working
   // directory to be the plug-in's directory.

   wxString saveOldCWD = FROMFILENAME(::wxGetCwd());
   wxString prefix = ::wxPathOnly(fname);
   ::wxSetWorkingDirectory(FILENAME(prefix));

#if defined(__WXGTK__) || defined(__WXMAC__)

   void *libHandle = NULL;

   libHandle = dlopen(FILENAME(fname), RTLD_LAZY);
   
   mainFn = (LADSPA_Descriptor_Function)
      dlsym(libHandle, descriptorFnName);

#else
   // The following code uses the wxWindows DLL class, which does
   // not allow us to control the flags passed to dlopen().  This
   // leads to potential segfault bugs when plugins have conflicting
   // symbols, so until wxWindows adds this capability we are calling
   // dlopen() by hand under WXGTK, above...

   wxDllType libHandle = NULL;
     
   libHandle = wxDllLoader::LoadLibrary(FILENAME(fname));
   mainFn = (LADSPA_Descriptor_Function)
      wxDllLoader::GetSymbol(libHandle, descriptorFnName);
#endif

   if (mainFn) {
      int index = 0;
      const LADSPA_Descriptor *data;

      data = mainFn(index);
      while(data) {
         LadspaEffect *effect = new LadspaEffect(data);
         Effect::RegisterEffect(effect);
         
         // Get next plugin
         index++;
         data = mainFn(index);            
      }
   }

   ::wxSetWorkingDirectory(saveOldCWD);
}
開發者ID:CoolOppo,項目名稱:audacity,代碼行數:53,代碼來源:LoadLadspa.cpp

示例10: FROMFILENAME

bool AudacityApp::InitCleanSpeech()
{
   wxString cwd = FROMFILENAME(::wxGetCwd());
   wxString presetsFromPrefs = gPrefs->Read(wxT("/Directories/PresetsDir"), wxT(""));
   wxString presets = wxT("");

   #ifdef __WXGTK__
   if (presetsFromPrefs.GetChar(0) != wxT('/'))
      presetsFromPrefs = wxT("");
   #endif

   #ifdef __WXMSW__
   wxString presetsDefaultLoc = cwd + wxT("\\presets");
   #else
   wxString presetsDefaultLoc = cwd + wxT("/presets");
   #endif

   // Stop wxWindows from printing its own error messages (not used ... does this really do anything?)
   wxLogNull logNo;

   // Try temp dir that was stored in prefs first
   if (presetsFromPrefs != wxT("")) {
      if (wxDirExists(FILENAME(presetsFromPrefs)))
         presets = presetsFromPrefs;
      else if (wxMkdir(FILENAME(presetsFromPrefs)))
         presets = presetsFromPrefs;
   }

   // If that didn't work, try the default location
   if ((presets == wxT("")) && (presetsDefaultLoc != wxT(""))) {
      if (wxDirExists(FILENAME(presetsDefaultLoc)))
         presets = presetsDefaultLoc;
      else if (wxMkdir(FILENAME(presetsDefaultLoc)))
         presets = presetsDefaultLoc;
   }

   if (presets == wxT("")) {
      // Failed
      wxMessageBox(_("Audacity could not find a place to store\n.csp CleanSpeech preset files\nAudacity is now going to exit. \nInstallation may be corrupt."));
      return false;
   }

   // The permissions don't always seem to be set on
   // some platforms.  Hopefully this fixes it...
   #ifdef __UNIX__
   chmod(FILENAME(presets).fn_str(), 0755);
   #endif

   gPrefs->Write(wxT("/Directories/PresetsDir"), presets);
   return true;
}
開發者ID:Kirushanr,項目名稱:audacity,代碼行數:51,代碼來源:AudacityApp.cpp

示例11: build_gui_record

static APTR build_gui_record(void)
{
    APTR app, ui, ok, browse_button, cancel;

#ifdef AMIGA_MORPHOS
    static const struct Hook BrowseRecordHook = { { NULL, NULL }, (VOID *)HookEntry, (VOID *)Browse_Record_File, NULL };
#else
    static const struct Hook BrowseRecordHook = { { NULL, NULL }, (VOID *)Browse_Record_File, NULL, NULL };
#endif

    app = mui_get_app();

    ui = GroupObject,
           CYCLE(format, translate_text(IDS_SOUND_RECORD_FORMAT), ui_sound_formats)
           FILENAME(ui_to_from_record[0].object, translate_text(IDS_SOUND_RECORD_FILE), browse_button)
           OK_CANCEL_BUTTON
         End;

    if (ui != NULL) {
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, BTN_OK);

        DoMethod(browse_button, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseRecordHook);
    }

    return ui;
}
開發者ID:AreaScout,項目名稱:vice,代碼行數:31,代碼來源:uisound.c

示例12: build_gui_palette

static APTR build_gui_palette(void)
{
    APTR app, ui, ok, browse_button, cancel;

#ifdef AMIGA_MORPHOS
    static const struct Hook BrowseFileHook = { { NULL, NULL }, (VOID *)HookEntry, (VOID *)Browse_palette, NULL };
#else
    static const struct Hook BrowseFileHook = { { NULL, NULL }, (VOID *)Browse_palette, NULL, NULL };
#endif

    app = mui_get_app();

    ui = GroupObject,
           CYCLE(ui_to_from_palette[0].object, ui_to_from_palette[0].resource, ui_video_enable)
           FILENAME(ui_to_from_palette[1].object, video_palette_filename_text, browse_button)
           OK_CANCEL_BUTTON
         End;

    if (ui != NULL) {
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, BTN_OK);

        DoMethod(browse_button, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseFileHook);
    }

    return ui;
}
開發者ID:AreaScout,項目名稱:vice,代碼行數:31,代碼來源:uivideo.c

示例13: build_gui

static APTR build_gui(void)
{
    APTR app, ui, ok, browse_button, cancel;

#ifdef AMIGA_MORPHOS
    static const struct Hook BrowseFileHook = { { NULL, NULL }, (VOID *)HookEntry, (VOID *)Browse, NULL };
#else
    static const struct Hook BrowseFileHook = { { NULL, NULL }, (VOID *)Browse, NULL, NULL };
#endif

    app = mui_get_app();

    ui = GroupObject,
           CYCLE(ui_to_from[0].object, "DQBB", ui_dqbb_enable)
           FILENAME(ui_to_from[1].object, translate_text(IDS_DQBB_FILENAME), browse_button)
           CYCLE(ui_to_from[2].object, translate_text(IDS_SAVE_DQBB_IMAGE_WHEN_CHANGED), ui_dqbb_enable)
           OK_CANCEL_BUTTON
         End;

    if (ui != NULL) {
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, BTN_OK);

        DoMethod(browse_button, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseFileHook);
    }

    return ui;
}
開發者ID:AreaScout,項目名稱:vice,代碼行數:32,代碼來源:uidqbb.c

示例14: XOJ_CHECK_TYPE

void MetadataManager::loadConfigFile()
{
	XOJ_CHECK_TYPE(MetadataManager);

	if (this->config)
	{
		return;
	}

	this->config = g_key_file_new();
	g_key_file_set_list_separator(this->config, ',');

	char* file = FILENAME();

	if (g_file_test(file, G_FILE_TEST_EXISTS))
	{
		GError* error = NULL;
		if (!g_key_file_load_from_file(config, file, G_KEY_FILE_NONE, &error))
		{
			g_warning("Metadata file \"%s\" is invalid: %s", file, error->message);
			g_error_free(error);
		}
	}

	g_free(file);
}
開發者ID:cass00,項目名稱:xournalpp,代碼行數:26,代碼來源:MetadataManager.cpp

示例15: build_gui

static APTR build_gui(void)
{
    APTR app, ui, ok, browse_button, cancel;

#ifdef AMIGA_MORPHOS
    static const struct Hook BrowseFileHook = { { NULL, NULL }, (VOID *)HookEntry, (VOID *)Browse, NULL };
#else
    static const struct Hook BrowseFileHook = { { NULL, NULL }, (VOID *)Browse, NULL, NULL };
#endif

    app = mui_get_app();

    ui = GroupObject,
           FILENAME(ui_to_from[0].object, translate_text(IDS_C64DTV_ROM_FILENAME), browse_button)
           CYCLE(ui_to_from[1].object, translate_text(IDS_C64DTV_REVISION), ui_c64dtv_revision)
           CYCLE(ui_to_from[2].object, translate_text(IDS_C64DTV_WRITE_ENABLE), ui_c64dtv_enable)
           CYCLE(ui_to_from[3].object, translate_text(IDS_C64DTV_HUMMER_ADC), ui_c64dtv_enable)
           OK_CANCEL_BUTTON
         End;

    if (ui != NULL) {
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_Application_ReturnID, BTN_OK);

        DoMethod(browse_button, MUIM_Notify, MUIA_Pressed, FALSE,
                 app, 2, MUIM_CallHook, &BrowseFileHook);
    }

    return ui;
}
開發者ID:AreaScout,項目名稱:vice,代碼行數:33,代碼來源:uic64dtv.c


注:本文中的FILENAME函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。