本文整理汇总了C++中LPDIRECTSOUND3DLISTENER::GetAllParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTSOUND3DLISTENER::GetAllParameters方法的具体用法?C++ LPDIRECTSOUND3DLISTENER::GetAllParameters怎么用?C++ LPDIRECTSOUND3DLISTENER::GetAllParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTSOUND3DLISTENER
的用法示例。
在下文中一共展示了LPDIRECTSOUND3DLISTENER::GetAllParameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ds_GetAllListenerParameters
//-----------------------------------------------------------------------------
// Получение всех параметров слушателя
// на входе : listener - указатель на интерфейс слушателя
// data - указатель на структуру в которую нужно поместить
// параметры слушателя
// на выходе : успешность получения параметров слушателя
//-----------------------------------------------------------------------------
int ds_GetAllListenerParameters(LPDIRECTSOUND3DLISTENER listener,
LPDS3DLISTENER data)
{
// проверка наличия слушателя
if (!listener)
return false;
// пропишем размер структуры
data->dwSize = sizeof(DS3DLISTENER);
// получение параметров слушателя
if (listener->GetAllParameters(data) == DS_OK)
return true;
return false;
}
示例2: OnInitDialog
//-----------------------------------------------------------------------------
// Name: OnInitDialog()
// Desc: Initializes the dialogs (sets up UI controls, etc.)
//-----------------------------------------------------------------------------
VOID OnInitDialog( HWND hDlg )
{
HRESULT hr;
// Load the icon
#ifdef _WIN64
HINSTANCE hInst = (HINSTANCE) GetWindowLongPtr( hDlg, GWLP_HINSTANCE );
#else
HINSTANCE hInst = (HINSTANCE) GetWindowLong( hDlg, GWL_HINSTANCE );
#endif
HICON hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDR_MAINFRAME ) );
// Create a static IDirectSound in the CSound class.
// Set coop level to DSSCL_PRIORITY, and set primary buffer
// format to stereo, 22kHz and 16-bit output.
g_pSoundManager = new CSoundManager();
hr = g_pSoundManager->Initialize( hDlg, DSSCL_PRIORITY, 2, 22050, 16 );
// Get the 3D listener, so we can control its params
hr |= g_pSoundManager->Get3DListenerInterface( &g_pDSListener );
if( FAILED(hr) )
{
DXTRACE_ERR( TEXT("Get3DListenerInterface"), hr );
MessageBox( hDlg, "Error initializing DirectSound. Sample will now exit.",
"DirectSound Sample", MB_OK | MB_ICONERROR );
EndDialog( hDlg, IDABORT );
return;
}
// Get listener parameters
g_dsListenerParams.dwSize = sizeof(DS3DLISTENER);
g_pDSListener->GetAllParameters( &g_dsListenerParams );
// Set the icon for this dialog.
PostMessage( hDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon ); // Set big icon
PostMessage( hDlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon ); // Set small icon
// Create a timer to periodically move the 3D object around
SetTimer( hDlg, IDT_MOVEMENT_TIMER, 0, NULL );
// Set the UI controls
SetDlgItemText( hDlg, IDC_FILENAME, TEXT("") );
SetDlgItemText( hDlg, IDC_STATUS, TEXT("No file loaded.") );
// Get handles to dialog items
HWND hDopplerSlider = GetDlgItem( hDlg, IDC_DOPPLER_SLIDER );
HWND hRolloffSlider = GetDlgItem( hDlg, IDC_ROLLOFF_SLIDER );
HWND hMinDistSlider = GetDlgItem( hDlg, IDC_MINDISTANCE_SLIDER );
HWND hMaxDistSlider = GetDlgItem( hDlg, IDC_MAXDISTANCE_SLIDER );
HWND hVertSlider = GetDlgItem( hDlg, IDC_VERTICAL_SLIDER );
HWND hHorzSlider = GetDlgItem( hDlg, IDC_HORIZONTAL_SLIDER );
// Set the range and position of the sliders
PostMessage( hDopplerSlider, TBM_SETRANGEMAX, TRUE, 40L );
PostMessage( hDopplerSlider, TBM_SETRANGEMIN, TRUE, 0L );
PostMessage( hRolloffSlider, TBM_SETRANGEMAX, TRUE, 40L );
PostMessage( hRolloffSlider, TBM_SETRANGEMIN, TRUE, 0L );
PostMessage( hMinDistSlider, TBM_SETRANGEMAX, TRUE, 40L );
PostMessage( hMinDistSlider, TBM_SETRANGEMIN, TRUE, 1L );
PostMessage( hMaxDistSlider, TBM_SETRANGEMAX, TRUE, 40L );
PostMessage( hMaxDistSlider, TBM_SETRANGEMIN, TRUE, 1L );
PostMessage( hVertSlider, TBM_SETRANGEMAX, TRUE, 100L );
PostMessage( hVertSlider, TBM_SETRANGEMIN, TRUE, -100L );
PostMessage( hVertSlider, TBM_SETPOS, TRUE, 100L );
PostMessage( hHorzSlider, TBM_SETRANGEMAX, TRUE, 100L );
PostMessage( hHorzSlider, TBM_SETRANGEMIN, TRUE, -100L );
PostMessage( hHorzSlider, TBM_SETPOS, TRUE, 100L );
// Set the position of the sliders
SetSlidersPos( hDlg, 0.0f, 0.0f, ORBIT_MAX_RADIUS, ORBIT_MAX_RADIUS*2.0f );
}