text:
/*** Autogenerated by WIDL from audioclient.idl - Do not edit ***/

#include <rpc.h>
#include <rpcndr.h>

#if !defined(COM_NO_WINDOWS_H) && !defined(__WINESRC__)
#include <windows.h>
#include <ole2.h>
#endif

#ifndef __WIDL_AUDIOCLIENT_H
#define __WIDL_AUDIOCLIENT_H

/* Forward declarations */

#ifndef __IAudioClient_FWD_DEFINED__
#define __IAudioClient_FWD_DEFINED__
typedef interface IAudioClient IAudioClient;
#endif

#ifndef __IAudioRenderClient_FWD_DEFINED__
#define __IAudioRenderClient_FWD_DEFINED__
typedef interface IAudioRenderClient IAudioRenderClient;
#endif

#ifndef __IAudioCaptureClient_FWD_DEFINED__
#define __IAudioCaptureClient_FWD_DEFINED__
typedef interface IAudioCaptureClient IAudioCaptureClient;
#endif

#ifndef __IAudioClock_FWD_DEFINED__
#define __IAudioClock_FWD_DEFINED__
typedef interface IAudioClock IAudioClock;
#endif

#ifndef __IAudioClock2_FWD_DEFINED__
#define __IAudioClock2_FWD_DEFINED__
typedef interface IAudioClock2 IAudioClock2;
#endif

#ifndef __IAudioClockAdjustment_FWD_DEFINED__
#define __IAudioClockAdjustment_FWD_DEFINED__
typedef interface IAudioClockAdjustment IAudioClockAdjustment;
#endif

#ifndef __ISimpleAudioVolume_FWD_DEFINED__
#define __ISimpleAudioVolume_FWD_DEFINED__
typedef interface ISimpleAudioVolume ISimpleAudioVolume;
#endif

#ifndef __IAudioStreamVolume_FWD_DEFINED__
#define __IAudioStreamVolume_FWD_DEFINED__
typedef interface IAudioStreamVolume IAudioStreamVolume;
#endif

#ifndef __IChannelAudioVolume_FWD_DEFINED__
#define __IChannelAudioVolume_FWD_DEFINED__
typedef interface IChannelAudioVolume IChannelAudioVolume;
#endif

/* Headers for imported files */

#include <wtypes.h>
#include <unknwn.h>
#include <audiosessiontypes.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __audioclient_h__
#define __audioclient_h__
#ifndef __IAudioClient_FWD_DEFINED__
#define __IAudioClient_FWD_DEFINED__
typedef interface IAudioClient IAudioClient;
#endif

#ifndef __IAudioRenderClient_FWD_DEFINED__
#define __IAudioRenderClient_FWD_DEFINED__
typedef interface IAudioRenderClient IAudioRenderClient;
#endif

#ifndef __IAudioCaptureClient_FWD_DEFINED__
#define __IAudioCaptureClient_FWD_DEFINED__
typedef interface IAudioCaptureClient IAudioCaptureClient;
#endif

#ifndef __IAudioClock_FWD_DEFINED__
#define __IAudioClock_FWD_DEFINED__
typedef interface IAudioClock IAudioClock;
#endif

#ifndef __IAudioClock2_FWD_DEFINED__
#define __IAudioClock2_FWD_DEFINED__
typedef interface IAudioClock2 IAudioClock2;
#endif

#ifndef __IAudioClockAdjustment_FWD_DEFINED__
#define __IAudioClockAdjustment_FWD_DEFINED__
typedef interface IAudioClockAdjustment IAudioClockAdjustment;
#endif

#ifndef __ISimpleAudioVolume_FWD_DEFINED__
#define __ISimpleAudioVolume_FWD_DEFINED__
typedef interface ISimpleAudioVolume ISimpleAudioVolume;
#endif

#ifndef __IAudioStreamVolume_FWD_DEFINED__
#define __IAudioStreamVolume_FWD_DEFINED__
typedef interface IAudioStreamVolume IAudioStreamVolume;
#endif

#ifndef __IChannelAudioVolume_FWD_DEFINED__
#define __IChannelAudioVolume_FWD_DEFINED__
typedef interface IChannelAudioVolume IChannelAudioVolume;
#endif

#if 0
typedef struct WAVEFORMATEX {
    WORD wFormatTag;
    WORD nChannels;
    DWORD nSamplesPerSec;
    DWORD nAvgBytesPerSec;
    WORD nBlockAlign;
    WORD wBitsPerSample;
    WORD cbSize;
} WAVEFORMATEX;
#else
#include <mmreg.h>
#endif
#if 0
typedef LONGLONG REFERENCE_TIME;
#else
#define _IKsControl_
#include <ks.h>
#include <ksmedia.h>
#endif
enum _AUDCLNT_BUFFERFLAGS {
    AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY = 0x1,
    AUDCLNT_BUFFERFLAGS_SILENT = 0x2,
    AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR = 0x4
};

/*****************************************************************************
 * IAudioClient interface
 */
#ifndef __IAudioClient_INTERFACE_DEFINED__
#define __IAudioClient_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioClient, 0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1,0x78, 0xc2,0xf5,0x68,0xa7,0x03,0xb2);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1cb9ad4c-dbfa-4c32-b178-c2f568a703b2")
IAudioClient : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE Initialize(
        AUDCLNT_SHAREMODE ShareMode,
        DWORD StreamFlags,
        REFERENCE_TIME hnsBufferDuration,
        REFERENCE_TIME hnsPeriodicity,
        const WAVEFORMATEX *pFormat,
        LPCGUID AudioSessionGuid) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetBufferSize(
        UINT32 *pNumBufferFrames) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStreamLatency(
        REFERENCE_TIME *phnsLatency) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetCurrentPadding(
        UINT32 *pNumPaddingFrames) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsFormatSupported(
        AUDCLNT_SHAREMODE ShareMode,
        const WAVEFORMATEX *pFormat,
        WAVEFORMATEX **ppClosestMatch) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetMixFormat(
        WAVEFORMATEX **ppDeviceFormat) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDevicePeriod(
        REFERENCE_TIME *phnsDefaultDevicePeriod,
        REFERENCE_TIME *phnsMinimumDevicePeriod) = 0;

    virtual HRESULT STDMETHODCALLTYPE Start(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Stop(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Reset(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetEventHandle(
        HANDLE eventHandle) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetService(
        REFIID riid,
        void **ppv) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioClient, 0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1,0x78, 0xc2,0xf5,0x68,0xa7,0x03,0xb2)
#endif
#else
typedef struct IAudioClientVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioClient* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioClient* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioClient* This);

    /*** IAudioClient methods ***/
    HRESULT (STDMETHODCALLTYPE *Initialize)(
        IAudioClient* This,
        AUDCLNT_SHAREMODE ShareMode,
        DWORD StreamFlags,
        REFERENCE_TIME hnsBufferDuration,
        REFERENCE_TIME hnsPeriodicity,
        const WAVEFORMATEX *pFormat,
        LPCGUID AudioSessionGuid);

    HRESULT (STDMETHODCALLTYPE *GetBufferSize)(
        IAudioClient* This,
        UINT32 *pNumBufferFrames);

    HRESULT (STDMETHODCALLTYPE *GetStreamLatency)(
        IAudioClient* This,
        REFERENCE_TIME *phnsLatency);

    HRESULT (STDMETHODCALLTYPE *GetCurrentPadding)(
        IAudioClient* This,
        UINT32 *pNumPaddingFrames);

    HRESULT (STDMETHODCALLTYPE *IsFormatSupported)(
        IAudioClient* This,
        AUDCLNT_SHAREMODE ShareMode,
        const WAVEFORMATEX *pFormat,
        WAVEFORMATEX **ppClosestMatch);

    HRESULT (STDMETHODCALLTYPE *GetMixFormat)(
        IAudioClient* This,
        WAVEFORMATEX **ppDeviceFormat);

    HRESULT (STDMETHODCALLTYPE *GetDevicePeriod)(
        IAudioClient* This,
        REFERENCE_TIME *phnsDefaultDevicePeriod,
        REFERENCE_TIME *phnsMinimumDevicePeriod);

    HRESULT (STDMETHODCALLTYPE *Start)(
        IAudioClient* This);

    HRESULT (STDMETHODCALLTYPE *Stop)(
        IAudioClient* This);

    HRESULT (STDMETHODCALLTYPE *Reset)(
        IAudioClient* This);

    HRESULT (STDMETHODCALLTYPE *SetEventHandle)(
        IAudioClient* This,
        HANDLE eventHandle);

    HRESULT (STDMETHODCALLTYPE *GetService)(
        IAudioClient* This,
        REFIID riid,
        void **ppv);

    END_INTERFACE
} IAudioClientVtbl;
interface IAudioClient {
    CONST_VTBL IAudioClientVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioClient_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioClient_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioClient_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioClient methods ***/
#define IAudioClient_Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) (This)->lpVtbl->Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid)
#define IAudioClient_GetBufferSize(This,pNumBufferFrames) (This)->lpVtbl->GetBufferSize(This,pNumBufferFrames)
#define IAudioClient_GetStreamLatency(This,phnsLatency) (This)->lpVtbl->GetStreamLatency(This,phnsLatency)
#define IAudioClient_GetCurrentPadding(This,pNumPaddingFrames) (This)->lpVtbl->GetCurrentPadding(This,pNumPaddingFrames)
#define IAudioClient_IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) (This)->lpVtbl->IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch)
#define IAudioClient_GetMixFormat(This,ppDeviceFormat) (This)->lpVtbl->GetMixFormat(This,ppDeviceFormat)
#define IAudioClient_GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) (This)->lpVtbl->GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod)
#define IAudioClient_Start(This) (This)->lpVtbl->Start(This)
#define IAudioClient_Stop(This) (This)->lpVtbl->Stop(This)
#define IAudioClient_Reset(This) (This)->lpVtbl->Reset(This)
#define IAudioClient_SetEventHandle(This,eventHandle) (This)->lpVtbl->SetEventHandle(This,eventHandle)
#define IAudioClient_GetService(This,riid,ppv) (This)->lpVtbl->GetService(This,riid,ppv)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioClient_Initialize_Proxy(
    IAudioClient* This,
    AUDCLNT_SHAREMODE ShareMode,
    DWORD StreamFlags,
    REFERENCE_TIME hnsBufferDuration,
    REFERENCE_TIME hnsPeriodicity,
    const WAVEFORMATEX *pFormat,
    LPCGUID AudioSessionGuid);
void __RPC_STUB IAudioClient_Initialize_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_GetBufferSize_Proxy(
    IAudioClient* This,
    UINT32 *pNumBufferFrames);
void __RPC_STUB IAudioClient_GetBufferSize_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_GetStreamLatency_Proxy(
    IAudioClient* This,
    REFERENCE_TIME *phnsLatency);
void __RPC_STUB IAudioClient_GetStreamLatency_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_GetCurrentPadding_Proxy(
    IAudioClient* This,
    UINT32 *pNumPaddingFrames);
