27static const GUID IID_IDirectMusicInstrumentPRIVATE = { 0xbcb20080, 0xa40c, 0x11d1, { 0x86, 0xbc, 0x00, 0xc0, 0x4f, 0xbf, 0x8f, 0xef } };
29#define CONN_SRC_CC2 0x0082
30#define CONN_SRC_RPN0 0x0100
32#define CONN_TRN_BIPOLAR (1<<4)
33#define CONN_TRN_INVERT (1<<5)
35#define CONN_TRANSFORM(src, ctrl, dst) (((src) & 0x3f) << 10) | (((ctrl) & 0x3f) << 4) | ((dst) & 0xf)
110 FIXME(
"*sigh*... requested private/unspecified interface\n");
127 TRACE(
"(%p): new ref = %lu\n", iface,
ref);
137 TRACE(
"(%p): new ref = %lu\n", iface,
ref);
178 TRACE(
"(%p, %ld): stub\n",
This, dwPatch);
277 struct list *articulations)
420 IDirectMusicInstrument *iface;
440 TRACE(
"Created DirectMusicInstrument %p\n",
This);
441 TRACE(
" - header:\n");
442 TRACE(
" - regions: %ld\n",
This->header.cRegions);
443 TRACE(
" - locale: {bank: %#lx, instrument: %#lx} (patch %#lx)\n",
444 This->header.Locale.ulBank,
This->header.Locale.ulInstrument,
449 TRACE(
" - regions:\n");
452 TRACE(
" - region:\n");
453 TRACE(
" - header: {key: %u - %u, vel: %u - %u, options: %#x, group: %#x}\n",
457 TRACE(
" - wave_link: {options: %#x, group: %u, channel: %lu, index: %lu}\n",
460 TRACE(
" - wave_sample: {size: %lu, unity_note: %u, fine_tune: %d, attenuation: %ld, options: %#lx, loops: %lu}\n",
465 TRACE(
" - wave_loop[%u]: {size: %lu, type: %lu, start: %lu, length: %lu}\n",
i,
512 for (gen = gens + bag->
gen_ndx; gen < gens + (bag + 1)->gen_ndx; gen++)
573 if (unity_note == -1) unity_note =
sample->original_key;
580 if (start_loop || end_loop)
589 This->header.cRegions++;
608 WARN(
"Ignoring instrument zone without a sample id\n");
610 global_generators = generators;
625 IDirectMusicInstrument *iface;
635 This->header.Locale.ulBank = (preset->
bank & 0x7f) | ((preset->
bank << 1) & 0x7f00);
636 This->header.Locale.ulInstrument = preset->
preset;
638 desc->wszName,
sizeof(
desc->wszName));
648 WARN(
"Ignoring preset zone without an instrument\n");
650 global_generators = generators;
669 TRACE(
"Created DirectMusicInstrument %p\n",
This);
670 TRACE(
" - header:\n");
671 TRACE(
" - regions: %ld\n",
This->header.cRegions);
672 TRACE(
" - locale: {bank: %#lx, instrument: %#lx} (patch %#lx)\n",
673 This->header.Locale.ulBank,
This->header.Locale.ulInstrument,
678 TRACE(
" - regions:\n");
681 TRACE(
" - region:\n");
682 TRACE(
" - header: {key: %u - %u, vel: %u - %u, options: %#x, group: %#x}\n",
686 TRACE(
" - wave_link: {options: %#x, group: %u, channel: %lu, index: %lu}\n",
689 TRACE(
" - wave_sample: {size: %lu, unity_note: %u, fine_tune: %d, attenuation: %ld, options: %#lx, loops: %lu}\n",
694 TRACE(
" - wave_loop[%u]: {size: %lu, type: %lu, start: %lu, length: %lu}\n",
i,
753 IDirectMusicDownloadedInstrument **downloaded)
761 IDirectMusicObject *
wave;
764 if (
This->download)
goto done;
803 buffer->info.dwNumOffsetTableEntries = offset_count;
811 dmus_instrument->ulFirstRegionIdx = 0;
812 dmus_instrument->ulCopyrightIdx = 0;
813 dmus_instrument->ulGlobalArtIdx = 0;
816 &dmus_instrument->ulGlobalArtIdx, &
index);
820 if (dmus_region) dmus_region->ulNextRegionIdx =
index;
821 else dmus_instrument->ulFirstRegionIdx =
index;
831 dmus_region->ulRegionArtIdx = 0;
832 dmus_region->ulNextRegionIdx = 0;
833 dmus_region->ulFirstExtCkIdx = 0;
846 &dmus_region->ulRegionArtIdx, &
index);
855 *downloaded = &
This->IDirectMusicDownloadedInstrument_iface;
860 WARN(
"Failed to download instrument to port, hr %#lx\n",
hr);
875 WARN(
"Failed to unload instrument download buffer, hr %#lx\n",
hr);
878 IDirectMusicDownload *wave_download;
890 WARN(
"Failed to get wave download with id %#lx, hr %#lx\n",
region->WaveLink.ulTableIndex,
hr);
894 WARN(
"Failed to unload wave download buffer, hr %#lx\n",
hr);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
HRESULT collection_get_wave(struct collection *collection, DWORD index, IDirectMusicObject **out)
void collection_internal_addref(struct collection *collection)
void collection_internal_release(struct collection *collection)
static const WCHAR connections[]
#define MultiByteToWideChar
_ACRTIMP size_t __cdecl strlen(const char *)
struct _CONNECTION CONNECTION
struct _CONNECTIONLIST CONNECTIONLIST
#define DMUS_DOWNLOADINFO_INSTRUMENT2
struct _DMUS_DOWNLOADINFO DMUS_DOWNLOADINFO
struct _DMUS_REGION DMUS_REGION
struct _DMUS_ARTICULATION2 DMUS_ARTICULATION2
struct _DMUS_INSTRUMENT DMUS_INSTRUMENT
#define DMUS_E_UNSUPPORTED_STREAM
#define DMUS_E_NOT_DOWNLOADED_TO_PORT
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data, ULONG size)
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, DMUS_OBJECTDESC *desc, DWORD supported)
const char * debugstr_dmguid(const GUID *id)
static HRESULT stream_reset_chunk_data(IStream *stream, const struct chunk_entry *chunk)
#define DMUS_OBJ_NAME_INFO
#define MAKE_IDTYPE(id, type)
#define DMUS_OBJ_GUID_DLID
void Patch2MIDILOCALE(DWORD dwPatch, LPMIDILOCALE pLocale)
DWORD MIDILOCALE2Patch(const MIDILOCALE *pLocale)
HRESULT wave_download_to_port(IDirectMusicObject *iface, IDirectMusicPortDownload *port, DWORD *id)
#define IDirectMusicDownload_Release(p)
#define IDirectMusicPortDownload_GetDLId(p, a, b)
#define IDirectMusicPortDownload_GetBuffer(p, a, b)
#define IDirectMusicPortDownload_Download(p, a)
#define IDirectMusicPortDownload_Unload(p, a)
#define IDirectMusicInstrument_AddRef(p)
#define IDirectMusicDownload_GetBuffer(p, a, b)
#define IDirectMusicPortDownload_AllocateBuffer(p, a, b)
#define IDirectMusicDownloadedInstrument_AddRef(p)
struct IDirectMusicInstrument * LPDIRECTMUSICINSTRUMENT
#define IDirectMusicInstrument_Release(p)
#define DMUS_FOURCC_INFO_LIST
#define IDirectMusicObject_Release(p)
static const FxOffsetAndName offsets[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const IDirectMusicDownloadedInstrumentVtbl downloaded_instrument_vtbl
static HRESULT instrument_create(struct collection *collection, IDirectMusicInstrument **ret_iface)
HRESULT instrument_unload_from_port(IDirectMusicDownloadedInstrument *iface, IDirectMusicPortDownload *port)
static ULONG WINAPI downloaded_instrument_AddRef(IDirectMusicDownloadedInstrument *iface)
static BOOL parse_soundfont_generators(struct soundfont *soundfont, UINT index, struct sf_generators *preset_generators, struct sf_generators *generators)
static HRESULT WINAPI instrument_GetPatch(LPDIRECTMUSICINSTRUMENT iface, DWORD *pdwPatch)
static const struct sf_generators SF_DEFAULT_GENERATORS
static struct instrument * impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
static HRESULT WINAPI downloaded_instrument_QueryInterface(IDirectMusicDownloadedInstrument *iface, REFIID riid, VOID **ret_iface)
static HRESULT parse_lrgn_list(struct instrument *This, IStream *stream, struct chunk_entry *parent)
static HRESULT instrument_add_soundfont_instrument(struct instrument *This, struct soundfont *soundfont, UINT index, struct sf_generators *preset_generators)
static struct instrument * impl_from_IDirectMusicDownloadedInstrument(IDirectMusicDownloadedInstrument *iface)
static void write_articulation_download(struct list *articulations, ULONG *offsets, BYTE **ptr, UINT index, DWORD *first, UINT *end)
static ULONG WINAPI instrument_AddRef(LPDIRECTMUSICINSTRUMENT iface)
static ULONG WINAPI instrument_Release(LPDIRECTMUSICINSTRUMENT iface)
HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicPortDownload *port, IDirectMusicDownloadedInstrument **downloaded)
static ULONG WINAPI downloaded_instrument_Release(IDirectMusicDownloadedInstrument *iface)
static HRESULT WINAPI instrument_SetPatch(LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch)
static void region_destroy(struct region *region)
static HRESULT instrument_add_soundfont_region(struct instrument *This, struct soundfont *soundfont, struct sf_generators *generators)
static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct chunk_entry *parent)
static const GUID IID_IDirectMusicInstrumentPRIVATE
static const IDirectMusicInstrumentVtbl instrument_vtbl
static HRESULT parse_lart_list(struct instrument *This, IStream *stream, struct chunk_entry *parent, struct list *articulations)
static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct chunk_entry *parent, DMUS_OBJECTDESC *desc)
static HRESULT WINAPI instrument_QueryInterface(LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ret_iface)
HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent, struct collection *collection, DMUS_OBJECTDESC *desc, IDirectMusicInstrument **ret_iface)
HRESULT instrument_create_from_soundfont(struct soundfont *soundfont, UINT index, struct collection *collection, DMUS_OBJECTDESC *desc, IDirectMusicInstrument **ret_iface)
static HRESULT parse_art1_chunk(struct instrument *This, IStream *stream, struct chunk_entry *chunk, struct list *articulations)
#define memcpy(s1, s2, n)
D3D11_SHADER_VARIABLE_DESC desc
#define IsEqualIID(riid1, riid2)
static unsigned __int64 next
#define offsetof(TYPE, MEMBER)
static __inline const char * debugstr_fourcc(unsigned int cc)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
static const char * debugstr_sf_gen(struct sf_gen *gen)
@ SF_GEN_STARTLOOP_ADDRS_OFFSET
@ SF_GEN_STARTLOOP_ADDRS_COARSE_OFFSET
@ SF_GEN_ENDLOOP_ADDRS_OFFSET
@ SF_GEN_START_ADDRS_COARSE_OFFSET
@ SF_GEN_INITIAL_FILTER_FC
@ SF_GEN_END_ADDRS_COARSE_OFFSET
@ SF_GEN_OVERRIDING_ROOT_KEY
@ SF_GEN_START_ADDRS_OFFSET
@ SF_GEN_END_ADDRS_OFFSET
@ SF_GEN_ENDLOOP_ADDRS_COARSE_OFFSET
IDirectMusicInstrument IDirectMusicInstrument_iface
IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument_iface
IDirectMusicDownload * download
struct list articulations
struct collection * collection
struct list articulations
union sf_amount amount[SF_GEN_END_OPER]
struct sf_instrument * inst
#define CONTAINING_RECORD(address, type, field)