ReactOS 0.4.17-dev-934-g091855f
dmusic_band.h File Reference
#include "dmusici.h"
#include "dmusicf.h"
Include dependency graph for dmusic_band.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

HRESULT create_dmband (REFIID riid, void **ret_iface)
 
HRESULT band_connect_to_collection (IDirectMusicBand *iface, IDirectMusicCollection *collection)
 
HRESULT band_send_messages (IDirectMusicBand *iface, IDirectMusicPerformance *performance, IDirectMusicGraph *graph, MUSIC_TIME time, DWORD track_id)
 
HRESULT band_add_instrument (IDirectMusicBand *iface, DMUS_IO_INSTRUMENT *instrument)
 

Function Documentation

◆ band_add_instrument()

HRESULT band_add_instrument ( IDirectMusicBand *  iface,
DMUS_IO_INSTRUMENT *  instrument 
)

Definition at line 531 of file band.c.

532{
533 struct band *This = impl_from_IDirectMusicBand(iface);
534 struct instrument_entry *entry;
535
536 TRACE("%p, %p\n", iface, instrument);
537
538 if (!(entry = calloc(1, sizeof(*entry)))) return E_OUTOFMEMORY;
539 entry->instrument = *instrument;
540 list_add_tail(&This->instruments, &entry->entry);
541
542 return S_OK;
543}
static struct band * impl_from_IDirectMusicBand(IDirectMusicBand *iface)
Definition: band.c:84
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define S_OK
Definition: intsafe.h:52
uint32_t entry
Definition: isohybrid.c:63
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4
Definition: band.c:76
Definition: band.c:43
DMUS_IO_INSTRUMENT instrument
Definition: band.c:45

Referenced by midi_parser_handle_program_change().

◆ band_connect_to_collection()

HRESULT band_connect_to_collection ( IDirectMusicBand *  iface,
IDirectMusicCollection *  collection 
)

Definition at line 477 of file band.c.

478{
479 struct band *This = impl_from_IDirectMusicBand(iface);
480
481 TRACE("%p, %p\n", iface, collection);
482
483 if (This->collection) IDirectMusicCollection_Release(This->collection);
484 if ((This->collection = collection)) IDirectMusicCollection_AddRef(This->collection);
485
486 return S_OK;
487}
#define IDirectMusicCollection_AddRef(p)
Definition: dmusicc.h:577
#define IDirectMusicCollection_Release(p)
Definition: dmusicc.h:578

Referenced by band_track_SetParam().

◆ band_send_messages()

HRESULT band_send_messages ( IDirectMusicBand *  iface,
IDirectMusicPerformance *  performance,
IDirectMusicGraph *  graph,
MUSIC_TIME  time,
DWORD  track_id 
)

Definition at line 489 of file band.c.

491{
492 struct band *This = impl_from_IDirectMusicBand(iface);
493 struct instrument_entry *entry;
494 HRESULT hr = S_OK;
495
497 {
498 DWORD patch = entry->instrument.dwPatch;
500
502 (DMUS_PMSG **)&msg)))
503 break;
504
505 msg->mtTime = time;
506 msg->dwFlags = DMUS_PMSGF_MUSICTIME;
507 msg->dwPChannel = entry->instrument.dwPChannel;
508 msg->dwVirtualTrackID = track_id;
509 msg->dwType = DMUS_PMSGT_PATCH;
510 msg->dwGroupID = 1;
511 msg->byInstrument = entry->instrument.dwPatch;
512
513 msg->byInstrument = patch & 0x7F;
514 patch >>= 8;
515 msg->byLSB = patch & 0x7f;
516 patch >>= 8;
517 msg->byMSB = patch & 0x7f;
518 patch >>= 8;
519
522 {
524 break;
525 }
526 }
527
528 return hr;
529}
#define msg(x)
Definition: auth_time.c:54
HRESULT hr
Definition: delayimp.cpp:582
@ DMUS_PMSGF_MUSICTIME
Definition: dmusici.h:446
#define IDirectMusicPerformance_SendPMsg(p, a)
Definition: dmusici.h:1289
#define IDirectMusicPerformance_FreePMsg(p, a)
Definition: dmusici.h:1295
#define IDirectMusicGraph_StampPMsg(p, a)
Definition: dmusici.h:1474
#define IDirectMusicPerformance_AllocPMsg(p, a, b)
Definition: dmusici.h:1294
@ DMUS_PMSGT_PATCH
Definition: dmusici.h:463
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FAILED(hr)
Definition: intsafe.h:51
__u16 time
Definition: mkdosfs.c:8
#define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field)
Definition: list.h:260
Definition: graph.c:32
DWORD patch
Definition: collection.c:29

Referenced by band_track_Play().

◆ create_dmband()

HRESULT create_dmband ( REFIID  riid,
void **  ret_iface 
)

Definition at line 457 of file band.c.

458{
459 struct band* obj;
460 HRESULT hr;
461
462 *ppobj = NULL;
463 if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
464 obj->IDirectMusicBand_iface.lpVtbl = &band_vtbl;
465 obj->ref = 1;
466 dmobject_init(&obj->dmobj, &CLSID_DirectMusicBand, (IUnknown *)&obj->IDirectMusicBand_iface);
467 obj->dmobj.IDirectMusicObject_iface.lpVtbl = &band_object_vtbl;
468 obj->dmobj.IPersistStream_iface.lpVtbl = &band_persist_stream_vtbl;
469 list_init(&obj->instruments);
470
471 hr = IDirectMusicBand_QueryInterface(&obj->IDirectMusicBand_iface, lpcGUID, ppobj);
472 IDirectMusicBand_Release(&obj->IDirectMusicBand_iface);
473
474 return hr;
475}
static const IDirectMusicObjectVtbl band_object_vtbl
Definition: band.c:374
static const IDirectMusicBandVtbl band_vtbl
Definition: band.c:219
static const IPersistStreamVtbl band_persist_stream_vtbl
Definition: band.c:445
static void list_init(struct list_entry *head)
Definition: list.h:51
#define NULL
Definition: types.h:112
void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk)
Definition: dmobject.c:749
#define IDirectMusicBand_QueryInterface(p, a, b)
Definition: dmusici.h:813
#define IDirectMusicBand_Release(p)
Definition: dmusici.h:815