void __RPC_STUB IAudioClient_GetCurrentPadding_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_IsFormatSupported_Proxy(
    IAudioClient* This,
    AUDCLNT_SHAREMODE ShareMode,
    const WAVEFORMATEX *pFormat,
    WAVEFORMATEX **ppClosestMatch);
void __RPC_STUB IAudioClient_IsFormatSupported_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_GetMixFormat_Proxy(
    IAudioClient* This,
    WAVEFORMATEX **ppDeviceFormat);
void __RPC_STUB IAudioClient_GetMixFormat_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_GetDevicePeriod_Proxy(
    IAudioClient* This,
    REFERENCE_TIME *phnsDefaultDevicePeriod,
    REFERENCE_TIME *phnsMinimumDevicePeriod);
void __RPC_STUB IAudioClient_GetDevicePeriod_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_Start_Proxy(
    IAudioClient* This);
void __RPC_STUB IAudioClient_Start_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_Stop_Proxy(
    IAudioClient* This);
void __RPC_STUB IAudioClient_Stop_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_Reset_Proxy(
    IAudioClient* This);
void __RPC_STUB IAudioClient_Reset_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_SetEventHandle_Proxy(
    IAudioClient* This,
    HANDLE eventHandle);
void __RPC_STUB IAudioClient_SetEventHandle_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClient_GetService_Proxy(
    IAudioClient* This,
    REFIID riid,
    void **ppv);
void __RPC_STUB IAudioClient_GetService_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioClient_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IAudioRenderClient interface
 */
#ifndef __IAudioRenderClient_INTERFACE_DEFINED__
#define __IAudioRenderClient_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioRenderClient, 0xf294acfc, 0x3146, 0x4483, 0xa7,0xbf, 0xad,0xdc,0xa7,0xc2,0x60,0xe2);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("f294acfc-3146-4483-a7bf-addca7c260e2")
IAudioRenderClient : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetBuffer(
        UINT32 NumFramesRequested,
        BYTE **ppData) = 0;

    virtual HRESULT STDMETHODCALLTYPE ReleaseBuffer(
        UINT32 NumFramesWritten,
        DWORD dwFlags) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioRenderClient, 0xf294acfc, 0x3146, 0x4483, 0xa7,0xbf, 0xad,0xdc,0xa7,0xc2,0x60,0xe2)
#endif
#else
typedef struct IAudioRenderClientVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioRenderClient* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioRenderClient* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioRenderClient* This);

    /*** IAudioRenderClient methods ***/
    HRESULT (STDMETHODCALLTYPE *GetBuffer)(
        IAudioRenderClient* This,
        UINT32 NumFramesRequested,
        BYTE **ppData);

    HRESULT (STDMETHODCALLTYPE *ReleaseBuffer)(
        IAudioRenderClient* This,
        UINT32 NumFramesWritten,
        DWORD dwFlags);

    END_INTERFACE
} IAudioRenderClientVtbl;
interface IAudioRenderClient {
    CONST_VTBL IAudioRenderClientVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioRenderClient_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioRenderClient_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioRenderClient_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioRenderClient methods ***/
#define IAudioRenderClient_GetBuffer(This,NumFramesRequested,ppData) (This)->lpVtbl->GetBuffer(This,NumFramesRequested,ppData)
#define IAudioRenderClient_ReleaseBuffer(This,NumFramesWritten,dwFlags) (This)->lpVtbl->ReleaseBuffer(This,NumFramesWritten,dwFlags)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioRenderClient_GetBuffer_Proxy(
    IAudioRenderClient* This,
    UINT32 NumFramesRequested,
    BYTE **ppData);
void __RPC_STUB IAudioRenderClient_GetBuffer_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioRenderClient_ReleaseBuffer_Proxy(
    IAudioRenderClient* This,
    UINT32 NumFramesWritten,
    DWORD dwFlags);
void __RPC_STUB IAudioRenderClient_ReleaseBuffer_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioRenderClient_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IAudioCaptureClient interface
 */
#ifndef __IAudioCaptureClient_INTERFACE_DEFINED__
#define __IAudioCaptureClient_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioCaptureClient, 0xc8adbd64, 0xe71e, 0x48a0, 0xa4,0xde, 0x18,0x5c,0x39,0x5c,0xd3,0x17);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c8adbd64-e71e-48a0-a4de-185c395cd317")
IAudioCaptureClient : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetBuffer(
        BYTE **ppData,
        UINT32 *pNumFramesToRead,
        DWORD *pdwFlags,
        UINT64 *pu64DevicePosition,
        UINT64 *pu64QPCPosition) = 0;

    virtual HRESULT STDMETHODCALLTYPE ReleaseBuffer(
        UINT32 NumFramesRead) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetNextPacketSize(
        UINT32 *pNumFramesInNextPacket) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioCaptureClient, 0xc8adbd64, 0xe71e, 0x48a0, 0xa4,0xde, 0x18,0x5c,0x39,0x5c,0xd3,0x17)
#endif
#else
typedef struct IAudioCaptureClientVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioCaptureClient* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioCaptureClient* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioCaptureClient* This);

    /*** IAudioCaptureClient methods ***/
    HRESULT (STDMETHODCALLTYPE *GetBuffer)(
        IAudioCaptureClient* This,
        BYTE **ppData,
        UINT32 *pNumFramesToRead,
        DWORD *pdwFlags,
        UINT64 *pu64DevicePosition,
        UINT64 *pu64QPCPosition);

    HRESULT (STDMETHODCALLTYPE *ReleaseBuffer)(
        IAudioCaptureClient* This,
        UINT32 NumFramesRead);

    HRESULT (STDMETHODCALLTYPE *GetNextPacketSize)(
        IAudioCaptureClient* This,
        UINT32 *pNumFramesInNextPacket);

    END_INTERFACE
} IAudioCaptureClientVtbl;
interface IAudioCaptureClient {
    CONST_VTBL IAudioCaptureClientVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioCaptureClient_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioCaptureClient_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioCaptureClient_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioCaptureClient methods ***/
#define IAudioCaptureClient_GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) (This)->lpVtbl->GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition)
#define IAudioCaptureClient_ReleaseBuffer(This,NumFramesRead) (This)->lpVtbl->ReleaseBuffer(This,NumFramesRead)
#define IAudioCaptureClient_GetNextPacketSize(This,pNumFramesInNextPacket) (This)->lpVtbl->GetNextPacketSize(This,pNumFramesInNextPacket)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioCaptureClient_GetBuffer_Proxy(
    IAudioCaptureClient* This,
    BYTE **ppData,
    UINT32 *pNumFramesToRead,
    DWORD *pdwFlags,
    UINT64 *pu64DevicePosition,
    UINT64 *pu64QPCPosition);
void __RPC_STUB IAudioCaptureClient_GetBuffer_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioCaptureClient_ReleaseBuffer_Proxy(
    IAudioCaptureClient* This,
    UINT32 NumFramesRead);
void __RPC_STUB IAudioCaptureClient_ReleaseBuffer_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioCaptureClient_GetNextPacketSize_Proxy(
    IAudioCaptureClient* This,
    UINT32 *pNumFramesInNextPacket);
void __RPC_STUB IAudioCaptureClient_GetNextPacketSize_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioCaptureClient_INTERFACE_DEFINED__ */

#define AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ 0x00000001
/*****************************************************************************
 * IAudioClock interface
 */
#ifndef __IAudioClock_INTERFACE_DEFINED__
#define __IAudioClock_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioClock, 0xcd63314f, 0x3fba, 0x4a1b, 0x81,0x2c, 0xef,0x96,0x35,0x87,0x28,0xe7);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("cd63314f-3fba-4a1b-812c-ef96358728e7")
IAudioClock : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetFrequency(
        UINT64 *pu64Frequency) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPosition(
        UINT64 *pu64Position,
        UINT64 *pu64QPCPosition) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetCharacteristics(
        DWORD *pdwCharacteristics) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioClock, 0xcd63314f, 0x3fba, 0x4a1b, 0x81,0x2c, 0xef,0x96,0x35,0x87,0x28,0xe7)
#endif
#else
typedef struct IAudioClockVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioClock* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioClock* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioClock* This);

    /*** IAudioClock methods ***/
    HRESULT (STDMETHODCALLTYPE *GetFrequency)(
        IAudioClock* This,
        UINT64 *pu64Frequency);

    HRESULT (STDMETHODCALLTYPE *GetPosition)(
        IAudioClock* This,
        UINT64 *pu64Position,
        UINT64 *pu64QPCPosition);

    HRESULT (STDMETHODCALLTYPE *GetCharacteristics)(
        IAudioClock* This,
        DWORD *pdwCharacteristics);

    END_INTERFACE
} IAudioClockVtbl;
interface IAudioClock {
    CONST_VTBL IAudioClockVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioClock_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioClock_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioClock_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioClock methods ***/
#define IAudioClock_GetFrequency(This,pu64Frequency) (This)->lpVtbl->GetFrequency(This,pu64Frequency)
#define IAudioClock_GetPosition(This,pu64Position,pu64QPCPosition) (This)->lpVtbl->GetPosition(This,pu64Position,pu64QPCPosition)
#define IAudioClock_GetCharacteristics(This,pdwCharacteristics) (This)->lpVtbl->GetCharacteristics(This,pdwCharacteristics)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioClock_GetFrequency_Proxy(
    IAudioClock* This,
    UINT64 *pu64Frequency);
void __RPC_STUB IAudioClock_GetFrequency_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClock_GetPosition_Proxy(
    IAudioClock* This,
    UINT64 *pu64Position,
    UINT64 *pu64QPCPosition);
void __RPC_STUB IAudioClock_GetPosition_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioClock_GetCharacteristics_Proxy(
    IAudioClock* This,
    DWORD *pdwCharacteristics);
void __RPC_STUB IAudioClock_GetCharacteristics_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioClock_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IAudioClock2 interface
 */
#ifndef __IAudioClock2_INTERFACE_DEFINED__
#define __IAudioClock2_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioClock2, 0x6f49ff73, 0x6727, 0x49ac, 0xa0,0x08, 0xd9,0x8c,0xf5,0xe7,0x00,0x48);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6f49ff73-6727-49ac-a008-d98cf5e70048")
IAudioClock2 : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetPosition(
        UINT64 *DevicePosition,
        UINT64 *QPCPosition) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioClock2, 0x6f49ff73, 0x6727, 0x49ac, 0xa0,0x08, 0xd9,0x8c,0xf5,0xe7,0x00,0x48)
#endif
#else
typedef struct IAudioClock2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioClock2* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioClock2* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioClock2* This);

    /*** IAudioClock2 methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPosition)(
        IAudioClock2* This,
        UINT64 *DevicePosition,
        UINT64 *QPCPosition);

    END_INTERFACE
} IAudioClock2Vtbl;
interface IAudioClock2 {
    CONST_VTBL IAudioClock2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioClock2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioClock2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioClock2_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioClock2 methods ***/
