home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / audio / idfedit / idfedit.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  4KB  |  164 lines

  1. //************************************************************************
  2. //**
  3. //**  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  4. //**  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
  5. //**  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
  6. //**  A PARTICULAR PURPOSE.
  7. //**
  8. //**  Copyright (C) 1993 - 1997 Microsoft Corporation. All Rights Reserved.
  9. //**
  10. //**  IDFEDIT.H
  11. //**
  12. //**  DESCRIPTION:
  13. //**
  14. //**
  15. //**  HISTORY:
  16. //**     04/22/93       created.
  17. //**
  18. //************************************************************************
  19.  
  20. #if !defined IDFEDIT_H
  21. #define IDFEDIT_H
  22.  
  23. #include <idf.h>
  24. #include "oldidf.h"
  25. #include "res.h"
  26. #include "globals.h"
  27.  
  28. // main.c
  29. //
  30. int  WINAPI ErrorBox(
  31.    UINT    wStringID,      // stringtable ID
  32.    UINT    wType,          // type of message box (MB_xxx flags)
  33.    ...);
  34.  
  35. #define EB_FATAL (MB_OK | MB_ICONEXCLAMATION)
  36. #define EB_ERROR (MB_OK | MB_ICONHAND)
  37. #define EB_QUERY (MB_YESNO | MB_ICONQUESTION)
  38. #define EB_INFO  (MB_OK | MB_ICONINFORMATION)
  39. #define EB_YNC   (MB_YESNOCANCEL | MB_ICONQUESTION)
  40.  
  41. #if !defined SZCODE
  42.   #define SZCODE STATIC CONST TCHAR
  43. #endif
  44.  
  45. // debug stuff
  46. //
  47. #define SQUAWKNUMZ(num) #num
  48. #define SQUAWKNUM(num) SQUAWKNUMZ(num)
  49. #define SQUAWK __FILE__ "(" SQUAWKNUM(__LINE__) ") : --"
  50. #if defined _DEBUG || defined DEBUG || defined DEBUG_RETAIL
  51.   #define STATICFN
  52.   #define DEBUGLINE __FILE__ "(" SQUAWKNUM(__LINE__) ") "
  53.   #ifdef _X86_
  54.     #define INLINE_BREAK _asm {int 3}
  55.   #else
  56.     #define INLINE_BREAK DebugBreak()
  57.   #endif
  58.   #define assert(exp) {\
  59.       if (!(exp)) {\
  60.           OutputDebugString(DEBUGLINE "assert failed: " #exp "\r\n"); \
  61.           INLINE_BREAK; \
  62.           }\
  63.       }
  64. #else
  65.   #define STATICFN static
  66.   #define assert(a) ((void)0)
  67.   #define INLINE_BREAK
  68. #endif
  69.  
  70. // idf.c
  71. //
  72. BOOL WINAPI PromptForIDFName (
  73.     HWND    hwnd,
  74.     LPTSTR  lpszPath,
  75.     LPTSTR  lpszTitle,
  76.     BOOL    fSave);
  77.  
  78. BOOL LoadIDFFromFile (
  79.    LPIDFHEAD pIDF,
  80.    LPTSTR    pszFile);
  81.  
  82. BOOL SaveIDFToFile (
  83.    LPIDFHEAD pIDF,
  84.    LPTSTR    pszFileIn);
  85.  
  86. VOID FreeIDFFile (
  87.    LPIDFHEAD pIDF);
  88.  
  89. LPINSTRUMENT WINAPI NewIDFInstrum (
  90.    LPIDFHEAD  pIDF,
  91.    LPRIFFLIST pList,
  92.    LPSTR      pszInstrument);
  93.  
  94. VOID DeleteInstrum (
  95.    LPIDFHEAD pIDF);
  96.  
  97. VOID CopyInstrumToClip (
  98.    LPIDFHEAD pIDF);
  99.  
  100. VOID PasteInstrum (
  101.    LPIDFHEAD pIDF);
  102.  
  103. LPRIFF FindListChunk (
  104.    LPRIFFLIST pList,
  105.    DWORD      fccToFind);
  106.  
  107. void CopyInstrumData (
  108.    LPINSTRUMENT pInstrum, 
  109.    LPRIFFLIST   pList);
  110.  
  111. LPVOID CopyForEditing (
  112.    LPVOID pData, 
  113.    UINT cbData);
  114.  
  115. // head.c
  116. //
  117. LONG CALLBACK HeadWndProc (
  118.    HWND   hWnd,
  119.    UINT   wMsgID,
  120.    WPARAM wParam,
  121.    LPARAM lParam);
  122.  
  123. #define HM_REFRESH_TREE   (WM_USER+1)   
  124. #define Head_RefreshTree(hWnd) SendMessage (hWnd, HM_REFRESH_TREE, 0, 0);
  125.  
  126.  
  127. // ======================== Global Variables =======================
  128.  
  129. // if NO_VARS is defined, dont refer to global variables
  130. // at all.  this is typically used when creating binary
  131. // data using structures defined in this file.
  132. //
  133. #ifndef NO_VARS
  134. //
  135. // if DECLARE_VARS is defined, create global variables
  136. // otherwise just refer to them as externs.  this works
  137. // so long as only one module defines DECLARE_VARS (usually winmain)
  138. //
  139. #ifdef DECLARE_VARS
  140.  
  141.  #define PUBLIC
  142.  PUBLIC CONST TCHAR cszHdrClass[]  = "IDFHdr";
  143.  PUBLIC CONST TCHAR cszInstrumClass[]  = "IDFInstrum";
  144.  
  145. #else
  146.  
  147.  #define PUBLIC extern
  148.  PUBLIC CONST TCHAR cszHdrClass[];
  149.  PUBLIC CONST TCHAR cszInstrumClass[];
  150.  
  151. #endif
  152.  
  153. PUBLIC HINSTANCE hInst;       // WinMain, set from hInstance
  154. PUBLIC HWND      hWndMain;    // WinMain, set from CreateWindow
  155. PUBLIC TCHAR     szApp[32];   // WinMain, set from IDS_APPNAME string
  156. PUBLIC DWORD     fdwExStyle;  // WinMain
  157. #ifdef USE_MDI
  158.  PUBLIC HWND      hWndClient;  // handle to MDI Client
  159. #endif
  160.  
  161. #endif // end of NO_VARS ifdef
  162.  
  163. #endif // IDFEDIT_H
  164.