ホーム › Media.WindowsMediaFormat › WM_SYNCHRONISED_LYRICS
WM_SYNCHRONISED_LYRICS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| bTimeStampFormat | BYTE | 1 | +0 | +0 | 歌詞タイムスタンプの形式(MPEGフレーム数かミリ秒か)。 |
| bContentType | BYTE | 1 | +1 | +1 | 歌詞コンテンツの種類(歌詞・コード・イベント等)。 |
| pwszContentDescriptor | LPWSTR | 8/4 | +2 | +2 | 歌詞内容を説明する文字列。 |
| dwLyricsLen | DWORD | 4 | +10 | +6 | pbLyricsが指す歌詞データのバイト数。 |
| pbLyrics | BYTE* | 8/4 | +14 | +10 | 同期歌詞データへのポインタ。 |
各言語での定義
#include <windows.h>
// WM_SYNCHRONISED_LYRICS (x64 22 / x86 14 バイト)
#pragma pack(push, 1)
typedef struct WM_SYNCHRONISED_LYRICS {
BYTE bTimeStampFormat;
BYTE bContentType;
LPWSTR pwszContentDescriptor;
DWORD dwLyricsLen;
BYTE* pbLyrics;
} WM_SYNCHRONISED_LYRICS;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct WM_SYNCHRONISED_LYRICS
{
public byte bTimeStampFormat;
public byte bContentType;
public IntPtr pwszContentDescriptor;
public uint dwLyricsLen;
public IntPtr pbLyrics;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure WM_SYNCHRONISED_LYRICS
Public bTimeStampFormat As Byte
Public bContentType As Byte
Public pwszContentDescriptor As IntPtr
Public dwLyricsLen As UInteger
Public pbLyrics As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WM_SYNCHRONISED_LYRICS(ctypes.Structure):
_pack_ = 1
_fields_ = [
("bTimeStampFormat", ctypes.c_ubyte),
("bContentType", ctypes.c_ubyte),
("pwszContentDescriptor", ctypes.c_void_p),
("dwLyricsLen", wintypes.DWORD),
("pbLyrics", ctypes.c_void_p),
]#[repr(C, packed(1))]
pub struct WM_SYNCHRONISED_LYRICS {
pub bTimeStampFormat: u8,
pub bContentType: u8,
pub pwszContentDescriptor: *mut core::ffi::c_void,
pub dwLyricsLen: u32,
pub pbLyrics: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WM_SYNCHRONISED_LYRICS struct {
bTimeStampFormat byte
bContentType byte
pwszContentDescriptor uintptr
dwLyricsLen uint32
pbLyrics uintptr
}type
WM_SYNCHRONISED_LYRICS = packed record
bTimeStampFormat: Byte;
bContentType: Byte;
pwszContentDescriptor: Pointer;
dwLyricsLen: DWORD;
pbLyrics: Pointer;
end;const WM_SYNCHRONISED_LYRICS = extern struct {
bTimeStampFormat: u8,
bContentType: u8,
pwszContentDescriptor: ?*anyopaque,
dwLyricsLen: u32,
pbLyrics: ?*anyopaque,
};type
WM_SYNCHRONISED_LYRICS {.packed.} = object
bTimeStampFormat: uint8
bContentType: uint8
pwszContentDescriptor: pointer
dwLyricsLen: uint32
pbLyrics: pointeralign(1)
struct WM_SYNCHRONISED_LYRICS
{
ubyte bTimeStampFormat;
ubyte bContentType;
void* pwszContentDescriptor;
uint dwLyricsLen;
void* pbLyrics;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WM_SYNCHRONISED_LYRICS サイズ: 14 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 14 / 4 切り上げ)
; bTimeStampFormat : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; bContentType : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; pwszContentDescriptor : LPWSTR (+2, 4byte) lpoke st,2,値 / 値 = lpeek(st,2)
; dwLyricsLen : DWORD (+6, 4byte) lpoke st,6,値 / 値 = lpeek(st,6)
; pbLyrics : BYTE* (+10, 4byte) lpoke st,10,値 / 値 = lpeek(st,10)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WM_SYNCHRONISED_LYRICS サイズ: 22 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 22 / 4 切り上げ)
; bTimeStampFormat : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; bContentType : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; pwszContentDescriptor : LPWSTR (+2, 8byte) qpoke st,2,値 / qpeek(st,2) ※IronHSPのみ。3.7/3.8は lpoke st,2,下位 : lpoke st,6,上位
; dwLyricsLen : DWORD (+10, 4byte) lpoke st,10,値 / 値 = lpeek(st,10)
; pbLyrics : BYTE* (+14, 8byte) qpoke st,14,値 / qpeek(st,14) ※IronHSPのみ。3.7/3.8は lpoke st,14,下位 : lpoke st,18,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WM_SYNCHRONISED_LYRICS, pack=1
#field byte bTimeStampFormat
#field byte bContentType
#field intptr pwszContentDescriptor
#field int dwLyricsLen
#field intptr pbLyrics
#endstruct
stdim st, WM_SYNCHRONISED_LYRICS ; NSTRUCT 変数を確保
st->bTimeStampFormat = 100
mes "bTimeStampFormat=" + st->bTimeStampFormat