#define IAudioClock2_GetPosition(This,DevicePosition,QPCPosition) (This)->lpVtbl->GetPosition(This,DevicePosition,QPCPosition)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioClock2_GetPosition_Proxy(
    IAudioClock2* This,
    UINT64 *DevicePosition,
    UINT64 *QPCPosition);
void __RPC_STUB IAudioClock2_GetPosition_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioClock2_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IAudioClockAdjustment interface
 */
#ifndef __IAudioClockAdjustment_INTERFACE_DEFINED__
#define __IAudioClockAdjustment_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioClockAdjustment, 0xf6e4c0a0, 0x46d9, 0x4fb9, 0xbe,0x21, 0x57,0xa3,0xef,0x2b,0x62,0x6c);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("f6e4c0a0-46d9-4fb9-be21-57a3ef2b626c")
IAudioClockAdjustment : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetSampleRate(
        float flSampleRate) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioClockAdjustment, 0xf6e4c0a0, 0x46d9, 0x4fb9, 0xbe,0x21, 0x57,0xa3,0xef,0x2b,0x62,0x6c)
#endif
#else
typedef struct IAudioClockAdjustmentVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioClockAdjustment* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioClockAdjustment* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioClockAdjustment* This);

    /*** IAudioClockAdjustment methods ***/
    HRESULT (STDMETHODCALLTYPE *SetSampleRate)(
        IAudioClockAdjustment* This,
        float flSampleRate);

    END_INTERFACE
} IAudioClockAdjustmentVtbl;
interface IAudioClockAdjustment {
    CONST_VTBL IAudioClockAdjustmentVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioClockAdjustment_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioClockAdjustment_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioClockAdjustment_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioClockAdjustment methods ***/
#define IAudioClockAdjustment_SetSampleRate(This,flSampleRate) (This)->lpVtbl->SetSampleRate(This,flSampleRate)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioClockAdjustment_SetSampleRate_Proxy(
    IAudioClockAdjustment* This,
    float flSampleRate);
void __RPC_STUB IAudioClockAdjustment_SetSampleRate_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioClockAdjustment_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISimpleAudioVolume interface
 */
#ifndef __ISimpleAudioVolume_INTERFACE_DEFINED__
#define __ISimpleAudioVolume_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISimpleAudioVolume, 0x87ce5498, 0x68d6, 0x44e5, 0x92,0x15, 0x6d,0xa4,0x7e,0xf8,0x83,0xd8);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("87ce5498-68d6-44e5-9215-6da47ef883d8")
ISimpleAudioVolume : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetMasterVolume(
        float fLevel,
        LPCGUID EventContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetMasterVolume(
        float *pfLevel) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetMute(
        const WINBOOL bMute,
        LPCGUID EventContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetMute(
        WINBOOL *pbMute) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISimpleAudioVolume, 0x87ce5498, 0x68d6, 0x44e5, 0x92,0x15, 0x6d,0xa4,0x7e,0xf8,0x83,0xd8)
#endif
#else
typedef struct ISimpleAudioVolumeVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISimpleAudioVolume* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISimpleAudioVolume* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISimpleAudioVolume* This);

    /*** ISimpleAudioVolume methods ***/
    HRESULT (STDMETHODCALLTYPE *SetMasterVolume)(
        ISimpleAudioVolume* This,
        float fLevel,
        LPCGUID EventContext);

    HRESULT (STDMETHODCALLTYPE *GetMasterVolume)(
        ISimpleAudioVolume* This,
        float *pfLevel);

    HRESULT (STDMETHODCALLTYPE *SetMute)(
        ISimpleAudioVolume* This,
        const WINBOOL bMute,
        LPCGUID EventContext);

    HRESULT (STDMETHODCALLTYPE *GetMute)(
        ISimpleAudioVolume* This,
        WINBOOL *pbMute);

    END_INTERFACE
} ISimpleAudioVolumeVtbl;
interface ISimpleAudioVolume {
    CONST_VTBL ISimpleAudioVolumeVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define ISimpleAudioVolume_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISimpleAudioVolume_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISimpleAudioVolume_Release(This) (This)->lpVtbl->Release(This)
/*** ISimpleAudioVolume methods ***/
#define ISimpleAudioVolume_SetMasterVolume(This,fLevel,EventContext) (This)->lpVtbl->SetMasterVolume(This,fLevel,EventContext)
#define ISimpleAudioVolume_GetMasterVolume(This,pfLevel) (This)->lpVtbl->GetMasterVolume(This,pfLevel)
#define ISimpleAudioVolume_SetMute(This,bMute,EventContext) (This)->lpVtbl->SetMute(This,bMute,EventContext)
#define ISimpleAudioVolume_GetMute(This,pbMute) (This)->lpVtbl->GetMute(This,pbMute)
#endif

#endif

HRESULT STDMETHODCALLTYPE ISimpleAudioVolume_SetMasterVolume_Proxy(
    ISimpleAudioVolume* This,
    float fLevel,
    LPCGUID EventContext);
void __RPC_STUB ISimpleAudioVolume_SetMasterVolume_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE ISimpleAudioVolume_GetMasterVolume_Proxy(
    ISimpleAudioVolume* This,
    float *pfLevel);
void __RPC_STUB ISimpleAudioVolume_GetMasterVolume_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE ISimpleAudioVolume_SetMute_Proxy(
    ISimpleAudioVolume* This,
    const WINBOOL bMute,
    LPCGUID EventContext);
void __RPC_STUB ISimpleAudioVolume_SetMute_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE ISimpleAudioVolume_GetMute_Proxy(
    ISimpleAudioVolume* This,
    WINBOOL *pbMute);
void __RPC_STUB ISimpleAudioVolume_GetMute_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __ISimpleAudioVolume_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IAudioStreamVolume interface
 */
#ifndef __IAudioStreamVolume_INTERFACE_DEFINED__
#define __IAudioStreamVolume_INTERFACE_DEFINED__

DEFINE_GUID(IID_IAudioStreamVolume, 0x93014887, 0x242d, 0x4068, 0x8a,0x15, 0xcf,0x5e,0x93,0xb9,0x0f,0xe3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("93014887-242d-4068-8a15-cf5e93b90fe3")
IAudioStreamVolume : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetChannelCount(
        UINT32 *pdwCount) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetChannelVolume(
        UINT32 dwIndex,
        const float fLevel) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetChannelVolume(
        UINT32 dwIndex,
        float *pfLevel) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAllVolumes(
        UINT32 dwCount,
        const float *pfVolumes) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAllVolumes(
        UINT32 dwCount,
        float *pfVolumes) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IAudioStreamVolume, 0x93014887, 0x242d, 0x4068, 0x8a,0x15, 0xcf,0x5e,0x93,0xb9,0x0f,0xe3)
#endif
#else
typedef struct IAudioStreamVolumeVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IAudioStreamVolume* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IAudioStreamVolume* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IAudioStreamVolume* This);

    /*** IAudioStreamVolume methods ***/
    HRESULT (STDMETHODCALLTYPE *GetChannelCount)(
        IAudioStreamVolume* This,
        UINT32 *pdwCount);

    HRESULT (STDMETHODCALLTYPE *SetChannelVolume)(
        IAudioStreamVolume* This,
        UINT32 dwIndex,
        const float fLevel);

    HRESULT (STDMETHODCALLTYPE *GetChannelVolume)(
        IAudioStreamVolume* This,
        UINT32 dwIndex,
        float *pfLevel);

    HRESULT (STDMETHODCALLTYPE *SetAllVolumes)(
        IAudioStreamVolume* This,
        UINT32 dwCount,
        const float *pfVolumes);

    HRESULT (STDMETHODCALLTYPE *GetAllVolumes)(
        IAudioStreamVolume* This,
        UINT32 dwCount,
        float *pfVolumes);

    END_INTERFACE
} IAudioStreamVolumeVtbl;
interface IAudioStreamVolume {
    CONST_VTBL IAudioStreamVolumeVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IAudioStreamVolume_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IAudioStreamVolume_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IAudioStreamVolume_Release(This) (This)->lpVtbl->Release(This)
/*** IAudioStreamVolume methods ***/
#define IAudioStreamVolume_GetChannelCount(This,pdwCount) (This)->lpVtbl->GetChannelCount(This,pdwCount)
#define IAudioStreamVolume_SetChannelVolume(This,dwIndex,fLevel) (This)->lpVtbl->SetChannelVolume(This,dwIndex,fLevel)
#define IAudioStreamVolume_GetChannelVolume(This,dwIndex,pfLevel) (This)->lpVtbl->GetChannelVolume(This,dwIndex,pfLevel)
#define IAudioStreamVolume_SetAllVolumes(This,dwCount,pfVolumes) (This)->lpVtbl->SetAllVolumes(This,dwCount,pfVolumes)
#define IAudioStreamVolume_GetAllVolumes(This,dwCount,pfVolumes) (This)->lpVtbl->GetAllVolumes(This,dwCount,pfVolumes)
#endif

#endif

HRESULT STDMETHODCALLTYPE IAudioStreamVolume_GetChannelCount_Proxy(
    IAudioStreamVolume* This,
    UINT32 *pdwCount);
void __RPC_STUB IAudioStreamVolume_GetChannelCount_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioStreamVolume_SetChannelVolume_Proxy(
    IAudioStreamVolume* This,
    UINT32 dwIndex,
    const float fLevel);
void __RPC_STUB IAudioStreamVolume_SetChannelVolume_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioStreamVolume_GetChannelVolume_Proxy(
    IAudioStreamVolume* This,
    UINT32 dwIndex,
    float *pfLevel);
void __RPC_STUB IAudioStreamVolume_GetChannelVolume_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioStreamVolume_SetAllVolumes_Proxy(
    IAudioStreamVolume* This,
    UINT32 dwCount,
    const float *pfVolumes);
void __RPC_STUB IAudioStreamVolume_SetAllVolumes_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAudioStreamVolume_GetAllVolumes_Proxy(
    IAudioStreamVolume* This,
    UINT32 dwCount,
    float *pfVolumes);
void __RPC_STUB IAudioStreamVolume_GetAllVolumes_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IAudioStreamVolume_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IChannelAudioVolume interface
 */
#ifndef __IChannelAudioVolume_INTERFACE_DEFINED__
#define __IChannelAudioVolume_INTERFACE_DEFINED__

DEFINE_GUID(IID_IChannelAudioVolume, 0x1c158861, 0xb533, 0x4b30, 0xb1,0xcf, 0xe8,0x53,0xe5,0x1c,0x59,0xb8);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1c158861-b533-4b30-b1cf-e853e51c59b8")
IChannelAudioVolume : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetChannelCount(
        UINT32 *pdwCount) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetChannelVolume(
        UINT32 dwIndex,
        const float fLevel,
        LPCGUID EventContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetChannelVolume(
        UINT32 dwIndex,
        float *pfLevel) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAllVolumes(
        UINT32 dwCount,
        const float *pfVolumes,
        LPCGUID EventContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAllVolumes(
        UINT32 dwCount,
        float *pfVolumes) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IChannelAudioVolume, 0x1c158861, 0xb533, 0x4b30, 0xb1,0xcf, 0xe8,0x53,0xe5,0x1c,0x59,0xb8)
#endif
#else
typedef struct IChannelAudioVolumeVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IChannelAudioVolume* This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IChannelAudioVolume* This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IChannelAudioVolume* This);

