source: branches/v2.9/classes/c/c_audio/cwmidi.c

Last change on this file was 2, checked in by stevenhl, 8 years ago

Import sources from cwmm-full.zip dated 2005-03-21

File size: 7.0 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];
48extern 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 @@CHANGE 0.2.8
75
76 Remove 'Start' menu for Midi files if Timidity is installed. Workaround
77 for WPS crash. MAy be removed as soon as Timidity is fixed.
78
79 */
80 if(globalHaveTimidity)
81 {
82 WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT( ID_MENU_START, TRUE), 0L);
83 }
84 WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT( ID_MENU_CONVERT, FALSE), 0L);
85 return bRC;
86}
87
88
89SOM_Scope ULONG SOMLINK cwmidi_cwmmAddAudioInformationPage(MMMIDI *somSelf,
90 HWND hwndNotebook)
91
92{
93 /* MMMIDIData *somThis = MMMIDIGetData(somSelf); */
94 MMMIDIMethodDebug("MMMIDI","cwmidi_cwmmAddAudioInformationPage");
95
96 // return (MMMIDI_parent_MMAudio_cwmmAddAudioInformationPage(somSelf, hwndNotebook));
97 return SETTINGS_PAGE_REMOVED;
98}
99
100
101/*
102 * SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceType(M_CWMIDI *somSelf)
103 */
104
105/*
106 * The prototype for cwmidiM_wpclsQueryInstanceType was replaced by the following prototype:
107 */
108SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceType(M_MMMIDI *somSelf)
109{
110 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
111 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryInstanceType");
112
113 return TYPE_MIDI;
114 // return "MIDI";
115}
116
117
118/*
119 * SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceFilter(M_CWMIDI *somSelf)
120 */
121
122/*
123 * The prototype for cwmidiM_wpclsQueryInstanceFilter was replaced by the following prototype:
124 */
125SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryInstanceFilter(M_MMMIDI *somSelf)
126{
127 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
128 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryInstanceFilter");
129
130 return "*.mid";
131}
132
133
134/*
135 * SOM_Scope BOOL SOMLINK cwmidiM_wpclsQueryDefaultHelp(M_CWMIDI *somSelf,
136 * PULONG pHelpPanelId,
137 * PSZ pszHelpLibrary)
138 */
139
140/*
141 * The prototype for cwmidiM_wpclsQueryDefaultHelp was replaced by the following prototype:
142 */
143SOM_Scope BOOL SOMLINK cwmidiM_wpclsQueryDefaultHelp(M_MMMIDI *somSelf,
144 PULONG pHelpPanelId,
145 PSZ pszHelpLibrary)
146{
147 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
148 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryDefaultHelp");
149
150 if(pHelpPanelId)
151 *pHelpPanelId=MIDIFILE_HELP_PANEL;
152 if(pszHelpLibrary)
153 strncpy(pszHelpLibrary, chrHelpLibrary, CCHMAXPATH);
154 return TRUE;
155}
156
157
158/*
159 * SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryTitle(M_CWMIDI *somSelf)
160 */
161
162/*
163 * The prototype for cwmidiM_wpclsQueryTitle was replaced by the following prototype:
164 */
165SOM_Scope PSZ SOMLINK cwmidiM_wpclsQueryTitle(M_MMMIDI *somSelf)
166{
167 static char chrTitle[20]={0};
168 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
169 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryTitle");
170 if(chrTitle[0]==0)
171 if(!getMessage(chrTitle, IDSTR_MIDITITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
172 strcpy(chrTitle, CLSTITLE_MIDI);
173
174 return chrTitle;
175}
176
177/*
178 * The prototype for cwmidiM_wpclsQueryIconData was replaced by the following prototype:
179 */
180SOM_Scope ULONG SOMLINK cwmidiM_wpclsQueryIconData(M_MMMIDI *somSelf,
181 PICONINFO pIconInfo)
182{
183 HMODULE hmod;
184 /* M_CWMIDIData *somThis = M_CWMIDIGetData(somSelf); */
185 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsQueryIconData");
186
187 hmod=queryModuleHandle();
188 if(!hmod)
189 return M_MMMIDI_parent_M_MMAudio_wpclsQueryIconData(somSelf, pIconInfo);
190
191 if (pIconInfo) {
192 pIconInfo->fFormat = ICON_RESOURCE;
193 pIconInfo->hmod = hmod;
194 pIconInfo->resid = ID_ICONMIDIFILE;
195 } /* endif */
196
197 return ( sizeof(ICONINFO) );
198}
199
200
201SOM_Scope BOOL SOMLINK cwmidiM_wpclsCreateDefaultTemplates(M_MMMIDI *somSelf,
202 WPObject* Folder)
203{
204 /* M_MMMIDIData *somThis = M_MMMIDIGetData(somSelf); */
205 M_MMMIDIMethodDebug("M_MMMIDI","cwmidiM_wpclsCreateDefaultTemplates");
206
207 /* Default installation contains a MIDI IO-Proc. I'm lazy here and
208 don't check if it's still installed but just create a default template. */
209 mmclsCreateTheDefaultTemplate(somSelf, Folder);
210 return TRUE;
211 return (M_MMMIDI_parent_M_MMAudio_wpclsCreateDefaultTemplates(somSelf,
212 Folder));
213}
214
Note: See TracBrowser for help on using the repository browser.