wavelength 1.0.0
Loading...
Searching...
No Matches
SyntheditCtl.h
Go to the documentation of this file.
1#pragma once
2
3#include <afxctl.h>
4
7#include "utl/Str.h"
8
16class CSyntheditCtrl : public COleControl {
17 DECLARE_DYNCREATE(CSyntheditCtrl)
18
19public:
22
31 virtual void OnDraw(CDC *pdc, const CRect &rcBounds, const CRect &rcInvalid);
32
39 virtual void DoPropExchange(CPropExchange *pPX);
40
42 virtual void OnResetState();
43
45 enum {
79 };
80
98
99protected:
106
107 DECLARE_OLECREATE_EX(CSyntheditCtrl)
108 DECLARE_OLETYPELIB(CSyntheditCtrl)
109 DECLARE_PROPPAGEIDS(CSyntheditCtrl)
110 DECLARE_OLECTLTYPE(CSyntheditCtrl)
111
112 DECLARE_MESSAGE_MAP()
113
114
121 afx_msg long NewBank();
122
132 afx_msg long AttachSampleToInstrument(long iBankID, long iSampleID, long iInstrumentID);
133
142 afx_msg long DeleteInstrument(long iBankID, long iInstrumentID);
143
152 afx_msg long DeleteSample(long iBankID, long iSampleID);
153
161 afx_msg long NewInstrument(long iBankID);
162
170 afx_msg long NewSample(long iBankID);
171
179 afx_msg long RetireBank(long iBankID);
180
187 afx_msg long ShutdownSynthCtrl();
188
196 afx_msg long MakeSimpleBankFile();
197
208 afx_msg long
209 XferSynthData(long iBankID, long iAction, VARIANT FAR *ioLongArray, VARIANT FAR *ioStringArray);
210
217 afx_msg long DoDebugSomething();
218
225 afx_msg long ReadAndSaveBankFile();
226
235 afx_msg long SaveBank(long iBankID, long iSaveAs);
236
244 afx_msg long NewSamplesFromFolder(long iBankID);
245
254 afx_msg long NewInstrumentsFromFolder(long iBankID);
255
265 afx_msg long NewSampleDescription(long iBankID, long iInstrumentID, long iSampleIDOptional);
266
276 afx_msg long DeleteSampleDescription(long iBankID, long iInstrumentID, long iSampleDescID);
277
285 afx_msg long InitSynthControl(LPCTSTR iSystemDirectory);
286
287 DECLARE_DISPATCH_MAP()
288
294 afx_msg void AboutBox();
295
297 void FireUpdateSampleComments(long iBankID, VARIANT FAR *iSampleIDs) {
298 FireEvent(
299 eventidUpdateSampleComments, EVENT_PARAM(VTS_I4 VTS_PVARIANT), iBankID, iSampleIDs);
300 }
301
303 void
304 FireUpdateSampleDescriptionComments(long iBankID, long iSampleID, VARIANT FAR *iSampleDescIDs) {
306 EVENT_PARAM(VTS_I4 VTS_I4 VTS_PVARIANT),
307 iBankID,
308 iSampleID,
309 iSampleDescIDs);
310 }
311
313 void FireUpdateSampleData(long iBankID, long iSampleID) {
314 FireEvent(eventidUpdateSampleData, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iSampleID);
315 }
316
318 void FireUpdateBankData(long iBankID) {
319 FireEvent(eventidUpdateBankData, EVENT_PARAM(VTS_I4), iBankID);
320 }
321
323 void FireUpdateInstrumentData(long iBankID, long iInstrumentID) {
324 FireEvent(eventidUpdateInstrumentData, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iInstrumentID);
325 }
326
328 void FireUpdateSampleDescData(long iBankID, long iInstrumentID, long iSampleDescID) {
330 EVENT_PARAM(VTS_I4 VTS_I4 VTS_I4),
331 iBankID,
332 iInstrumentID,
333 iSampleDescID);
334 }
335
337 void FireUpdateInstrumentComments(long iBankID, long iInstrumentID) {
338 FireEvent(
339 eventidUpdateInstrumentComments, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iInstrumentID);
340 }
341
343 void FireInsertNewSample(long iBankID, long iSampleID) {
344 FireEvent(eventidInsertNewSample, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iSampleID);
345 }
346
348 void FireProtectWorkSheets(long iBankID, long iYesNo) {
349 FireEvent(eventidProtectWorkSheets, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iYesNo);
350 }
351
353 void FireInsertNewInstrument(long iBankID, long iInstrumentID) {
354 FireEvent(eventidInsertNewInstrument, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iInstrumentID);
355 }
356
358 void FireInsertNewSampleDescription(long iBankID, long iInstrumentID, long iSampleDescID) {
360 EVENT_PARAM(VTS_I4 VTS_I4 VTS_I4),
361 iBankID,
362 iInstrumentID,
363 iSampleDescID);
364 }
365
367 void FireDeleteSampleDescription(long iBankID, long iInstrumentID, long iSampleDescID) {
369 EVENT_PARAM(VTS_I4 VTS_I4 VTS_I4),
370 iBankID,
371 iInstrumentID,
372 iSampleDescID);
373 }
374
376 void FireDeleteInstrument(long iBankID, long iInstrumentID) {
377 FireEvent(eventidDeleteInstrument, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iInstrumentID);
378 }
379
381 void FireDeleteSample(long iBankID, long iSampleID) {
382 FireEvent(eventidDeleteSample, EVENT_PARAM(VTS_I4 VTS_I4), iBankID, iSampleID);
383 }
384
386 void FireUpdateHyperLinks(long iBankID) {
387 FireEvent(eventidUpdateHyperLinks, EVENT_PARAM(VTS_I4), iBankID);
388 }
389
390 DECLARE_EVENT_MAP()
391
392private:
402 long NewSampleFromFile(long iBankID, const String &filename, bool *alreadyExists);
403
414 void AddSamplesFromFolder(const String &folder, unsigned short bankID, bool asInstrument);
415
427 long XferSampleDescData(long iBankID,
428 long iAction,
429 HxLongSafeArray &longs,
430 HxStringSafeArray &strings);
431
444 long XferInstrumentData(long iBankID,
445 long iAction,
446 HxLongSafeArray &longs,
447 HxStringSafeArray &strings);
448
459 long
460 XferSampleData(long iBankID, long iAction, HxLongSafeArray &longs, HxStringSafeArray &strings);
461
473 long
474 XferBankData(long iBankID, long iAction, HxLongSafeArray &longs, HxStringSafeArray &strings);
475};
void FireUpdateSampleDescriptionComments(long iBankID, long iSampleID, VARIANT FAR *iSampleDescIDs)
Definition SyntheditCtl.h:304
afx_msg long NewSample(long iBankID)
Add the samples of the WAV files the user picks.
void FireProtectWorkSheets(long iBankID, long iYesNo)
Definition SyntheditCtl.h:348
void FireInsertNewInstrument(long iBankID, long iInstrumentID)
Definition SyntheditCtl.h:353
afx_msg long NewSampleDescription(long iBankID, long iInstrumentID, long iSampleIDOptional)
Add descriptions to an instrument for a sample, or for the WAV files the user picks.
afx_msg void AboutBox()
Show the about box.
void FireUpdateInstrumentData(long iBankID, long iInstrumentID)
Definition SyntheditCtl.h:323
afx_msg long ReadAndSaveBankFile()
Create a bank, save it, and close it.
afx_msg long SaveBank(long iBankID, long iSaveAs)
Save a bank, prompting for the file when it has none or when requested.
~CSyntheditCtrl()
Stop the systems InitSynthControl() started.
afx_msg long DeleteSample(long iBankID, long iSampleID)
Delete a sample and the descriptions that play it, and update the worksheets.
afx_msg long DeleteInstrument(long iBankID, long iInstrumentID)
Delete an instrument and its descriptions, and update the worksheets.
void FireDeleteSampleDescription(long iBankID, long iInstrumentID, long iSampleDescID)
Definition SyntheditCtl.h:367
afx_msg long ShutdownSynthCtrl()
Do nothing.
afx_msg long RetireBank(long iBankID)
Close a bank.
void FireDeleteInstrument(long iBankID, long iInstrumentID)
Definition SyntheditCtl.h:376
afx_msg long NewInstrument(long iBankID)
Add an instrument with program zero.
afx_msg long DoDebugSomething()
Do nothing.
virtual void OnResetState()
afx_msg long InitSynthControl(LPCTSTR iSystemDirectory)
Start the systems with the editor configuration.
void FireUpdateSampleData(long iBankID, long iSampleID)
Definition SyntheditCtl.h:313
afx_msg long DeleteSampleDescription(long iBankID, long iInstrumentID, long iSampleDescID)
Delete a description from an instrument.
void FireUpdateSampleDescData(long iBankID, long iInstrumentID, long iSampleDescID)
Definition SyntheditCtl.h:328
afx_msg long XferSynthData(long iBankID, long iAction, VARIANT FAR *ioLongArray, VARIANT FAR *ioStringArray)
Read or write the data of a bank, an instrument, a sample description, or a sample.
virtual void OnDraw(CDC *pdc, const CRect &rcBounds, const CRect &rcInvalid)
Fill the bounds with white and draw an ellipse.
virtual void DoPropExchange(CPropExchange *pPX)
Exchange the persistent properties, of which there are none besides the version.
afx_msg long AttachSampleToInstrument(long iBankID, long iSampleID, long iInstrumentID)
Add a description that plays a sample to an instrument.
afx_msg long NewInstrumentsFromFolder(long iBankID)
Add an instrument for each folder, the one the user picks and its subfolders, that has WAV files,...
afx_msg long NewSamplesFromFolder(long iBankID)
Add the WAV files of a folder the user picks, and of its subfolders, as samples.
void FireUpdateHyperLinks(long iBankID)
Definition SyntheditCtl.h:386
void FireInsertNewSample(long iBankID, long iSampleID)
Definition SyntheditCtl.h:343
void FireDeleteSample(long iBankID, long iSampleID)
Definition SyntheditCtl.h:381
void FireUpdateBankData(long iBankID)
Definition SyntheditCtl.h:318
void FireInsertNewSampleDescription(long iBankID, long iInstrumentID, long iSampleDescID)
Definition SyntheditCtl.h:358
XferAction
The data XferSynthData() reads or writes, as the add-in numbers it.
Definition SyntheditCtl.h:82
@ kActionSetBankData
Definition SyntheditCtl.h:92
@ kActionGetBankInstrumentIDs
Definition SyntheditCtl.h:88
@ kActionSetSampleDescData
Definition SyntheditCtl.h:94
@ kActionGetInstrumentSampleDescIDs
Definition SyntheditCtl.h:89
@ kActionSetSampleData
Definition SyntheditCtl.h:95
@ kActionSetInstrumentData
Definition SyntheditCtl.h:93
@ kActionGetSampleDescData
Definition SyntheditCtl.h:85
@ kActionGetInstrumentData
Definition SyntheditCtl.h:84
@ kActionGetSampleData
Definition SyntheditCtl.h:86
@ kActionGetBankSamplesIDs
Definition SyntheditCtl.h:87
@ kActionGetInstrumentWriteup
Definition SyntheditCtl.h:91
@ kActionGetReferencedSample
Definition SyntheditCtl.h:96
@ kActionGetSampleWriteup
Definition SyntheditCtl.h:90
@ kActionGetBankData
Definition SyntheditCtl.h:83
void FireUpdateInstrumentComments(long iBankID, long iInstrumentID)
Definition SyntheditCtl.h:337
@ eventidUpdateInstrumentComments
Definition SyntheditCtl.h:70
@ dispidAttachSampleToInstrument
Definition SyntheditCtl.h:47
@ eventidDeleteSample
Definition SyntheditCtl.h:77
@ dispidNewInstrument
Definition SyntheditCtl.h:50
@ dispidDoDebugSomething
Definition SyntheditCtl.h:56
@ dispidShutdownSynthCtrl
Definition SyntheditCtl.h:53
@ dispidReadAndSaveBankFile
Definition SyntheditCtl.h:57
@ dispidDeleteSample
Definition SyntheditCtl.h:49
@ dispidMakeSimpleBankFile
Definition SyntheditCtl.h:54
@ dispidDeleteInstrument
Definition SyntheditCtl.h:48
@ eventidUpdateBankData
Definition SyntheditCtl.h:67
@ eventidInsertNewSampleDescription
Definition SyntheditCtl.h:74
@ eventidDeleteSampleDescription
Definition SyntheditCtl.h:75
@ dispidNewSamplesFromFolder
Definition SyntheditCtl.h:59
@ dispidInitSynthControl
Definition SyntheditCtl.h:63
@ dispidNewSample
Definition SyntheditCtl.h:51
@ eventidDeleteInstrument
Definition SyntheditCtl.h:76
@ eventidUpdateSampleDescriptionComments
Definition SyntheditCtl.h:65
@ dispidNewInstrumentsFromFolder
Definition SyntheditCtl.h:60
@ dispidRetireBank
Definition SyntheditCtl.h:52
@ eventidProtectWorkSheets
Definition SyntheditCtl.h:72
@ dispidSaveBank
Definition SyntheditCtl.h:58
@ eventidUpdateInstrumentData
Definition SyntheditCtl.h:68
@ dispidNewBank
Definition SyntheditCtl.h:46
@ eventidInsertNewSample
Definition SyntheditCtl.h:71
@ dispidDeleteSampleDescription
Definition SyntheditCtl.h:62
@ eventidInsertNewInstrument
Definition SyntheditCtl.h:73
@ dispidNewSampleDescription
Definition SyntheditCtl.h:61
@ eventidUpdateHyperLinks
Definition SyntheditCtl.h:78
@ eventidUpdateSampleDescData
Definition SyntheditCtl.h:69
@ eventidUpdateSampleData
Definition SyntheditCtl.h:66
@ dispidXferSynthData
Definition SyntheditCtl.h:55
@ eventidUpdateSampleComments
Definition SyntheditCtl.h:64
afx_msg long NewBank()
Create a bank, loading it from a file the user picks or prompting for its bank change identifier.
void FireUpdateSampleComments(long iBankID, VARIANT FAR *iSampleIDs)
Definition SyntheditCtl.h:297
afx_msg long MakeSimpleBankFile()
Create a bank of six instruments of four samples each, which the user picks, save it,...
One-dimensional array of 32-bit integers (VT_I4).
Definition HxLongSafeArray.h:12
One-dimensional array of strings (VT_BSTR), converted to and from multibyte text.
Definition HxStringSafeArray.h:13
Growable text buffer that is also a PrnStream.
Definition string.h:19