    /*** IChannelAudioVolume methods ***/
    HRESULT (STDMETHODCALLTYPE *GetChannelCount)(
        IChannelAudioVolume* This,
        UINT32 *pdwCount);

    HRESULT (STDMETHODCALLTYPE *SetChannelVolume)(
        IChannelAudioVolume* This,
        UINT32 dwIndex,
        const float fLevel,
        LPCGUID EventContext);

    HRESULT (STDMETHODCALLTYPE *GetChannelVolume)(
        IChannelAudioVolume* This,
        UINT32 dwIndex,
        float *pfLevel);

    HRESULT (STDMETHODCALLTYPE *SetAllVolumes)(
        IChannelAudioVolume* This,
        UINT32 dwCount,
        const float *pfVolumes,
        LPCGUID EventContext);

    HRESULT (STDMETHODCALLTYPE *GetAllVolumes)(
        IChannelAudioVolume* This,
        UINT32 dwCount,
        float *pfVolumes);

    END_INTERFACE
} IChannelAudioVolumeVtbl;
interface IChannelAudioVolume {
    CONST_VTBL IChannelAudioVolumeVtbl* lpVtbl;
};

#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IChannelAudioVolume_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IChannelAudioVolume_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IChannelAudioVolume_Release(This) (This)->lpVtbl->Release(This)
/*** IChannelAudioVolume methods ***/
#define IChannelAudioVolume_GetChannelCount(This,pdwCount) (This)->lpVtbl->GetChannelCount(This,pdwCount)
#define IChannelAudioVolume_SetChannelVolume(This,dwIndex,fLevel,EventContext) (This)->lpVtbl->SetChannelVolume(This,dwIndex,fLevel,EventContext)
#define IChannelAudioVolume_GetChannelVolume(This,dwIndex,pfLevel) (This)->lpVtbl->GetChannelVolume(This,dwIndex,pfLevel)
#define IChannelAudioVolume_SetAllVolumes(This,dwCount,pfVolumes,EventContext) (This)->lpVtbl->SetAllVolumes(This,dwCount,pfVolumes,EventContext)
#define IChannelAudioVolume_GetAllVolumes(This,dwCount,pfVolumes) (This)->lpVtbl->GetAllVolumes(This,dwCount,pfVolumes)
#endif

#endif

HRESULT STDMETHODCALLTYPE IChannelAudioVolume_GetChannelCount_Proxy(
    IChannelAudioVolume* This,
    UINT32 *pdwCount);
void __RPC_STUB IChannelAudioVolume_GetChannelCount_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IChannelAudioVolume_SetChannelVolume_Proxy(
    IChannelAudioVolume* This,
    UINT32 dwIndex,
    const float fLevel,
    LPCGUID EventContext);
void __RPC_STUB IChannelAudioVolume_SetChannelVolume_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IChannelAudioVolume_GetChannelVolume_Proxy(
    IChannelAudioVolume* This,
    UINT32 dwIndex,
    float *pfLevel);
void __RPC_STUB IChannelAudioVolume_GetChannelVolume_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IChannelAudioVolume_SetAllVolumes_Proxy(
    IChannelAudioVolume* This,
    UINT32 dwCount,
    const float *pfVolumes,
    LPCGUID EventContext);
void __RPC_STUB IChannelAudioVolume_SetAllVolumes_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IChannelAudioVolume_GetAllVolumes_Proxy(
    IChannelAudioVolume* This,
    UINT32 dwCount,
    float *pfVolumes);
void __RPC_STUB IChannelAudioVolume_GetAllVolumes_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE pRpcMessage,
    DWORD* pdwStubPhase);

#endif  /* __IChannelAudioVolume_INTERFACE_DEFINED__ */

#define FACILIY_AUDCLNT 0x889
#define AUDCLNT_ERR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILIY_AUDCLNT, n)
#define AUDCLNT_SUCCESS(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILIY_AUDCLNT, n)
#define AUDCLNT_E_NOT_INITIALIZED AUDCLNT_ERR(1)
#define AUDCLNT_E_ALREADY_INITIALIZED AUDCLNT_ERR(2)
#define AUDCLNT_E_WRONG_ENDPOINT_TYPE AUDCLNT_ERR(3)
#define AUDCLNT_E_DEVICE_INVALIDATED AUDCLNT_ERR(4)
#define AUDCLNT_E_NOT_STOPPED AUDCLNT_ERR(5)
#define AUDCLNT_E_BUFFER_TOO_LARGE AUDCLNT_ERR(6)
#define AUDCLNT_E_OUT_OF_ORDER AUDCLNT_ERR(7)
#define AUDCLNT_E_UNSUPPORTED_FORMAT AUDCLNT_ERR(8)
#define AUDCLNT_E_INVALID_SIZE AUDCLNT_ERR(9)
#define AUDCLNT_E_DEVICE_IN_USE AUDCLNT_ERR(0x0a)
#define AUDCLNT_E_BUFFER_OPERATION_PENDING AUDCLNT_ERR(0x0b)
#define AUDCLNT_E_THREAD_NOT_REGISTERED AUDCLNT_ERR(0x0c)
#define AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED AUDCLNT_ERR(0x0e)
#define AUDCLNT_E_ENDPOINT_CREATE_FAILED AUDCLNT_ERR(0x0f)
#define AUDCLNT_E_SERVICE_NOT_RUNNING AUDCLNT_ERR(0x10)
#define AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED AUDCLNT_ERR(0x11)
#define AUDCLNT_E_EXCLUSIVE_MODE_ONLY AUDCLNT_ERR(0x12)
#define AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL AUDCLNT_ERR(0x13)
#define AUDCLNT_E_EVENTHANDLE_NOT_SET AUDCLNT_ERR(0x14)
#define AUDCLNT_E_INCORRECT_BUFFER_SIZE AUDCLNT_ERR(0x15)
#define AUDCLNT_E_BUFFER_SIZE_ERROR AUDCLNT_ERR(0x16)
#define AUDCLNT_E_CPUUSAGE_EXCEEDED AUDCLNT_ERR(0x17)
#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x18)
#define AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED AUDCLNT_ERR(0x19)
#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x20)
#define AUDCLNT_S_BUFFER_EMPTY AUDCLNT_SUCCESS(0x1)
#define AUDCLNT_S_THREAD_ALREADY_REGISTERED AUDCLNT_SUCCESS(0x2)
#define AUDCLNT_S_POSITION_STALLED AUDCLNT_SUCCESS(0x3)
#endif /*__audioclient_h__*/
/* Begin additional prototypes for all interfaces */

/* End additional prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __WIDL_AUDIOCLIENT_H */


text:
extern "C" {
#endif	// __cplusplus

// Fatal error related to a system call.
// Print a message, dump core, and terminate.
void TGM_ErrDump(const char *, ...);

// Nonfatal error unrelated to a system call.
// Print a message and return.
void TGM_ErrMsg(const char *, ...);

// Fatal error unrelated to a system call.
// Print a message and terminate.
void TGM_ErrQuit(const char *, ...);

// Nonfatal error related to a system call.
// Print a message and return.
void TGM_ErrRet(const char *, ...);

// Fatal error related to a system call.
// Print a message and terminate.
void TGM_ErrSys(const char *, ...);

#ifdef __cplusplus
}
#endif	// __cplusplus

#endif  //TGM_ERROR_H

redpajama_set_name: RedPajamaGithub


text:
module.exports = (canvas) => {
    if (!!window.WebGLRenderingContext) {
        const names = ['webgl', 'experimental-webgl', 'moz-webgl'];
        let gl = false;

        for (let i = 0; i < names.length; i++) {
            try {
                gl = canvas.getContext(names[i]);
                if (gl && typeof gl.getParameter === 'function') {
                    /* WebGL is enabled */
                    return gl;
                }
            } catch (e) {
                console.log('Unable to initialize WebGL. Your browser may not support it.'); // eslint-disable-line no-console
            }
        }

        /* WebGL is supported, but disabled */
        return false;
    }
    /* WebGL not supported*/
    return false;
};


text:
package de.decoit.simu.cbor.ifmap.simu.deserializer.metadata;

import co.nstant.in.cbor.CborDecoder;
import co.nstant.in.cbor.model.Array;
import co.nstant.in.cbor.model.DataItem;
import de.decoit.simu.cbor.ifmap.enums.IfMapCardinality;
import de.decoit.simu.cbor.ifmap.simu.AbstractSimuTestBase;
import de.decoit.simu.cbor.ifmap.simu.metadata.singlevalue.CBORIdentifiesAs;
import de.decoit.simu.cbor.ifmap.simu.util.SimuNamespaces;
import de.decoit.simu.cbor.ifmap.util.TimestampHelper;
import de.decoit.simu.cbor.xml.dictionary.DictionaryProvider;
import de.decoit.simu.cbor.xml.dictionary.DictionarySimpleElement;
import java.io.ByteArrayInputStream;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import javax.xml.bind.DatatypeConverter;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Thomas Rix (rix@decoit.de)
 */
@Slf4j
public class IdentifiesAsDeserializerTest extends AbstractSimuTestBase {
	private final String publisherId = "my-publisher-id";
	private final ZonedDateTime ifMapTimestamp = ZonedDateTime.parse("2011-12-03T10:15:30.123456+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);

	@Test
	public void testDeserialize() throws Exception {
		byte[] input = DatatypeConverter.parseHexBinary("84040988006F6D792D7075626C69736865722D696401C11A4ED9E8B202"
				+ "C482281A075BCA00030080");

		ByteArrayInputStream bis = new ByteArrayInputStream(input);
		CborDecoder cd = new CborDecoder(bis);
		List<DataItem> diList = cd.decode();
		Array topLevelArray = (Array) diList.get(0);

		String dictPath = "<" + SimuNamespaces.SIMU + ">" + CBORIdentifiesAs.XML_NAME;
		DictionarySimpleElement dse = DictionaryProvider.getInstance().findElementByPath(dictPath);

		CBORIdentifiesAs result = IdentifiesAsDeserializer
										.getInstance()
										.deserialize((Array)topLevelArray.getDataItems().get(2),
													 topLevelArray.getDataItems().get(3),
													 dse);

		assertEquals(publisherId, result.getIfMapPublisherId());
		assertEquals(TimestampHelper.toUTC(ifMapTimestamp), result.getIfMapTimestamp());
		assertEquals(IfMapCardinality.SINGLE_VALUE, result.getIfMapCardinality());
	}
}


text:
module Slack
  module Web
    module Api
      module Endpoints
        module Team
          #
          # Gets the access logs for the current team.
          #
          # @option options [string] :before
          #   End of time range of logs to include in results (inclusive).
          # @option options [string] :team_id
          #   encoded team id to get logs from, required if org token is used.
          # @see https://api.slack.com/methods/team.accessLogs
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
          def team_accessLogs(options = {})
            post('team.accessLogs', options)
          end

