1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     hio_Api.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 15915 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_MIDI_CTR_MIDI_API_H_
17 #define NN_MIDI_CTR_MIDI_API_H_
18 
19 /*! @file
20     @brief      MIDI ライブラリの初期化、終了、バージョン取得、ファイル操作を行う API です。
21 
22 */
23 
24 #include <nn/types.h>
25 #include <nn/Result.h>
26 #include <nn/midi/CTR/midi_Types.h>
27 
28 namespace nn {
29 namespace midi {
30 namespace CTR {
31 
32 /*!
33   @name     Initialize/Finalize
34 
35   @{
36 */
37 
38 /*!
39 @brief        MIDI ライブラリの初期化処理を行います。ライブラリ利用前に一度呼び出す必要があります。
40 @return       なし。
41 
42 */
43 void Initialize();
44 
45 
46 /*!
47 @brief        MIDI ライブラリの終了処理を行います。ライブラリ利用後に一度呼び出す必要があります。
48 @return       なし。
49 */
50 void Finalize();
51 
52 /*!
53   @}
54 */
55 
56 /*!
57 @brief        MIDI デバイスを開き、利用可能な状態にします。
58 @return       処理の結果を返します。
59 */
60 Result Open();
61 
62 /*!
63 @brief        MIDI デバイスを閉じます。
64 @return       処理の結果を返します。
65 */
66 Result Close();
67 
68 /*!
69 @brief              MIDI デバイスを Open 直後の状態にします。
70                     別スレッドで Read を呼び出している場合は、Read がエラーを返します。
71 @return             処理の結果を返します。
72 
73 */
74 Result Reset();
75 
76 /*!
77 @brief              デバイス情報を取得します。
78 @param[out] pInfo   デバイス情報の格納先。
79 @return             処理の結果を返します。
80 
81 */
82 Result GetDeviceInfo(DeviceInfo* pInfo);
83 
84 /*!
85 @brief              デバイス内のバッファに蓄積しているデータサイズを取得します。
86 @param[out] pSize   データサイズの格納先。
87 @return             処理の結果を返します。
88 
89 */
90 Result GetReadableLength(s32* pSize);
91 
92 /*!
93 @brief                  データを読み取ります。
94 @param[out]  pBuf       データの格納先。
95 @param[out]  pReadSize  読み込んだデータサイズ。
96 @param[in]   bufferSize バッファサイズ。
97 
98 @return             処理の結果を返します。
99 
100 */
101 Result Read(void* pBuf, s32* pReadSize, s32 bufferSize);
102 
103 
104 
105 
106 
107 }
108 }
109 }
110 
111 
112 #endif  // ifndef NN_MIDI_CTR_MIDI_API_H_
113