File: ModuleConstants.h

package info (click to toggle)
audacity 3.7.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 134,800 kB
  • sloc: cpp: 366,277; ansic: 198,323; lisp: 7,761; sh: 3,414; python: 1,501; xml: 1,385; perl: 854; makefile: 125
file content (61 lines) | stat: -rw-r--r-- 2,106 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**********************************************************************

  Audacity: A Digital Audio Editor

  ModuleConstants.h

  Paul Licameli split from ModuleManager.h

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

#ifndef __AUDACITY_MODULE_CONSTANTS__
#define __AUDACITY_MODULE_CONSTANTS__

#include <string>

#define ModuleDispatchName "ModuleDispatch"

#ifdef _MSC_VER
   #define DLL_API _declspec(dllexport)
   #define DLL_IMPORT _declspec(dllimport)
#else
   #define DLL_API __attribute__ ((visibility("default")))
   #define DLL_IMPORT
#endif

enum ModuleDispatchTypes
{
   ModuleInitialize,
   ModuleTerminate,
   AppInitialized,
   AppQuiting,
   ProjectInitialized,
   ProjectClosing
};

// Macro generates one of the required entry points of a module
// GetVersionString
// REQUIRED for the module to be accepted by Audacity.
// Without it Audacity will see a version number mismatch.
#define DEFINE_VERSION_CHECK                                           \
extern "C" {                                                           \
   DLL_API const wchar_t * GetVersionString()                          \
   {                                                                   \
     /* Make sure that this version of the module requires the version \
      of Audacity it is built with.                                    \
      For now, the versions must match exactly for Audacity to         \
      agree to load the module. */                                     \
      return AUDACITY_VERSION_STRING;                                  \
   }                                                                   \
}

// Macro generates minimal required entry points to load a module
// Use it when you don't care about event notifications from the application
#define DEFINE_MODULE_ENTRIES                                          \
DEFINE_VERSION_CHECK                                                   \
extern "C" DLL_API int ModuleDispatch(ModuleDispatchTypes type){ return 1; }

//! This program's name
UTILITY_API extern const std::wstring AppName;

#endif