          #
          # Gets billable users information for the current team.
          #
          # @option options [string] :team_id
          #   encoded team id to get the billable information from, required if org token is used.
          # @option options [user] :user
          #   A user to retrieve the billable information for. Defaults to all users.
          # @see https://api.slack.com/methods/team.billableInfo
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.billableInfo.json
          def team_billableInfo(options = {})
            options = options.merge(user: users_id(options)['user']['id']) if options[:user]
            post('team.billableInfo', options)
          end

          #
          # Gets information about the current team.
          #
          # @option options [string] :domain
          #   Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.
          # @option options [string] :team
          #   Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.
          # @see https://api.slack.com/methods/team.info
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
          def team_info(options = {})
            post('team.info', options)
          end

          #
          # Gets the integration logs for the current team.
          #
          # @option options [string] :app_id
          #   Filter logs to this Slack app. Defaults to all logs.
          # @option options [string] :change_type
          #   Filter logs with this change type. Defaults to all logs.
          # @option options [string] :service_id
          #   Filter logs to this service. Defaults to all logs.
          # @option options [string] :team_id
          #   encoded team id to get logs from, required if org token is used.
          # @option options [user] :user
          #   Filter logs generated by this user's actions. Defaults to all logs.
          # @see https://api.slack.com/methods/team.integrationLogs
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.integrationLogs.json
          def team_integrationLogs(options = {})
            options = options.merge(user: users_id(options)['user']['id']) if options[:user]
            post('team.integrationLogs', options)
          end
        end
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Threading;

namespace Orleans.Runtime
{

    internal class Watchdog : AsynchAgent
    {
        private static readonly TimeSpan heartbeatPeriod = TimeSpan.FromMilliseconds(1000);
        private readonly TimeSpan healthCheckPeriod;
        private DateTime lastHeartbeat;
        private DateTime lastWatchdogCheck;
        private readonly List<IHealthCheckParticipant> participants;
        private readonly TraceLogger logger;
        private readonly CounterStatistic watchdogChecks;
        private CounterStatistic watchdogFailedChecks;

        public Watchdog(TimeSpan watchdogPeriod, List<IHealthCheckParticipant> watchables)
        {
            logger = TraceLogger.GetLogger("Watchdog");
            healthCheckPeriod = watchdogPeriod;
            participants = watchables;
            watchdogChecks = CounterStatistic.FindOrCreate(StatisticNames.WATCHDOG_NUM_HEALTH_CHECKS);
        }

        public override void Start()
        {
            logger.Info("Starting Silo Watchdog.");
            var now = DateTime.UtcNow;
            lastHeartbeat = now;
            lastWatchdogCheck = now;
            base.Start();
        }

        #region Overrides of AsynchAgent

        protected override void Run()
        {
            while (!Cts.IsCancellationRequested)
            {
                try
                {
                    WatchdogHeartbeatTick(null);
                    Thread.Sleep(heartbeatPeriod);
                }
                catch (ThreadAbortException)
                {
                    // Silo is probably shutting-down, so just ignore and exit
                }
                catch (Exception exc)
                {
                    logger.Error(ErrorCode.Watchdog_InternalError, "Watchdog Internal Error.", exc);
                }
            }
        }

        #endregion

        private void WatchdogHeartbeatTick(object state)
        {
            try
            {
                CheckYourOwnHealth(lastHeartbeat, logger);
            }
            finally
            {
                lastHeartbeat = DateTime.UtcNow;
            }

            var timeSinceLastWatchdogCheck = (DateTime.UtcNow - lastWatchdogCheck);
            if (timeSinceLastWatchdogCheck <= healthCheckPeriod) return;

            watchdogChecks.Increment();
            int numFailedChecks = 0;
            foreach (IHealthCheckParticipant participant in participants)
            {
                try
                {
                    bool ok = participant.CheckHealth(lastWatchdogCheck);
                    if (!ok)
                        numFailedChecks++;
                }
                catch (Exception exc)
                {
                    logger.Warn(ErrorCode.Watchdog_ParticipantThrownException,
                        String.Format("HealthCheckParticipant {0} has thrown an exception from its CheckHealth method.", participant.ToString()), exc);
                }
            }
            if (numFailedChecks > 0)
            {
                if (watchdogFailedChecks == null)
                    watchdogFailedChecks = CounterStatistic.FindOrCreate(StatisticNames.WATCHDOG_NUM_FAILED_HEALTH_CHECKS);

                watchdogFailedChecks.Increment();
                logger.Warn(ErrorCode.Watchdog_HealthCheckFailure, String.Format("Watchdog had {0} Health Check Failure(s) out of {1} Health Check Participants.", numFailedChecks, participants.Count));
            }
            lastWatchdogCheck = DateTime.UtcNow;
        }

        private static void CheckYourOwnHealth(DateTime lastCheckt, TraceLogger logger)
        {
            var timeSinceLastTick = (DateTime.UtcNow - lastCheckt);
            if (timeSinceLastTick > heartbeatPeriod.Multiply(2))
            {
                var gc = new[] { GC.CollectionCount(0), GC.CollectionCount(1), GC.CollectionCount(2) };
                logger.Warn(ErrorCode.SiloHeartbeatTimerStalled,
                    ".NET Runtime Platform stalled for {0} - possibly GC? We are now using total of {1}MB memory. gc={2}, {3}, {4}",
                    timeSinceLastTick,
                    GC.GetTotalMemory(false) / (1024 * 1024),
                    gc[0],
                    gc[1],
                    gc[2]);
            }
        }
    }
}


text:
    <view-actions override="formController.actions" entry="entry" entity="view.entity">
        <list-button entity="entity"></list-button>
    </view-actions>

            {{'ngAdmin.static.CREATE_NEW' | translate}} {{ 'ngAdmin.entities.' + formController.view.entity.name() |translate | humanize:true | singularize  }}

{{ formController.description }}

    <form class="form-horizontal" name="{{ formController.name}}" ng-submit="formController.submitCreation(createForm, $event)">

                <button type="submit" class="btn btn-primary"> {{'ngAdmin.static.SUBMIT' | translate}} </button>

    </form>


text:
API Reference

Provides ripple effects for md-button.  See $mdInkRipple service for all possible configuration options.

        Arguments

      Parameter
      Type
      Description

          scope

object

object

Scope within the current context

          element

object

object

The element the ripple effect should be applied to

          options

object

object

(Optional) Configuration options to override the defaultripple configuration


text:
package test.subtitle;

/**
 * Base subtitle test.
 *
 * @author budi
 */
public abstract class BaseSubtitleTest {

    /**
     * Class constructor.
     */
    public BaseSubtitleTest() {

    }

}


text:
<?php

namespace PeskyCMF\Config;

use Illuminate\Contracts\Auth\Guard;
use Illuminate\Foundation\Application;
use Illuminate\View\View;
use PeskyCMF\ApiDocs\CmfApiDocumentationModule;
use PeskyCMF\Auth\CmfAccessPolicy;
use PeskyCMF\Auth\CmfAuthModule;
use PeskyCMF\Auth\Middleware\CmfAuth;
use PeskyCMF\Http\Middleware\UseCmfSection;
use PeskyCMF\PeskyCmfAppSettings;
use PeskyCMF\Providers\PeskyCmfLanguageDetectorServiceProvider;
use PeskyCMF\Scaffold\ScaffoldConfig;
use PeskyCMF\Scaffold\ScaffoldConfigInterface;
use PeskyCMF\Scaffold\ScaffoldLoggerInterface;
use PeskyCMF\UI\CmfUIModule;
use PeskyORM\ORM\Column;
use PeskyORM\ORM\RecordInterface;
use PeskyORM\ORM\TableInterface;
use Vluzrmos\LanguageDetector\Providers\LanguageDetectorServiceProvider;

abstract class CmfConfig extends ConfigsContainer {

    static private $instances = [];

    protected final function __construct() {
        self::$instances[get_class($this)] = $this;
        if (!array_key_exists(__CLASS__, self::$instances)) {
            $this->useAsPrimary();
        }
    }

    private static function _protect() {
        if (static::class === CmfConfig::class) {
            throw new \BadMethodCallException('Attempt to call method of CmfConfig class instead of its child class');
        }
    }

    /**
     * Use this object as default config
     * Note: this is used in *Record, *Table, and *TableStructure DB classes of CMS
     */
    public final function useAsDefault() {
        self::$instances['default'] = $this;
    }

    /**
     * Get CmfConfig marked as default one (or primary config if default one not provided)
     * @return CmfConfig
     */
    static final public function getDefault(): CmfConfig {
        return isset(self::$instances['default']) ? self::$instances['default'] : self::getPrimary();
    }

    /**
     * Use this object as primary config
     * Note: this object will be returned when you call CmfConfig::getInstance() instead of CustomConfig::getInstance()
     */
    public final function useAsPrimary() {
        self::$instances[__CLASS__] = $this;
    }

    /**
     * @return CmfConfig
     */
    static final public function getPrimary(): CmfConfig {
        if (!isset(self::$instances[__CLASS__])) {
            throw new \BadMethodCallException('Primary CMF Config is not specified');
        }
        return self::$instances[__CLASS__];
    }

    /**
     * Returns instance of config class it was called from
     * Note: method excluded from toArray() results but key "config_instance" added instead of it
     * @return $this
     */
    static final public function getInstance() {
        $class = get_called_class();
        if (!array_key_exists($class, self::$instances)) {
            self::$instances[$class] = new $class;
        }
        return self::$instances[$class];
    }

    /**
     * File name for this site section in 'configs' folder of project's root directory (without '.php' extension)
     * Example: 'admin' for config/admin.php;
     */
    static protected function configsFileName(): string {
        return 'peskycmf';
    }

    /**
     * @param string $key
     * @param mixed $default
     * @return mixed
     */
    static public function config($key, $default = null) {
        return config(static::getInstance()->configsFileName() . '.' . $key, $default);
    }

    static public function cmf_routes_config_files(): array {
        return [
            __DIR__ . '/peskycmf.routes.php',
        ];
    }

    final static public function cmf_views_dir(): string {
        return __DIR__ . '/../resources/views';
    }

    /**
     * @return array
     */
    static public function language_detector_configs(): array {
        return [
            'autodetect' => true,
            'driver' => 'browser',
            'cookie' => true,
            'cookie_name' => static::makeUtilityKey('locale'),
            'cookie_encrypt' => true,
            'languages' => static::locales_for_language_detector(),
        ];
    }

    /**
     * @return PeskyCmfAppSettings|\App\AppSettings
     */
    static public function getAppSettings(): PeskyCmfAppSettings {
        return app(PeskyCmfAppSettings::class);
    }

