Platform SDK: DirectX

IDirectMusicTrack

IDirectMusicTrack インターフェイスは、トラック オブジェクトを表す。セグメントの定義に関係のあるほとんどすべての内容がトラックに保存されている。このトラック メカニズムによって、セグメントは無限に拡張可能であり、セグメントは自ら使用する音楽やオーディオのテクノロジに関して何も把握していなくてもかまわない。

独自の音楽再生メカニズムを DirectMusic に実装することを計画している場合、そのメカニズムを表す DirectMusicTrack オブジェクトを作成する必要がある。DirectMusicTrack オブジェクトを作成しなかった場合、このインターフェイスのメソッドは通常、アプリケーションから直接呼び出されない。

 :  IDirectMusicTrack インターフェイスのメソッドを実装するときは、渡されるオブジェクトへの参照を保持しないこと。たとえば、IDirectMusicTrack::Init がパラメータとして受け取る IDirectMusicSegment インターフェイスへの参照を追加する場合は、この参照が解放されるようにする。

IDirectMusicTrack インターフェイスのメソッドは、以下のグループにまとめることができる。

初期化 Init
再生 EndPlay
  InitPlay
Play
通知 AddNotificationType
  RemoveNotificationType
パラメータ GetParam
  IsParamSupported
SetParam
その他 Clone

すべての COM インターフェイスは、IUnknown インターフェイス メソッドを継承する。IUnknown インターフェイスは、以下の 3 つのメソッドをサポートする。

IUnknown AddRef
  QueryInterface
Release

DirectMusicTrack オブジェクトは、自らのデータをロードするために IDirectMusicObjectIPersistStream の各インターフェイスもサポートしている。

次の表に、標準のトラック タイプによってサポートされるメソッドを示す。標準タイプの一般的な説明については、「トラック」を参照すること。

トラック IDirectMusicTrack
メソッド
IPersistStream
メソッド
バンド (CLSID_DirectMusicBandTrack)
  AddNotificationType いいえ IsDirty はい
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam いいえ Save はい
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType いいえ
コード (CLSID_DirectMusicChordTrack)
  AddNotificationType はい IsDirty はい
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam はい Save はい
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType はい
コード マップ (CLSID_DirectMusicChordMapTrack)
  AddNotificationType いいえ IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい* Load はい
GetParam はい Save いいえ
Init はい*    
InitPlay はい*
IsParamSupported はい
Play はい*
SetParam はい
RemoveNotificationType いいえ
コマンド (CLSID_DirectMusicCommandTrack)
  AddNotificationType はい IsDirty はい
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam はい Save はい
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType はい
モチーフ (CLSID_DirectMusicMotifTrack)
  AddNotificationType はい IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい Load いいえ
GetParam いいえ Save いいえ
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType はい
ミュート (CLSID_DirectMusicMuteTrack)
  AddNotificationType いいえ IsDirty はい
Clone はい GetSizeMax いいえ
EndPlay はい* Load はい
GetParam はい Save はい
Init はい*    
InitPlay はい*
IsParamSupported はい
Play はい*
SetParam はい
RemoveNotificationType いいえ
シーケンス (CLSID_DirectMusicSeqTrack)
  AddNotificationType いいえ IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam いいえ Save いいえ
Init はい    
InitPlay はい
IsParamSupported いいえ
Play はい
SetParam いいえ
RemoveNotificationType いいえ
サイン ポスト (CLSID_DirectMusicSignPostTrack)
  AddNotificationType いいえ IsDirty はい
Clone はい GetSizeMax いいえ
EndPlay はい* Load はい
GetParam いいえ Save はい
Init はい*    
InitPlay はい*
IsParamSupported いいえ
Play はい*
SetParam いいえ
RemoveNotificationType いいえ
スタイル (CLSID_DirectMusicStyleTrack)
  AddNotificationType はい IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam はい Save いいえ
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType はい
SysEx (CLSID_DirectMusicSysExTrack)
  AddNotificationType いいえ IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam いいえ Save いいえ
Init はい    
InitPlay はい
IsParamSupported いいえ
Play はい
SetParam いいえ
RemoveNotificationType いいえ
テンポ (CLSID_DirectMusicTempoTrack)
  AddNotificationType いいえ IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam はい Save いいえ
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType いいえ
拍子記号** (CLSID_DirectMusicTimeSigTrack)
  AddNotificationType はい IsDirty いいえ
Clone はい GetSizeMax いいえ
EndPlay はい Load はい
GetParam はい Save いいえ
Init はい    
InitPlay はい
IsParamSupported はい
Play はい
SetParam はい
RemoveNotificationType はい

 :  

* このメソッドは E_NOTIMPL 以外の値を返すが、その他の処理は行わない。

** 拍子記号トラックは、インポートされた MIDI ファイルおよびそれを使って作成される DirectMusic Producer セグメント内に存在する。ほとんどの場合、スタイル トラックは拍子記号トラックの機能を実装する。そのため、スタイル トラックを含んでいるセグメントが拍子記号トラックも含んでいる必要はない。

動作環境

  Windows NT/2000 : Windows 2000 が必要。
  Windows 95/98 : Windows 95 以降が必要。Windows 95 用に再配布可能な形で使用可能。
  ヘッダー : dmusici.h で宣言。

参照

トラックトラック パラメータの設定と取り出し