source: trunk/classes/c/c_audio/cwmidi.c

Last change on this file was 192, checked in by gyoung, 15 months ago

Remove Edit audio from the MIDI object Open as menu

File size: 6.7 KB
Line 
1/*
2 * (C) Chris Wohlgemuth 2002-2004
3 *
4 */
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20/*
21 * If you need another license for your project/product contact me at
22 *
23 * http://www.os2world.com/cdwriting
24 * http://www.geocities.com/SiliconValley/Sector/5785/
25 */
26
27/*
28 * This file was generated by the SOM Compiler and Emitter Framework.
29 * Generated using:
30 * SOM Emitter emitctm: 2.42
31 */
32
33#ifndef SOM_Module_cwmidi_Source
34#define SOM_Module_cwmidi_Source
35#endif
36#define CWMIDI_Class_Source
37#define M_CWMIDI_Class_Source
38
39#define INCL_PM
40#include <os2.h>
41#include <stdio.h>
42#include "helpid.h"
43#include "cwmidi.ih"
44#include "cwaudioinc.h"
45#include "sys_funcs.h"
46
47extern char chrHelpLibrary[CCHMAXPATH];
48//extern BOOL globalHaveTimidity;
49
50HMODULE queryResModuleHandle(void);
51HMODULE queryModuleHandle(void);
52BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
53BOOL mmclsCreateTheDefaultTemplate(M_WPObject *somSelf,
54 WPObject* Folder);
55
56
57/*
58 * The prototype for cwmidi_wpModifyPopupMenu was replaced by the following prototype:
59 */
60SOM_Scope BOOL SOMLINK cwmidi_wpModifyPopupMenu(MMMIDI *somSelf,
61 HWND hwndMenu,
62 HWND hwndCnr,
63 ULONG iPosition)
64{
65 BOOL bRC;
66 /* CWMIDIData *somThis = CWMIDIGetData(somSelf); */
67 MMMIDIMethodDebug("MMMIDI","cwmidi_wpModifyPopupMenu");
68
69 bRC=(MMMIDI_parent_MMAudio_wpModifyPopupMenu(somSelf,
70 hwndMenu,
71 hwndCnr,
72 iPosition));
73
74 WinSendMsg(hwndMenu,MM_DELETEITEM,MPFROM2SHORT( ID_MENU_EDITOR, TRUE), 0L);
75 WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT( ID_MENU_CONVERT, FALSE), 0L);
76 return bRC;
77}
78
79
80SOM_Scope ULONG SOMLINK cwmidi_cwmmAddAudioInformationPage(MMMIDI *somSelf,
81 HWND hwndNotebook)
82
83{
84 /* MMMIDIData *somThis = MMMIDIGetData(somSelf); */
85 MMMIDIMethodDebug("MMMIDI","cwmidi_cwmmAddAudioInformationPage");
86
87 // return (MMMIDI_parent_MMAudio_cwmmAddAudioInformationPage(somSelf, hwndNotebook));
88 return SETTINGS_PAGE_REMOVED;
89}
90
91
92/*
93 * SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceType(M_CWMIDI *somSelf)
94 */
95
96/*
97 * The prototype for cwmidiM_wpclsQueryInstanceType was replaced by the following prototype:
98 */
99SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceType(M_MMMIDI *somSelf)
100{
101 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
102 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryInstanceType");
103
104 return TYPE_MIDI;
105 // return "MIDI";
106}
107
108
109/*
110 * SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceFilter(M_CWMIDI *somSelf)
111 */
112
113/*
114 * The prototype for cwmidiM_wpclsQueryInstanceFilter was replaced by the following prototype:
115 */
116SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceFilter(M_MMMIDI *somSelf)
117{
118 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
119 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryInstanceFilter");
120
121 return "*.mid";
122}
123
124
125/*
126 * SOM_Scope BOOL SOMLINK cwmidiM_wpclsQueryDefaultHelp(M_CWMIDI *somSelf,
127 * PULONG pHelpPanelId,
128 * PSZ pszHelpLibrary)
129 */
130
131/*
132 * The prototype for cwmidiM_wpclsQueryDefaultHelp was replaced by the following prototype:
133 */
134SOM_Scope BOOL SOMLINK cwmidiM_wpclsQueryDefaultHelp(M_MMMIDI *somSelf,
135 PULONG pHelpPanelId,
136 PSZ pszHelpLibrary)
137{
138 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
139 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryDefaultHelp");
140
141 if(pHelpPanelId)
142 *pHelpPanelId=MIDIFILE_HELP_PANEL;
143 if(pszHelpLibrary)
144 strncpy(pszHelpLibrary, chrHelpLibrary, CCHMAXPATH);
145 return TRUE;
146}
147
148
149/*
150 * SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryTitle(M_CWMIDI *somSelf)
151 */
152
153/*
154 * The prototype for cwmidiM_wpclsQueryTitle was replaced by the following prototype:
155 */
156SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryTitle(M_MMMIDI *somSelf)
157{
158 static char chrTitle[20]={0};
159 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
160 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryTitle");
161 if(chrTitle[0]==0)
162 if(!getMessage(chrTitle, IDSTR_MIDITITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
163 strcpy(chrTitle, CLSTITLE_MIDI);
164
165 return chrTitle;
166}
167
168/*
169 * The prototype for cwmidiM_wpclsQueryIconData was replaced by the following prototype:
170 */
171SOM_Scope ULONG SOMLINK cwmidiM_wpclsQueryIconData(M_MMMIDI *somSelf,
172 PICONINFO pIconInfo)
173{
174 HMODULE hmod;
175 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
176 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryIconData");
177
178 hmod=queryModuleHandle();
179 if(!hmod)
180 return M_MMMIDI_parent_M_MMAudio_wpclsQueryIconData(somSelf, pIconInfo);
181
182 if (pIconInfo) {
183 pIconInfo->fFormat = ICON_RESOURCE;
184 pIconInfo->hmod = hmod;
185 pIconInfo->resid = ID_ICONMIDIFILE;
186 } /* endif */
187
188 return ( sizeof(ICONINFO) );
189}
190
191
192SOM_Scope BOOL SOMLINK cwmidiM_wpclsCreateDefaultTemplates(M_MMMIDI *somSelf,
193 WPObject* Folder)
194{
195 /* M_MMMIDIData *somThis = M_MMMIDIGetData(somSelf); */
196 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsCreateDefaultTemplates");
197
198 /* Default installation contains a MIDI IO-Proc. I'm lazy here and
199 don't check if it's still installed but just create a default template. */
200 mmclsCreateTheDefaultTemplate(somSelf, Folder);
201 return TRUE;
202 return (M_MMMIDI_parent_M_MMAudio_wpclsCreateDefaultTemplates(somSelf,
203 Folder));
204}
205
Note: See TracBrowser for help on using the repository browser.