    /**
     * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard|\Illuminate\Auth\SessionGuard
     */
    static public function getAuthGuard(): Guard {
        return static::getAuthModule()->getAuthGuard();
    }

    /**
     * @return \PeskyCMF\Db\Admins\CmfAdmin|\Illuminate\Contracts\Auth\Authenticatable|\PeskyCMF\Db\Traits\ResetsPasswordsViaAccessKey|\App\Db\Admins\Admin|null
     */
    static public function getUser(): ?RecordInterface {
        return static::getAuthModule()->getUser();
    }

    /**
     * @return CmfAuthModule
     */
    static public function getAuthModule(): CmfAuthModule {
        return app(CmfAuthModule::class);
    }

    /**
     * @return CmfUIModule
     */
    static public function getUiModule(): CmfUIModule {
        return app(CmfUIModule::class);
    }

    /**
     * Email address used in "From" header for emails sent to users
     * @return string
     * @throws \UnexpectedValueException
     */
    static public function system_email_address(): string {
        return static::config('system_email_address', function () {
            return 'noreply@' . request()->getHost();
        });
    }

    /**
     * Url prefix for routes
     * @return string
     */
    static public function url_prefix(): string {
        return static::config('url_prefix', 'admin');
    }

    /**
     * Url prefix for routes
     * @return string
     */
    static public function app_subfolder(): string {
        return static::config('app_subfolder', 'Admin');
    }

    /**
     * @return string
     */
    static public function getPathToCmfClasses(): string {
        return app_path(static::app_subfolder());
    }

    /**
     * @return string|null
     */
    static public function recaptcha_private_key(): ?string {
        return config('services.recaptcha.private_key');
    }

    /**
     * @return string|null
     */
    static public function recaptcha_public_key(): ?string {
        return config('services.recaptcha.public_key');
    }

    static public function recaptcha_script(): string {
        return 'https://www.google.com/recaptcha/api.js?hl=' . static::getShortLocale();
    }

    /**
     * @return string
     */
    static public function default_page_title(): string {
        return setting()->default_browser_title(function () {
            return static::transCustom('.default_page_title');
        }, true);
    }

    /**
     * @return string
     */
    static public function page_title_addition(): string {
        return setting()->browser_title_addition(function () {
            return static::default_page_title();
        }, true);
    }

    /**
     * Controller class name for CMF scaffolds API
     * @return string
     */
    static public function cmf_scaffold_api_controller_class(): string {
        return \PeskyCMF\Http\Controllers\CmfScaffoldApiController::class;
    }

    /**
     * General controller class name for CMF (basic ui views, custom pages views, login/logout, etc.)
     * @return string
     */
    static public function cmf_general_controller_class(): string {
        return \PeskyCMF\Http\Controllers\CmfGeneralController::class;
    }

    /**
     * Prefix for route names in peskycmf.routes.php
     * Use with caution and only when you really know what you're doing
     * @return string
     */
    static public function routes_names_prefix(): string {
        return static::url_prefix() . '/';
    }

    /**
     * @param string $routeAlias
     * @return string
     */
    static public function getRouteName($routeAlias): string {
        return static::routes_names_prefix() . $routeAlias;
    }

    /**
     * @param string $routeName
     * @param array $parameters
     * @param bool $absolute
     * @return string
     */
    static public function route(string $routeName, array $parameters = [], bool $absolute = false): string {
        return route(static::getRouteName($routeName), $parameters, $absolute);
    }

    /**
     * Note: placed here to avoid problems with auth module constructor when registering routes for all cmf sections
     * @return array
     */
    static public function auth_middleware(): array {
        return (array)static::config('auth.middleware', [CmfAuth::class]);
    }

    /**
     * Basic set of middlewares for scaffold api controller
     * @return array
     */
    static public function middleware_for_cmf_scaffold_api_controller(): array {
        return [];
    }

    /**
     * The menu structure of the site.
     * @return array
     * You may use static::getMenuItem($resourceName) or static::getMenuItems() to get
     * menu items from registered scaffold configs.
     * Todo: add CmfSidebarMenuItem class to help designing menu items
     * Menu item format:
     *    [
     *         [
     *              'label' => 'label',
     *              'url' => '/url',
     *              'icon' => 'icon',
     *         ],
     *         [
     *              'label' => 'label',
     *              'icon' => 'icon',
     *              'open' => false,
     *              'submenu' => [...]
     *         ],
     *    ]
     * Available options:
     *  - label - text of menu item (required)
     *  - icon - icon for menu item (optinal)
     *  - url - where to send user (required if no 'submenu' present; can contain empty value to hide menu item)
     *  - submenu - array of arrays (optional); arrays may contain all keys described here except 'submenu' (3rd level of menu items not supported)
     *  - additional - any html to add to menu item (optional)
     *  - counter - name of a "counter" variable (optional); adds  to menu item.
     *          You can provide contents for this tag via CmfConfig::getCountersForMenu() method.
     *          Example: public function getCountersForMenu() {
     *              return ['prending_orders' => '2'];
     *          }
     *          'prending_orders' here is the name of a "counter".
     *          The idea is to add a possibility to show some autoupdatable numbers (counters) on menu items like
     *          pending orders count, new messages count, etc...
     *          Counters updated on every POST/PUT/DELETE request and by timeout. Also you can be manually
     *          request counters update by JS function AdminUI.updateMenuCounters();
     *          Update interval can be changed via JS app config: CmfSettings.menuCountersUpdateIntervalMs = 30000;
     */
    static public function menu(): array {
        return array_merge(
            [
                [
                    'label' => static::transCustom('.page.dashboard.menu_title'),
                    'url' => routeToCmfPage('dashboard'),
                    'icon' => 'glyphicon glyphicon-dashboard',
                ],
                /*[
                    'label' => static::transCustom('.users.menu_title'),
                    'url' => '/resource/users',
                    'icon' => 'fa fa-group'
                ],*/
                /*[
                    'label' => static::transCustom('.menu.section_utils'),
                    'icon' => 'glyphicon glyphicon-align-justify',
                    'submenu' => [
                        [
                            'label' => static::transCustom('.admins.menu_title'),
                            'url' => '/resource/admins',
                            'icon' => 'glyphicon glyphicon-user'
                        ],
                    ],
                ]*/
                /*[
                    'label' => 'required',
                    'icon' => 'optional',
                    'submenu' => [], //< 'optional'
                    'url' => 'required
                ]*/
            ],
            static::getMenuItems()
        );
    }

    /**
     * Get values for menu items counters (details in CmfConfig::menu())
     * @return array like ['pending_orders' => '2']
     */
    static public function getValuesForMenuItemsCounters(): array {
        return static::getUiModule()->getValuesForMenuItemsCounters();
    }

    /**
     * @param string $itemKey
     * @param array|\Closure $menuItem - format: see menu()
     */
    static public function addMenuItem(string $itemKey, $menuItem) {
        static::getUiModule()->addCustomMenuItem($itemKey, $menuItem);
    }

    /**
     * @param array $itemsKeys - list of keys to return values for, if empty - will return all menu items
     * @return array
     */
    static protected function getMenuItems(...$itemsKeys): array {
        $menuItems = static::getUiModule()->getMenuItems();
        if (empty($itemsKeys)) {
            return $menuItems;
        } else {
            return array_intersect_key($menuItems, array_flip($itemsKeys));
        }
    }

    /**
     * @param array $excludeItemsWithKeys - list of keys to exclude from resulting menu items array
     * @return array
     */
    static protected function getMenuItemsExcept(...$excludeItemsWithKeys): array {
        if (empty($excludeItemsWithKeys)) {
            return static::getInstance()->getMenuItems();
        } else {
            return array_diff_key(static::getInstance()->getMenuItems(), array_flip($excludeItemsWithKeys));
        }
    }

    /**
     * Get menu item config or null if there is no such menu item
     * @param string $resourceName
     * @return array|null
     */
    static protected function getMenuItem($resourceName): ?array {
        return array_get(static::getMenuItems(), $resourceName);
    }

    /**
     * Name for custom CMF dictionary that contains translation for CMF resource sections and pages
     * @return string
     */
    static public function custom_dictionary_name(): string {
        return static::config('dictionary', 'cmf::custom');
    }

    /**
     * Translate from custom dictionary. You can use it via CmfConfig::transCustom() insetad of
     * CmfConfig::getPrimary()->transCustom() if you need to get translation for primary config.
     * Note: if there is no translation in your dictionary - it will be imported from 'cmf::custom' dictionary
     * @param string $path - without dictionary name. Example: 'admins.test' will be converted to '{dictionary}.admins.test'
     * @param array $parameters
     * @param null|string $locale
     * @return string|array
     */
    static public function transCustom($path, array $parameters = [], $locale = null) {
        $dict = static::getInstance()->custom_dictionary_name();
        $path = '.' . ltrim($path, '.');
        $primaryPath = $dict . $path;
        $trans = trans($primaryPath, $parameters, $locale);
        if ($trans === $primaryPath && $dict !== 'cmf::custom') {
            $fallbackPath = 'cmf::custom' . $path;
            $trans = trans($fallbackPath, $parameters, $locale);
            if ($trans === $fallbackPath) {
                return $primaryPath;
            }
        }
        return $trans;
    }

    /**
     * Dictionary that contains general ui translations for CMF
     * @return string
     */
    static public function cmf_general_dictionary_name(): string {
        return 'cmf::cmf';
    }

    /**
     * Translate from custom dictionary. You can use it via CmfConfig::transGeneral() insetad of
     * CmfConfig::getPrimary()->transGeneral() if you need to get translation for primary config
     * Note: if there is no translation in your dictionary - it will be imported from 'cmf::cmf' dictionary
     * @param string $path - without dictionary name. Example: 'admins.test' will be converted to '{dictionary}.admins.test'
     * @param array $parameters
     * @param null|string $locale
     * @return string|array
     */
    static public function transGeneral($path, array $parameters = [], $locale = null) {
        $dict = static::getInstance()->cmf_general_dictionary_name();
        $path = '.' . ltrim($path, '.');
        $primaryPath = $dict . $path;
        $trans = trans($primaryPath, $parameters, $locale);
        if ($trans === $primaryPath && $dict !== 'cmf::cmf') {
            $fallbackPath = 'cmf::cmf' . $path;
            $trans = trans($fallbackPath, $parameters, $locale);
            if ($trans === $fallbackPath) {
                return $primaryPath;
            }
        }
        return $trans;
    }

    /**
     * Translations for Api Docs
     * @param string $translationPath
     * @param array $parameters
     * @param null $locale
     * @return string|array
     */
    static public function transApiDoc(string $translationPath, array $parameters = [], $locale = null) {
        if (static::class === self::class) {
            // redirect CmfConfig::transApiDoc() calls to primary config class
            return self::getPrimary()->transApiDoc($translationPath, $parameters, $locale);
        } else {
            $translationPath = 'api_docs.' . ltrim($translationPath, '.');
            return static::transCustom($translationPath, $parameters, $locale);
        }
    }

