/*
 * yasapi_nt_api.h
 *
 * Yet Another (WA)SAPI (YASAPI) New Technology (NT) Output (out_yasapi-nt)
 * Copyright (C) 2015-2019  Peter Belkner (pbelkner@snafu.de)
 *
 * out_yasapi-nt is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * out_yasapi-nt is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with out_yasapi-nt.  If not, see <https://www.gnu.org/licenses/>.
 */
#ifndef __YASAPI_NT_API_H__ // [
#define __YASAPI_NT_API_H__
#ifdef __cplusplus // [
extern "C" {
#endif // ]

///////////////////////////////////////////////////////////////////////////////
#if defined (YASAPI_EXPORT) // [
#undef YASAPI_EXPORT
#define YASAPI_EXPORT __declspec (dllexport)
#else // ] [
#define YASAPI_EXPORT __declspec (dllimport)
#endif // ]

///////////////////////////////////////////////////////////////////////////////
typedef enum _EYasapiNtApi EYasapiNtApi;
typedef struct _YasapiNtApi YasapiNtApi;
typedef struct _YasapiNtApiV1 YasapiNtApiV1;
typedef const YasapiNtApi *(GetYasapiNtApiFun)(void);

///////////////////////////////////////////////////////////////////////////////
enum _EYasapiNtApi {
  eYasapiNtApiVersion=1
};

///////////////////////////////////////////////////////////////////////////////
struct _YasapiNtApi {
  EYasapiNtApi (*Version)(void);

  struct _YasapiNtApiV1 {
    int (*Open)(int samplerate, int numchannels, int bitspersamp,
        /*out*/ int *pnMaxLatency, /*out*/ int *pnFramesDevice);
    int (*Write)(int msTimeout, const char *buf, int len);
    int (*EndOfTrack)(int msTimeout);
    void (*Kill)(void);
  } v1;
};

///////////////////////////////////////////////////////////////////////////////
YASAPI_EXPORT GetYasapiNtApiFun GetYasapiNtApi;

#ifdef __cplusplus // [
}
#endif // ]
#endif // __YASAPI_API_NT_H__ ]