    /**
     * Default CMF language
     * @return string
     */
    static public function default_locale(): string {
        return static::config('locale', 'en');
    }

    /**
     * Supported locales for CMF
     * @return array - each value is locale code (usually 2 chars: en, ru; rarely - 5 chars: ru_RU, en_US)
     */
    static public function locales(): array {
        return array_unique(array_values(static::config('locales', ['en'])));
    }

    /**
     * Supported locales for CMF
     * Note: you can redirect locales using key as locale to redirect from and value as locale to redirect to
     * For details see: https://github.com/vluzrmos/laravel-language-detector
     * @return array
     */
    static public function locales_for_language_detector(): array {
        return (array)static::config('locales', ['en']);
    }

    /**
     * Change locale inside CMF/CMS area
     * @param string $locale
     */
    static public function setLocale($locale) {
        static::_protect();
        \LanguageDetector::apply($locale);
        \LanguageDetector::addCookieToQueue(\App::getLocale());
        Column::setValidationErrorsMessages((array)static::transGeneral('form.message.column_validation_errors') ?: []);
    }

    /**
     * @return string - 2 chars lowercases
     */
    static public function getShortLocale(): string {
        return strtolower(substr(app()->getLocale(), 0, 2));
    }

    static protected $localeSuffixMap = [
        'en' => 'US',
        'ko' => 'KR',
        'ja' => 'JP',
        'cs' => 'CZ',
        'da' => 'DK',
        'et' => 'EE',
        'fa' => 'IR',
        'kh' => 'KM',
        'nb' => 'NO',
        'pt' => 'BR',
        'sv' => 'SE',
        'vi' => 'VN',
        'zh' => 'CN',
    ];
    /**
     * Get locale in format "en_US" or "ru-RU" or "it-it"
     * @param string $separator
     * @param bool $lowercased - true: will return "it-it" instead of "it-IT"
     * @return string
     */
    static public function getLocaleWithSuffix($separator = '_', $lowercased = false): ?string {
        $locale = preg_split('%[-_]%', strtolower(app()->getLocale()));
        if (count($locale) === 2) {
            return $locale[0] . $separator . ($lowercased ? $locale[1] : strtoupper($locale[1]));
        } else {
            $localeSuffix = isset(static::$localeSuffixMap[$locale[0]]) ? static::$localeSuffixMap[$locale[0]] : $locale[0];
            return $locale[0] . $separator . ($lowercased ? $localeSuffix : strtoupper($localeSuffix));
        }
    }

    /**
     * Reset locale to default
     */
    static public function resetLocale() {
        static::setLocale(\LanguageDetector::getDriver()->detect());
    }

    /**
     * @return string
     */
    static public function session_message_key(): string {
        return static::makeUtilityKey('message');
    }

    /**
     * Start page URL of CMS section
     *
     * @param bool $absolute
     * @return string
     */
    static public function home_page_url($absolute = false): string {
        return static::route('cmf_start_page', [], $absolute);
    }

    /**
     * How much rows to display in data tables
     * @return int
     */
    static public function rows_per_page(): int {
        return 25;
    }

    /**
     * Additional configs for jQuery Data Tables lib
     * @return array
     */
    static public function data_tables_config(): array {
        return [
            'scrollX' => true,
            'scrollY' => 'calc(100vh - 248px)',
            'scrollCollapse' => true,
            'width' => '100%',
            'filter' => true,
            'stateSave' => true,
            'dom' => "
                <'row toolbar-container'
                    <'col-xs-12 col-md-5'<'filter-toolbar btn-toolbar text-left'>>
                    <'col-xs-12 col-md-7'<'toolbar btn-toolbar text-right'>>
                >
                <'#query-builder-container'<'#query-builder'>>
                <'row data-grid-container'<'col-sm-12'tr>>
                <'row pagination-container'
                    <'col-md-3 hidden-xs hidden-sm'i>
                    <'col-xs-12 col-md-6'p>
                    <'col-md-3 hidden-xs hidden-sm'l>
                >",
        ];
    }

    /**
     * Additional configs for CKEditor lib
     * @return array
     */
    static public function ckeditor_config(): array {
        return [
            'language' => static::getShortLocale(),
            'toolbarGroups' => [
                [ 'name' => 'clipboard', 'groups' => [ 'clipboard', 'undo' ] ],
                [ 'name' => 'editing', 'groups' => [ 'find', 'selection', 'spellchecker', 'editing' ] ],
                [ 'name' => 'links', 'groups' => [ 'links' ] ],
                [ 'name' => 'insert', 'groups' => [ 'insert' ] ],
                [ 'name' => 'forms', 'groups' => [ 'forms' ] ],
                [ 'name' => 'tools', 'groups' => [ 'tools' ] ],
                [ 'name' => 'document', 'groups' => [ 'mode', 'document', 'doctools' ] ],
                [ 'name' => 'others', 'groups' => [ 'others' ] ],
                [ 'name' => 'about', 'groups' => [ 'about' ] ],
                '/',
                [ 'name' => 'basicstyles', 'groups' => [ 'basicstyles', 'cleanup' ] ],
                [ 'name' => 'paragraph', 'groups' => [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] ],
                [ 'name' => 'styles', 'groups' => [ 'styles' ] ],
                [ 'name' => 'colors', 'groups' => [ 'colors' ] ],
            ],
            'removeButtons' => 'Superscript,Find,Replace,SelectAll,Scayt,Flash,Smiley,PageBreak,Iframe,Form,Checkbox,'
                . 'Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Maximize,Save,NewPage,Preview,Print,'
                . 'Templates,Strike,Subscript,BidiLtr,BidiRtl,Language,Styles',
            'format_tags' => 'p;h1;h2;h3;pre',
            'enterMode' => 1, //< insert
 on pressing ENTER
            'forceEnterMode' => true,
            'removeDialogTabs' => 'image:advanced',
            'extraPlugins' => 'uploadimage',
            'contentsCss' => static::css_files_for_wysiwyg_editor(),
            // _token won't be working this way =(
            // moved to WysiwygFormInput->getWysiwygConfig()
            //'uploadUrl' => static::route('cmf_ckeditor_upload_image', ['_token' => csrf_token()]),
            //'filebrowserImageUploadUrl' => static::route('cmf_ckeditor_upload_image', ['_token' => csrf_token()]),
        ];
    }

    /**
     * Add some css files inside wysuwyg editor to allow custom styling while editing wysiwyg contents
     * @return array
     */
    static public function css_files_for_wysiwyg_editor(): array {
        return [];
    }

    /**
     * Data inserts for CmsPage-related scaffold configs to be added to ckeditor's plugin
     * Use WysiwygFormInput::createDataInsertConfig() and WysiwygFormInput::createDataInsertConfigWithArguments()
     * to create valid config
     * @param ScaffoldConfig $scaffold
     * @return array
     */
    static public function getAdditionalWysywygDataInsertsForCmsPages(ScaffoldConfig $scaffold): array {
        return [];
    }

    /**
     * Html inserts for CmsPage-related scaffold configs to be added to ckeditor's plugin
     * Use WysiwygFormInput::createHtmlInsertConfig('', 'menu title') to create valid config
     * @param ScaffoldConfig $scaffold
     * @return array
     */
    static public function getWysywygHtmlInsertsForCmsPages(ScaffoldConfig $scaffold): array {
        return [];
    }

    /**
     * Get ScaffoldConfig instance
     * @param string $resourceName
     * @return ScaffoldConfig|ScaffoldConfigInterface
     * @throws \InvalidArgumentException
     */
    static public function getScaffoldConfig(string $resourceName): ScaffoldConfigInterface {
        return static::getUiModule()->getScaffoldConfig($resourceName);
    }

    /**
     * Get ScaffoldConfig class name
     * @param string $resourceName
     * @return string
     * @throws \InvalidArgumentException
     */
    static public function getScaffoldConfigClass(string $resourceName): string {
        return static::getUiModule()->getScaffoldConfigClass($resourceName);
    }

    /**
     * Get TableInterface instance for $tableName
     * Note: can be ovewritted to allow usage of fake tables in resources routes
     * It is possible to use this with static::getScaffoldConfig() to alter default scaffold configs
     * @param string $resourceName
     * @return TableInterface
     */
    static public function getTableByResourceName(string $resourceName): TableInterface {
        return static::getUiModule()->getTableByResourceName($resourceName);
    }

    static public function getApiDocumentationModule(): CmfApiDocumentationModule {
        return app(CmfApiDocumentationModule::class);
    }

    protected $httpRequestsLogger;

    /**
     * @return null|ScaffoldLoggerInterface;
     */
    static public function getHttpRequestsLogger(): ?ScaffoldLoggerInterface {
        if (!static::getInstance()->httpRequestsLogger && app()->bound(ScaffoldLoggerInterface::class)) {
            static::setHttpRequestsLogger(app(ScaffoldLoggerInterface::class));
        }
        return static::getInstance()->httpRequestsLogger;
    }

    /**
     * Logger will be used to logs requested records pk and changes
     * @param ScaffoldLoggerInterface $httpRequestsLogger
     */
    static public function setHttpRequestsLogger(ScaffoldLoggerInterface $httpRequestsLogger) {
        static::getInstance()->httpRequestsLogger = $httpRequestsLogger;
    }

    /**
     * @return array
     */
    static public function getCachedPagesTemplates(): array {
        return \Cache::remember(
            static::getCacheKeyForOptimizedUiTemplates('pages'),
            (int)static::config('ui.optimize_ui_templates.timeout', 0),
            function () {
                $generalControllerClass = static::cmf_general_controller_class();
                /** @var \PeskyCMF\Http\Controllers\CmfGeneralController $controller */
                $controller = new $generalControllerClass();
                if (static::getUser()) {
                    return [
                        static::route('cmf_main_ui', [], false) => $controller->getBasicUiView(),
                    ];
                } else {
                    return [
                        static::route('cmf_login', [], false) . '.html' => $controller->getLoginTpl(),
                        static::route('cmf_forgot_password', [], false) . '.html' => $controller->getForgotPasswordTpl(),
                    ];
                }
            }
        );
    }

    /**
     * @return array
     */
    static public function getCachedResourcesTemplates(): array {
        if (!static::getUser()) {
            return [];
        }
        return \Cache::remember(
            static::getCacheKeyForOptimizedUiTemplates('resources'),
            (int)static::config('ui.optimize_ui_templates.timeout', 0),
            function () {
                return static::collectResourcesTemplatesToBeCached();
            }
        );
    }

    /**
     * @return array
     */
    static protected function collectResourcesTemplatesToBeCached(): array {
        $resourceTemplates = [];
        /** @var ScaffoldConfig $scaffoldConfigClass */
        foreach (static::getUiModule()->getResources() as $resourceName => $scaffoldConfigClass) {
            /** @var ScaffoldConfig $scaffoldConfig */
            $scaffoldConfig = new $scaffoldConfigClass();
            $splitted = $scaffoldConfig->renderTemplatesAndSplit();
            if (!empty($splitted)) {
                $resourceTemplates[$resourceName] = $splitted;
            }
        }
        return $resourceTemplates;
    }

    /**
     * User-id-based cache key
     * @param string $group
     * @return string
     */
    static protected function getCacheKeyForOptimizedUiTemplates($group): string {
        return static::getCacheKeyForOptimizedUiTemplatesBasedOnUserId($group);
    }

    /**
     * User-id-based cache key
     * @param string $group
     * @return string
     */
    static protected function getCacheKeyForOptimizedUiTemplatesBasedOnUserId($group): string {
        if (static::getAuthModule()->getAccessPolicyClassName() === CmfAccessPolicy::class) {
            $userId = 'any';
        } else {
            $user = static::getUser();
            $userId = $user ? $user->getAuthIdentifier() : 'not_authenticated';
        }
        return static::url_prefix() . '_templates_' . static::getShortLocale() . '_' . $group . '_user_' . $userId;
    }

    /**
     * Role-based cache key
     * @param string $group
     * @return string
     */
    static protected function getCacheKeyForOptimizedUiTemplatesBasedOnUserRole($group): string {
        if (static::getAuthModule()->getAccessPolicyClassName() === CmfAccessPolicy::class) {
            $userId = 'any';
        } else {
            $userId = 'not_authenticated';
            $user = static::getUser();
            if ($user && $user->existsInDb()) {
                if ($user::hasColumn('is_superadmin')) {
                    $userId = '__superadmin__';
                } else if ($user::hasColumn('role')) {
                    $userId = $user->role;
                } else {
                    $userId = 'user';
                }
            }
        }
        return static::url_prefix() . '_templates_' . static::getShortLocale() . '_' . $group . '_user_' . $userId;
    }

    /**
     * @param $keySuffix
     * @return string
     */
    static public function makeUtilityKey($keySuffix): string {
        return preg_replace('%[^a-zA-Z0-9]+%i', '_', static::url_prefix()) . '_' . $keySuffix;
    }

    /**
     * @param string $sectionName - cmf section name
     */
    public function declareRoutes($sectionName) {
        $cmfConfig = $this;
        $groupConfig = [
            'prefix' => static::url_prefix(),
            'middleware' => (array)static::config('routes_middleware', ['web']),
        ];
        $cmfSectionSelectorMiddleware = $this->getUseCmfSectionMiddleware($sectionName);
        array_unshift($groupConfig['middleware'], $cmfSectionSelectorMiddleware);
        $namespace = static::config('controllers_namespace');
        if (!empty($namespace)) {
            $groupConfig['namespace'] = ltrim($namespace, '\\');
        }
        // custom routes
        $files = (array)static::config('routes_files', []);
        if (count($files) > 0) {
            foreach ($files as $filePath) {
                \Route::group($groupConfig, function () use ($filePath, $cmfConfig) {
                    // warning! $cmfConfig may be used inside included file
                    include base_path($filePath);
                });
            }
        }

        unset($groupConfig['namespace']); //< cmf routes should be able to use controllers from vendors dir
        if (!\Route::has(static::getRouteName('cmf_start_page'))) {
            \Route::group($groupConfig, function () {
                \Route::get('/', [
                    'uses' => static::cmf_general_controller_class() . '@redirectToUserProfile',
                    'as' => static::getRouteName('cmf_start_page'),
                ]);
            });
        }

        \Route::group($groupConfig, function () use ($cmfConfig) {
            // warning! $cmfConfig may be used inside included file
            include __DIR__ . '/peskycmf.routes.php';
        });

        // special route for ckeditor config.js file
        $groupConfig['middleware'] = [$cmfSectionSelectorMiddleware]; //< only 1 needed
        \Route::group($groupConfig, function () {
            \Route::get('ckeditor/config.js', [
                'uses' => static::cmf_general_controller_class() . '@getCkeditorConfigJs',
                'as' => static::getRouteName('cmf_ckeditor_config_js'),
            ]);
        });
    }

    /**
     * Get middleware that will tell system whick CMF section to use
     * @param string $sectionName
     * @return string
     */
    protected function getUseCmfSectionMiddleware($sectionName): string {
        return UseCmfSection::class . ':' . $sectionName;
    }

    /**
     * @param Application $app
     */
    public function updateAppConfigs($app) {
        /** @var \Illuminate\Config\Repository $appConfigs */
        $appConfigs = $app['config'];
        // add auth guard but do not select it as primary
        $this->addAuthGuardConfigToAppConfigs($appConfigs);
    }

    /**
     * @param \Illuminate\Config\Repository $appConfigs
     */
    protected function addAuthGuardConfigToAppConfigs($appConfigs) {
        // merge cmf guard and provider with configs in config/auth.php
        $cmfAuthConfig = static::config('auth.guard');
        if (!is_array($cmfAuthConfig)) {
            // custom auth guard name provided
            return;
        }

        $config = $appConfigs->get('auth', [
            'guards' => [],
            'providers' => [],
        ]);

        $guardName = array_get($cmfAuthConfig, 'name') ?: static::url_prefix();
        if (array_key_exists($guardName, $config['guards'])) {
            return; //< it is provided manually or cached
        }
        $provider = array_get($cmfAuthConfig, 'provider');
        if (is_array($provider)) {
            $providerName = array_get($provider, 'name', $guardName);
            if (empty($provider['model'])) {
                $provider['model'] = static::config('auth.user_record_class', function () {
                    throw new \UnexpectedValueException('You need to provide a DB Record class for users');
                });
            }
        } else {
            $providerName = $provider;
            $provider = null;
        }
        if (array_key_exists($providerName, $config['providers'])) {
            throw new \UnexpectedValueException('There is already an auth provider with name "' . $guardName . '"');
        }
        $config['guards'][$guardName] = [
            'driver' => array_get($cmfAuthConfig, 'driver', 'session'),
            'provider' => $providerName,
        ];
        if (!empty($provider)) {
            $config['providers'][$providerName] = $provider;
        }

        $appConfigs->set('auth', $config);
    }

    /**
     * @param Application $app
     */
    public function initSection($app) {
        $this->useAsPrimary();

        // configure session
        $this->configureSession($app);

        // init auth module
        /** @var CmfAuthModule $cmfAuthModuleClass */
        $cmfAuthModuleClass = static::config('auth.module') ?: CmfAuthModule::class;
        /** @var CmfAuthModule $authModule */
        $authModule = new $cmfAuthModuleClass($this);
        $app->singleton(CmfAuthModule::class, function () use ($authModule) {
            return $authModule;
        });
        $authModule->init();

        // init UI module
        /** @var CmfAuthModule $cmfAuthModuleClass */
        $cmfUIModuleClass = static::config('ui.module') ?: CmfUIModule::class;
        /** @var CmfAuthModule $authModule */
        $uiModule = new $cmfUIModuleClass($this);
        $app->singleton(CmfUIModule::class, function () use ($uiModule) {
            return $uiModule;
        });

        // init API Documentation module
        $app->singleton(CmfApiDocumentationModule::class, function () {
            $cmfApiDocsModuleClass = static::config('api_documentation.module') ?: CmfApiDocumentationModule::class;
            return new $cmfApiDocsModuleClass($this);
        });

        // send $cmfConfig and $uiModule var to all views
        \View::composer('*', function (View $view) use ($uiModule) {
            $view
                ->with('cmfConfig', $this)
                ->with('uiModule', $uiModule);
        });

        /** @var PeskyCmfLanguageDetectorServiceProvider $langDetectorProvider */
        $langDetectorProvider = $app->register(PeskyCmfLanguageDetectorServiceProvider::class);
        $app->alias(LanguageDetectorServiceProvider::class, PeskyCmfLanguageDetectorServiceProvider::class);
        $langDetectorProvider->importConfigsFromPeskyCmf($this);

        if (static::config('file_access_mask') !== null) {
            umask(static::config('file_access_mask'));
        }

        // Register resource name to ScaffoldConfig class mappings
        //$resources = static::getUiModule()->getScaffolds();
        /** @var ScaffoldConfig $scaffoldConfigClass */
        /*foreach ($resources as $scaffoldConfigClass) {
            static::registerScaffoldConfigForResource($scaffoldConfigClass::getResourceName(), $scaffoldConfigClass);
        }*/
    }

    /**
     * @param Application $app
     */
    protected function configureSession($app) {
        /** @var \Illuminate\Config\Repository $appConfigs */
        $appConfigs = $app['config'];
        $config = array_merge(
            $appConfigs->get('session'),
            ['path' => '/' . trim(static::url_prefix(), '/')],
            (array)static::config('session', [])
        );
        $appConfigs->set('session', $config);
    }

}


text:
package org.quartz.impl;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.core.JobRunShellTsp;
import org.quartz.core.JobRunShellFactoryTsp;
import org.quartz.spi.TriggerFiredBundle;

/**
 *

 * Responsible for creating the instances of {@link org.quartz.core.JobRunShell}
 * to be used within the <class>{@link org.quartz.core.QuartzScheduler}
 *  instance.
 *

 *
 * @author James House
 */
public class StdJobRunShellFactoryTsp implements JobRunShellFactoryTsp {
    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Data members.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    private Scheduler scheduler;

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Interface.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    /**
     *

     * Initialize the factory, providing a handle to the Scheduler
     * that should be made available within the JobRunShell and
     * the JobExecutionContext s within it.
     *

     */
    public void initialize(Scheduler sched) {
        this.scheduler = sched;
    }

    /**
     *

     * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
     *  to obtain instances of
     * {@link org.quartz.core.JobRunShell}.
     *

     */
    public JobRunShellTsp createJobRunShell(TriggerFiredBundle bndle) throws SchedulerException {
        return new JobRunShellTsp(scheduler, bndle);
    }
}


text:
@class SPTrack;
@class SFSpotifyPlayer;

@interface SFSpotifyTrack : SFSpotifyMediaItem <SFAudioTrack>

@property (nonatomic, readonly) SPTrack *spTrack;
@property (nonatomic, assign) BOOL starred;

- (id)initWithTrack:(SPTrack *)theTrack player:(SFSpotifyPlayer *)thePlayer;

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>O-Index</title>
<meta name="date" content="2017-02-06">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M N O P Q R S T U V W

O

onBackPressed() - Method in class com.example.gdbaker_sizebook.Main

allows back button to be used on popup window

onCreate(Bundle) - Method in class com.example.gdbaker_sizebook.Main

onCreate(Bundle) - Method in class com.example.gdbaker_sizebook.NewRecord

onStart() - Method in class com.example.gdbaker_sizebook.Main

initialises adapter

overlapAnchor - Static variable in class com.example.gdbaker_sizebook.R.attr

Must be a boolean value, either "true" or "false".

A B C D E F G H I L M N O P Q R S T U V W

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
pub mod parse;
pub mod http;
pub mod string_watch;
mod lazy_refresh;

pub use self::string_watch::StringWatch;
pub use self::lazy_refresh::LazyRefresh;